# web.render

Load one public web page in a browser and get its HTML after the page's JavaScript ran.

Rendered web page, one of the Web scrapers.

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

Start it with `POST /v1/scrapers/web.render/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. |
| `wait_until` | "load" \| "domcontentloaded" \| "networkidle" | no | What to wait for after the page starts loading: `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 it is read, e.g. `ul.results li`. 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 the whole render, waits included. Limit: 5 to 60. Default: `30`. |
| `max_bytes` | integer | no | The document is cut after this many bytes; `truncated` says when it was. Limit: 1 to 10000000. Default: `2000000`. |
| `block` | array of "images" \| "media" \| "fonts" \| "stylesheets" | no | Resource types the page is not allowed to load. Images, media and fonts by default. |
| `actions` | array of any | no | Up to 10 steps carried out on the page after it loaded, in order, before it is read: `wait_for_selector`, `click`, `type`, `press`, `scroll` and `wait`. For a page that shows its content only after a search, a click on "load more" or a scroll. The first step that fails ends the list. |

- The page is loaded in a browser of ours, its scripts run, and `html` is the document as it then stands. For a page whose content is already in what the server sends, `web.fetch` is faster and returns the same.
- Three waits, in this order, all within `timeout_s` (30 seconds by default, 60 at most): `wait_until` — `domcontentloaded`, `load` or `networkidle` —, then `wait_for_selector`, a plain CSS selector that must be in the page, then `wait_ms` more.
- When a wait does not come true in time the run ends `partial` with `wait_timed_out`: the record is the page as it stood, and `wait_satisfied` is `false`.
- `block` names what the page may not load: `images`, `media` and `fonts` by default; add `stylesheets` for a lighter page, or send `[]` to load everything.
- Nothing of yours is sent with the page: no request header, no cookie, no script. No screenshot or PDF is made, and nothing is kept between two runs.
- A page the site itself answers with `404` or `500` is `ok`, and the record carries that `status`. A site that refuses the browser ends the run `failed` with `blocked`, `rate_limited` or `captcha`, and costs nothing.
- The document is cut after `max_bytes` — 2,000,000 by default, 10,000,000 at most — and `truncated` is `true` when it was. A page that asks for far more requests or bytes than a page needs is stopped, and the run ends `partial` with `resource_limit`.
- `url` follows the rules of `web.fetch`: `http` or `https`, a public host name, port 80, 443, 8080 or 8443, no login. An address that is not a web page ends `unsupported` with `not_html` — see [the reasons of this family](https://docs.enrichednow.com/results-and-statuses.md#web).

## 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 that was read, after redirects and navigation. |
| `status` | integer | The HTTP status of the page's own document (a 404 or 500 is still the page). |
| `headers` | object of string values | The document's response headers that describe the page, names in lower case. |
| `content_type` | string or null | The media type of the document, without parameters. |
| `html` | string | The document as HTML, after its scripts ran. |
| `bytes` | integer | The size of `html` in bytes (UTF-8). |
| `truncated` | boolean | True when the document was longer than max_bytes and was cut. |
| `wait_satisfied` | boolean | False when the wait condition did not come true in time. |
| `redirects` | array of string | The addresses the redirects led to, in order. |
| `requests` | integer | Requests the page made while it was rendered. |
| `actions` | array of object | What each action of the input did, in order, up to and including the first that failed. Empty when none was asked for. |
| `actions[].type` | string | The action's type. |
| `actions[].ok` | boolean | True when the action was carried out. |
| `actions[].reason` | string or null | Why it was not: `element_not_found` (nothing matched the selector in time), `element_not_visible` (what matched is not shown on the page), `action_refused` (text for a password, one-time-code or card field), `out_of_time`, or `action_failed`. Null when it was carried out. |
| `actions[].ms` | integer | Milliseconds the action took. |
| `actions[].times` | integer or null | With `repeat`: how many times the step was carried out. Null without it. |
| `render_ms` | integer | Milliseconds the render took. |
| `fetched_at` | string (date-time) | When the render ended, 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.render/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"url":"https://docs.widgetlib.org/en/stable/quickstart.html"}}'
```

## 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.render",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "url": "https://docs.widgetlib.org/en/stable/quickstart.html"
  },
  "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 was read by this scraper's own parser from a page built by hand for its tests, because no real page could be recorded: its fields and shapes are the scraper's, its values are invented.

```json
{
  "records": [
    {
      "url": "https://docs.widgetlib.org/en/stable/quickstart.html",
      "final_url": "https://docs.widgetlib.org/en/stable/quickstart.html",
      "status": 200,
      "headers": {
        "content-type": "text/html; charset=utf-8"
      },
      "content_type": "text/html",
      "html": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\">\n<head>\n  <meta charset=\"utf-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n  <title>Quickstart &mdash; widgetlib 2.4 documentation</title>\n  <base … [truncated]",
      "bytes": 3848,
      "truncated": false,
      "wait_satisfied": true,
      "redirects": [],
      "requests": 7,
      "actions": [],
      "render_ms": 480,
      "fetched_at": "2026-11-19T18:07:42.613126Z"
    }
  ],
  "next_cursor": null
}
```

What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with `… [truncated]`.

- Shortened: `html`: 3,846 characters, the first 229 shown.

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.
