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

# Chrome UX Report (CrUX)

> Core Web Vitals from real Chrome users for any origin or popular URL: LCP, INP, CLS, FCP and TTFB distributions and 75th percentiles, as the latest 28 days or a weekly history of up to 40 periods.

![](https://mintcdn.com/webrouter/Wx0iBZkUGX_VAFTN/logo/data-apis/chrome-ux-report.webp?fit=max\&auto=format\&n=Wx0iBZkUGX_VAFTN\&q=85\&s=e4bf7192f060441e3ef8a6495d20600c)

[Web Catalog · SEO](https://docs.webrouter.net/data-apis.md?category=seo)

Needs&#x20;

`CRUX_API_KEY`

Endpoints

2

Auth

Key in query

[Vendor docs](https://developer.chrome.com/docs/crux/api)

## Setup

| Variable | | What it is |
| - | - | - |
| `CRUX_API_KEY` | required | a Google Cloud API key from a project with the Chrome UX Report API enabled (Google Cloud console > APIs & Services > Credentials); the API is free |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Both calls are POSTs that only read data.
* Pass origin or url, never both. Only origins and URLs with enough Chrome traffic have a record; others have none.
* Units follow the metric: LCP, INP, FCP and TTFB in milliseconds; CLS is unitless and its p75 comes back as a string ('0.05').
* Quota: 150 queries per minute per Google Cloud project, shared by both calls, free and not raisable.
* Every record is a 28-day rolling window ending about two days before the update; dates are Pacific Standard Time.

## Endpoints

POST

Get the latest Core Web Vitals for an origin or URL

Histograms and p75 for each metric over the latest 28 days, optionally for one form factor.

[Open](#chrome-ux-report-records-query)

POST

Get the weekly Core Web Vitals history for an origin or URL

Weekly timeseries of each metric's histogram densities and p75, one value per 28-day collection period.

[Open](#chrome-ux-report-history-query)

### Get the latest Core Web Vitals for an origin or URL

POST

`/records:queryRecord`

`chrome-ux-report.records.query`

Histograms and p75 for each metric over the latest 28 days, optionally for one form factor.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`origin`</td><td>string</td><td>body</td><td>An origin, aggregating all its pages: scheme and host, no path. Give this or url. Example `https://www.example.com`</td></tr>

    <tr>
      <td>
        `url`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        One page's URL. Give this or origin.
      </td>
    </tr>

    <tr><td>`formFactor`</td><td>string</td><td>body</td><td>Limit to one device class; omitted means all combined (and adds the form\_factors split). One of `DESKTOP`, `PHONE`, `TABLET`</td></tr>
    <tr><td>`metrics`</td><td>array</td><td>body</td><td>Metric names; all available when omitted. E.g. largest\_contentful\_paint, interaction\_to\_next\_paint, cumulative\_layout\_shift, first\_contentful\_paint, experimental\_time\_to\_first\_byte, navigation\_types, round\_trip\_time, form\_factors. Example `["largest_contentful_paint", "interaction_to_next_paint", "cumulative_layout_shift"]`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer.chrome.com/docs/crux/api)

```python Python theme={null}
router.call_data_api("chrome-ux-report.records.query", {'origin': 'https://www.example.com', 'metrics': ['largest_contentful_paint', 'interaction_to_next_paint', 'cumulative_layout_shift']})
```

```text MCP theme={null}
call_data_api(endpoint="chrome-ux-report.records.query", params={"origin": "https://www.example.com", "metrics": ["largest_contentful_paint", "interaction_to_next_paint", "cumulative_layout_shift"]})
```

> [!NOTE]
>
> * A POST that only reads data.
> * Updated daily around 04:00 UTC, best effort; calls the same day return the same record.

### Get the weekly Core Web Vitals history for an origin or URL

POST

`/records:queryHistoryRecord`

`chrome-ux-report.history.query`

Weekly timeseries of each metric's histogram densities and p75, one value per 28-day collection period.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`origin`</td><td>string</td><td>body</td><td>An origin, aggregating all its pages. Give this or url. Example `https://www.example.com`</td></tr>

    <tr>
      <td>
        `url`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        One page's URL. Give this or origin.
      </td>
    </tr>

    <tr><td>`formFactor`</td><td>string</td><td>body</td><td>Limit to one device class; omitted means all combined. One of `DESKTOP`, `PHONE`, `TABLET`</td></tr>

    <tr>
      <td>
        `metrics`
      </td>

      <td>
        array
      </td>

      <td>
        body
      </td>

      <td>
        Metric names, as for the latest record; all available when omitted.
      </td>
    </tr>

    <tr><td>`collectionPeriodCount`</td><td>integer</td><td>body</td><td>How many weekly periods, 1 to 40. 25 when omitted. Example `40`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developer.chrome.com/docs/crux/history-api)

```python Python theme={null}
router.call_data_api("chrome-ux-report.history.query", {'origin': 'https://www.example.com', 'collectionPeriodCount': 40})
```

```text MCP theme={null}
call_data_api(endpoint="chrome-ux-report.history.query", params={"origin": "https://www.example.com", "collectionPeriodCount": 40})
```

> [!NOTE]
>
> * A POST that only reads data.
> * collectionPeriods lists the periods oldest first, and every timeseries array lines up with it by index. A period without enough data holds 'NaN' in densities and fractions and null in p75s.
> * Updated weekly on Mondays around 04:00 UTC with data through the previous Saturday.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.