# web.speed

Measure how fast and how heavy one public web page is on a phone or a desktop: load timings, Core Web Vitals, page weight, a 0-100 score and plain findings.

Page speed and weight, one of the Web scrapers.

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

Start it with `POST /v1/scrapers/web.speed/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. |
| `device` | "mobile" \| "desktop" | no | `mobile`: a mid-range phone on a slow 4G connection (CPU four times slower, 1.47 Mbit/s down, 562 ms added to each request). `desktop`: a desktop window, neither slowed. Default: `"mobile"`. |
| `runs` | integer | no | How many times the page is loaded, each time with nothing cached. With more than one, the record is the run with the median score, which is steadier. Limit: 1 to 3. Default: `1`. |

## 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 measured, after redirects. |
| `status` | integer | The HTTP status of the page's own document (a 404 page is still a page, and is measured). |
| `device` | "mobile" \| "desktop" | The device simulated. `mobile`: a 412 by 823 phone window, CPU four times slower, 1.47 Mbit/s down, 0.6 Mbit/s up and 562 ms added to each request. `desktop`: a 1350 by 940 window, neither slowed. |
| `runs_measured` | integer | How many loads were measured. With more than one, this record is the one with the median score. |
| `run_scores` | array of integer | The score of each load, in the order they were made; null for a load that could not be scored. |
| `score` | integer or null | A 0 to 100 speed score (90 or more is good, under 50 is poor). It follows the method Lighthouse publishes, log-normal curves over FCP, LCP, TBT and CLS with Lighthouse's weights scaled to leave out Speed Index, but it is our own measurement from a single location and will not equal a score from another tool. For a page that did not finish (`finished` false) it rests on what had happened by then and may flatter the page. Null when one of the four was not measured. |
| `metric_scores` | object | Each of the four metrics' own 0 to 100 score. |
| `metric_scores.fcp` | integer or null | First Contentful Paint's score, 0 to 100. |
| `metric_scores.lcp` | integer or null | Largest Contentful Paint's score, 0 to 100. |
| `metric_scores.tbt` | integer or null | Total Blocking Time's score, 0 to 100. |
| `metric_scores.cls` | integer or null | Cumulative Layout Shift's score, 0 to 100. |
| `ttfb_ms` | integer or null | Time to First Byte: milliseconds from the start of the navigation to the first byte of the document, redirects included. |
| `fcp_ms` | integer or null | First Contentful Paint: milliseconds until the first text or image is shown. Null when nothing was painted. |
| `lcp_ms` | integer or null | Largest Contentful Paint: milliseconds until the largest text block or image in the window is shown. Null when the browser reported none. |
| `cls` | number or null | Cumulative Layout Shift: how much the content jumps while loading, the worst session window. Under 0.1 is good, over 0.25 is poor. |
| `tbt_ms` | integer or null | Total Blocking Time: milliseconds after First Contentful Paint during which long tasks kept the page from responding (each task's time past 50 ms). |
| `dom_content_loaded_ms` | integer or null | Milliseconds until the DOMContentLoaded event finished. Null when it did not happen in time. |
| `load_ms` | integer or null | Milliseconds until the load event finished. Null when the page had not finished loading when the measurement ended. |
| `lcp_element` | string or null | The HTML tag of the largest element, e.g. `img` or `h1`. Null when the browser reported none. |
| `lcp_resource_url` | string or null | The image the largest element shows. Null when it is text. |
| `total_bytes` | integer | Bytes transferred for the whole page, headers included, compressed as they were sent. |
| `bytes_by_type` | object | The same bytes by kind of file. |
| `bytes_by_type.html` | integer | Bytes of HTML documents, frames included. |
| `bytes_by_type.js` | integer | Bytes of JavaScript. |
| `bytes_by_type.css` | integer | Bytes of style sheets. |
| `bytes_by_type.image` | integer | Bytes of images. |
| `bytes_by_type.font` | integer | Bytes of web fonts. |
| `bytes_by_type.other` | integer | Bytes of everything else: video, audio and data requests. |
| `request_count` | integer | Requests the page and its frames made. |
| `failed_requests` | integer | Requests that failed. |
| `unfinished_requests` | integer | Requests still running when the measurement ended; their bytes so far are counted. |
| `third_party_domains` | integer | How many domains other than the page's own it loaded something from. A company's own second domain, such as a separate CDN address, counts as another. |
| `largest_resources` | array of object | The five largest files the page loaded, largest first. |
| `largest_resources[].url` | string | The file's address. |
| `largest_resources[].bytes` | integer | Bytes transferred for it, headers included, compressed as it was sent. |
| `largest_resources[].type` | "html" \| "js" \| "css" \| "image" \| "font" \| "other" | What kind of file it is. `other` includes video and data requests. |
| `image_count` | integer | Image requests the page made. |
| `old_format_images` | integer | Images of 10 kB or more sent as JPEG, PNG, GIF, BMP or TIFF rather than a modern format such as WebP or AVIF. |
| `old_format_image_bytes` | integer | The bytes of those images. |
| `oversized_images` | integer | Images at least 200 pixels wide stored more than 1.5 times wider than they are shown. |
| `http_version` | string or null | The HTTP version the document came over: `HTTP/1.1` or `HTTP/2`. Our browser does not use HTTP/3, so a site that offers it shows as HTTP/2. |
| `html_compressed` | boolean or null | True when the document was sent compressed (gzip, Brotli, zstd or deflate). Null when its response was not seen. |
| `html_encoding` | string or null | The document's content encoding, e.g. `br` or `gzip`. Null when it was sent without one. |
| `finished` | boolean | False when the page had not finished loading in the time, or reached a limit on requests or bytes: its weight is then at least what is shown. |
| `findings` | array of string | Plain sentences on what is slow or heavy, each with its number, e.g. `LCP 5.8 s: slower than 4 s` or `3.1 MB of JavaScript`. Empty when nothing stands out. |
| `render_ms` | integer | Milliseconds the measurement took, all runs together. |
| `fetched_at` | string (date-time) | When the measurement 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.speed/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"url":"https://www.w3.org/"}}'
```

## 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.speed",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "url": "https://www.w3.org/"
  },
  "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://www.w3.org/",
      "final_url": "https://www.w3.org/",
      "status": 200,
      "device": "mobile",
      "runs_measured": 1,
      "run_scores": [
        96
      ],
      "score": 96,
      "metric_scores": {
        "fcp": 85,
        "lcp": 91,
        "tbt": 100,
        "cls": 100
      },
      "ttfb_ms": 889,
      "fcp_ms": 1996,
      "lcp_ms": 2420,
      "cls": 0.0237,
      "tbt_ms": 11,
      "dom_content_loaded_ms": 1993,
      "load_ms": 5104,
      "lcp_element": "img",
      "lcp_resource_url": "https://www.w3.org/cms-uploads/Hero-illustrations/groups-2025.svg",
      "total_bytes": 536289,
      "bytes_by_type": {
        "html": 9613,
        "js": 22092,
        "css": 54448,
        "image": 415204,
        "font": 34566,
        "other": 366
      },
      "request_count": 23,
      "failed_requests": 0,
      "unfinished_requests": 0,
      "third_party_domains": 0,
      "largest_resources": [
        {
          "url": "https://www.w3.org/cms-uploads/_920xAUTO_crop_center-center_none/ryan-quintal-US9Tc9pKNBU-unsplash.jpg",
          "bytes": 110649,
          "type": "image"
        },
        {
          "url": "https://www.w3.org/cms-uploads/_920xAUTO_crop_center-center_none/marvin-meyer-SYTO3xs06fU-unsplash.jpg",
          "bytes": 100458,
          "type": "image"
        }
      ],
      "image_count": 13,
      "old_format_images": 5,
      "old_format_image_bytes": 341338,
      "oversized_images": 1,
      "http_version": "HTTP/2",
      "html_compressed": true,
      "html_encoding": "br",
      "finished": true,
      "findings": [
        "First paint (FCP) 2.0 s: slower than the 1.8 s target",
        "5 images (341 kB) in JPEG, PNG or GIF rather than WebP or AVIF",
        "1 images stored much larger than they are shown"
      ],
      "render_ms": 1,
      "fetched_at": "2026-11-24T18:00:35.588058Z"
    }
  ],
  "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: `largest_resources`: 5 items, the first 2 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.
