# web.screenshot

Take a PNG or JPEG screenshot of one public web page: the window, the whole page or one element, on a desktop, tablet or phone.

Web page screenshot, one of the Web scrapers.

| | |
| --- | --- |
| Id | `web.screenshot` |
| Version | 1 |
| Billed per | request — 1 unit for a charged run |
| Runs | within one request |

Start it with `POST /v1/scrapers/web.screenshot/runs`. How runs work is in [Running a scraper](https://docs.enrichednow.com/running-a-scraper.md); what a run costs is in [Usage and units](https://docs.enrichednow.com/usage-and-units.md).

## Inputs

The fields of `input`. A field that is not listed here is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | yes | The page's address: http or https, on a public host name. Limit: at most 2048 characters. |
| `format` | "png" \| "jpeg" | no | The image format. JPEG is several times smaller for a page with photographs. Default: `"png"`. |
| `quality` | integer | no | For JPEG: 1 (smallest) to 100 (best). Limit: 1 to 100. Default: `80`. |
| `full_page` | boolean | no | False: the window only. True: the whole page, top to bottom. Default: `false`. |
| `selector` | string | no | A CSS selector: the picture is of the first element it matches instead of the window, e.g. `#pricing`. Limit: at most 200 characters. |
| `device` | "desktop" \| "desktop_large" \| "tablet" \| "mobile" | no | The device the page is shown on: `desktop` (1366 by 768), `desktop_large` (1920 by 1080), `tablet` (820 by 1180) or `mobile` (390 by 844). A tablet and a phone have a touch screen, a mobile browser's name and two image pixels per page pixel. Default: `"desktop"`. |
| `viewport_width` | integer | no | The window's width in pixels, in place of the device's. Limit: 320 to 2560. |
| `viewport_height` | integer | no | The window's height in pixels, in place of the device's. Limit: 240 to 2160. |
| `wait_until` | "load" \| "domcontentloaded" \| "networkidle" | no | What to wait for before the picture is taken: `domcontentloaded` (the document is parsed), `load` (its resources too), or `networkidle` (no request for half a second). Default: `"load"`. |
| `wait_for_selector` | string | no | A CSS selector that must be in the page before the picture is taken, e.g. `img.hero`. Limit: at most 200 characters. |
| `wait_ms` | integer | no | Milliseconds to wait after the other conditions. Limit: 0 to 10000. Default: `0`. |
| `timeout_s` | number | no | Seconds for loading the page and taking the picture. Limit: 5 to 60. Default: `30`. |

## Record fields

Every record of a run has these fields. A value that is not known is `null` — never an empty string and never `0`.

| Field | Type | Notes |
| --- | --- | --- |
| `url` | string | The address that was asked for. |
| `final_url` | string | The address of the page in the picture, after redirects. |
| `status` | integer | The HTTP status of the page's own document (a 404 page is still a page, and is in the picture). |
| `image_url` | string or null | Where the image is downloaded from. The address works by itself until `image_url_expires_at`; after that, send your API key with it. The file is kept as long as the run's records. |
| `image_url_expires_at` | string (date-time) or null | Until when `image_url` works without an API key, in UTC. |
| `format` | "png" \| "jpeg" | The image's format. |
| `content_type` | string | The image's media type: image/png or image/jpeg. |
| `width` | integer | The image's width in pixels. |
| `height` | integer | The image's height in pixels. |
| `bytes` | integer | The image file's size in bytes. |
| `sha256` | string | The SHA-256 of the image file, in hexadecimal. |
| `full_page` | boolean | True when the whole page was asked for, not the window only. |
| `selector` | string or null | The CSS selector of the element in the picture; null for the window or the page. |
| `device` | string | The device the page was shown on. |
| `viewport_width` | integer | The window's width in page pixels. |
| `viewport_height` | integer | The window's height in page pixels. |
| `truncated` | boolean | True when the page was taller than a picture may be and the picture ends before the page does. |
| `wait_satisfied` | boolean | False when the wait condition did not come true in time; the picture is of the page as it stood. |
| `render_ms` | integer | Milliseconds loading the page and taking the picture took. |
| `fetched_at` | string (date-time) | When the picture was taken, in UTC. |

## Example request

It starts a run with this scraper's example input and waits up to 60 seconds for it. The key is read from `ENRICHEDNOW_API_KEY`.

```bash
curl -X POST "https://api.enrichednow.com/v1/scrapers/web.screenshot/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"url":"https://example.com/"}}'
```

## Example response

The run, once it has ended. A run that has not ended within `wait` comes back with `202` and the status `queued` or `running`.

```json
{
  "id": "run_841742f37553189ff9c27ba1",
  "scraper_id": "web.screenshot",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "url": "https://example.com/"
  },
  "record_count": 1,
  "units": 1,
  "units_per_request": 1,
  "units_per_record": null,
  "units_per_page": null,
  "diagnostics": {
    "requests": 1,
    "bytes": 259214,
    "wall_ms": 885,
    "facts": {}
  },
  "created_at": "2026-11-16T22:37:50.170950Z",
  "started_at": "2026-11-16T22:37:50.178331Z",
  "finished_at": "2026-11-16T22:37:51.066313Z"
}
```

Its records, from `GET /v1/runs/{id}/records`. The record is a real one: this scraper's own parser read it from a page recorded from the site.

```json
{
  "records": [
    {
      "url": "https://example.com/",
      "final_url": "https://example.com/",
      "status": 200,
      "image_url": null,
      "image_url_expires_at": null,
      "format": "png",
      "content_type": "image/png",
      "width": 1366,
      "height": 768,
      "bytes": 73213,
      "sha256": "4cc3b61f1186174f6ec7085cca0ab96bb2382cbecf37caf33c5bafd29b5393f8",
      "full_page": false,
      "selector": null,
      "device": "desktop",
      "viewport_width": 1366,
      "viewport_height": 768,
      "truncated": false,
      "wait_satisfied": true,
      "render_ms": 480,
      "fetched_at": "2026-11-19T18:07:42.616469Z"
    }
  ],
  "next_cursor": null
}
```

A run does not always end `ok`. [Results and statuses](https://docs.enrichednow.com/results-and-statuses.md#reason-codes) lists every status and the reasons every scraper shares; [the reasons of the Web scrapers](https://docs.enrichednow.com/results-and-statuses.md#web) are in their own section there.
