> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dumplingai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Screenshot

> Capture a full-page screenshot, viewport screenshot, or PDF rendition of a URL.

## Description

This endpoint captures a screenshot of a specified URL, with options to customize the viewport, block cookie banners, set a wait time before capturing, and more.

## Endpoint

```
POST https://app.dumplingai.com/api/v1/screenshot
```

## Headers

* **Content-Type:** `application/json`
* **Authorization:** Bearer `<API_KEY>` (required)

## Request Body

```json theme={null}
{
  "url": "string", // Required. The URL to capture.
  "fullPage": "boolean", // Optional. Whether to capture the full page. Default: false.
  "viewport": {
    // Optional. The viewport dimensions. Default: { width: 1024, height: 1024 }
    "width": "number",
    "height": "number"
  },
  "clipRectangle": {
    // Optional. The area of the screen to clip. fullPage must be false to use this. Defaults to viewport.
    "top": "number",
    "left": "number",
    "width": "number",
    "height": "number"
  },
  "blockCookieBanners": "boolean", // Optional. Whether to block cookie banners. Default: true.
  "wait": "number", // Optional. Time to wait before capture in ms. Max: 5000. Default: 0.
  "autoScroll": "boolean" // Optional. Whether to automatically scroll the page (e.g. for lazy loaded images). Default: false.
}
```

## Responses

### Success (200)

Returns the screenshot data and related information.

```json theme={null}
{
  "screenshotUrl": "string" // URL of the captured screenshot
}
```

* **Content-Type:** application/json
* **X-RateLimit-Limit:** The rate limit for the user.
* **X-RateLimit-Remaining:** The remaining number of requests for the user.

### Bad Request (400)

Returned if the request is invalid.

```json theme={null}
{
  "error": "Error message describing the issue"
}
```

### Internal Server Error (500)

Returned if there's an error during the screenshot process.

```json theme={null}
{
  "error": "Failed to screenshot: [error message]"
}
```

## Example Request

```bash theme={null}
curl -X POST https://app.dumplingai.com/api/v1/screenshot \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
  "url": "https://example.com",
  "fullPage": true,
  "viewport": {
    "width": 1920,
    "height": 1080
  },
  "blockCookieBanners": true,
  "wait": 1000,
  "autoScroll": true
}'
```

## Example Response

```json theme={null}
{
  "screenshotUrl": "https://storage.example.com/screenshots/abcdef123456.png"
}
```

## Notes

* The `viewport` width must be less than or equal to 3840 pixels, and the height must be less than or equal to 10240 pixels.
* The maximum `wait` time is 5000 milliseconds (5 seconds).
* Credit usage:
  * Base cost: 20 credits
  * Additional 10 credits if `autoScroll` is true
  * Additional 10 credits if `wait` is set (any non-zero value)
* If the URL doesn't include a protocol, `https://` will be used by default.
* The `clipRectangle` option can only be used when `fullPage` is set to false.
* Usage is recorded with detailed parameters for each request.
* Events may be logged to PostHog for analytics purposes if enabled.

## Rate Limiting

Rate limit headers (`X-RateLimit-Limit` and `X-RateLimit-Remaining`) are included in the response to indicate the user's current rate limit status.


## OpenAPI

````yaml POST /api/v1/screenshot
openapi: 3.0.3
info:
  title: DumplingAI API
  version: 1.0.0
  description: >
    REST API for DumplingAI's content intelligence and automation platform.

    All endpoints are grouped under `/api/v1`; most are secured via Bearer API
    keys unless an operation explicitly sets `security: []`.
servers:
  - url: https://app.dumplingai.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: YouTube
    description: Access metadata, search results, and transcripts from YouTube.
  - name: TikTok
    description: Retrieve TikTok profile, video, follower, and transcript data.
  - name: LinkedIn
    description: Programmatically fetch LinkedIn company and profile data.
  - name: Search
    description: Search-orientated endpoints spanning web, news, maps, and autocomplete.
  - name: Google
    description: Integrations with Google business listings and location data.
  - name: Scraping
    description: Webpage capture, crawling, and structured content extraction utilities.
  - name: Documents
    description: Document processing, conversion, and metadata utilities.
  - name: AI
    description: DumplingAI agent and knowledge base endpoints.
  - name: Developer Tools
    description: Utilities for executing sandboxed code via API.
paths:
  /api/v1/screenshot:
    post:
      tags:
        - Scraping
      summary: Screenshot webpage
      description: >-
        Capture a full-page screenshot, viewport screenshot, or PDF rendition of
        a URL.
      operationId: screenshotWebpage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScreenshotRequest'
            examples:
              default:
                value:
                  url: https://example.com
                  fullPage: true
                  viewport:
                    width: 1280
                    height: 720
                  wait: 1000
      responses:
        '200':
          description: Screenshot data returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScreenshotResponse'
        '400':
          description: Invalid request payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ScreenshotRequest:
      type: object
      description: Options for capturing a screenshot of a webpage.
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: Fully-qualified URL to capture.
        fullPage:
          type: boolean
          default: false
          description: Capture the entire scrollable page.
        viewport:
          $ref: '#/components/schemas/ScreenshotViewport'
        clipRectangle:
          $ref: '#/components/schemas/ScreenshotClipRectangle'
        blockCookieBanners:
          type: boolean
          default: true
          description: Attempt to hide cookie banners before capturing the screenshot.
        wait:
          type: integer
          minimum: 0
          maximum: 5000
          default: 0
          description: >-
            Delay in milliseconds before capturing, allowing the page to finish
            loading.
        autoScroll:
          type: boolean
          default: false
          description: Scroll the page to trigger lazy-loaded content before capturing.
        requestSource:
          $ref: '#/components/schemas/RequestSource'
      additionalProperties: false
    ScreenshotResponse:
      type: object
      required:
        - screenshotUrl
      properties:
        screenshotUrl:
          type: string
          format: uri
          description: Temporary download URL for the generated screenshot.
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable description of what went wrong.
      required:
        - error
    ScreenshotViewport:
      type: object
      description: Browser viewport size in pixels.
      required:
        - width
        - height
      properties:
        width:
          type: integer
          minimum: 1
          maximum: 3840
        height:
          type: integer
          minimum: 1
          maximum: 10240
      additionalProperties: false
    ScreenshotClipRectangle:
      type: object
      description: Clipping rectangle when capturing a partial screenshot.
      required:
        - top
        - left
        - width
        - height
      properties:
        top:
          type: number
        left:
          type: number
        width:
          type: number
        height:
          type: number
      additionalProperties: false
    RequestSource:
      type: string
      description: Optional identifier describing where the API request originated.
      enum:
        - API
        - WEB
        - MAKE_DOT_COM
        - ZAPIER
        - N8N
        - PLAYGROUND
        - DEFAULT_AUTOMATION
        - AGENT_PREVIEW
        - AGENT_LIVE
        - AUTOPILOT
        - STUDIO
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````