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

# Screenshot

> Capture a screenshot of any page — viewport or full page.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.scrapely.io/v2/tasks/create \
    -H "Content-Type: application/json" \
    -H "X-API-Key: YOUR_API_KEY" \
    -d '{
      "crawler": {
        "websiteURL": "https://example.com",
        "screenshot": true
      }
    }'
  ```

  ```python Python SDK theme={null}
  from scrapely import Scrapely

  client = Scrapely(api_key="YOUR_API_KEY")

  task = client.crawler.crawl(
      website_url="https://example.com",
      screenshot=True
  )

  print(task.result.screenshot)
  ```
</CodeGroup>

## Request fields

| Field                  | Type    | Default | Description                     |
| ---------------------- | ------- | ------- | ------------------------------- |
| `screenshot`           | boolean | `false` | Capture a viewport screenshot.  |
| `screenshot_full_page` | boolean | `false` | Capture a full-page screenshot. |

<Warning>
  `screenshot` and `screenshot_full_page` cannot be used together in the same request.
</Warning>

## Full page screenshot

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.scrapely.io/v2/tasks/create \
    -H "Content-Type: application/json" \
    -H "X-API-Key: YOUR_API_KEY" \
    -d '{
      "crawler": {
        "websiteURL": "https://example.com",
        "screenshot_full_page": true
      }
    }'
  ```

  ```python Python SDK theme={null}
  from scrapely import Scrapely

  client = Scrapely(api_key="YOUR_API_KEY")

  task = client.crawler.crawl(
      website_url="https://example.com",
      screenshot_full_page=True
  )

  print(task.result.screenshot)
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "success": true,
  "task_id": "52989a12-a43c-4bf9-ba1d-8ab1e1509169",
  "status": "completed",
  "created_at": "2026-04-06T10:54:56.652354+00:00",
  "result": {
    "html": "",
    "text": "",
    "screenshot": "base64encodedstring...",
    "user_agent": "",
    "cookies": {},
    "metadata": {},
    "instructions": []
  },
  "completed_at": "2026-04-06T10:55:08.312452+00:00"
}
```

<Info>
  The screenshot is returned as a base64-encoded PNG string.
</Info>
