> ## 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.

# Google PageSpeed Insights

> Lighthouse audits of any public URL (performance by default; accessibility, best-practices and SEO scores when asked for by category) plus the Chrome field data Google holds for the page and its origin.

![](https://mintcdn.com/webrouter/gPu3tCeozwRcDBjt/logo/data-apis/google-pagespeed-insights.webp?fit=max\&auto=format\&n=gPu3tCeozwRcDBjt\&q=85\&s=05091ed6f9d39088c61c83d4135e99d3)

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

Needs&#x20;

`PAGESPEED_API_KEY`

Endpoints

1

Auth

Key in query

[Vendor docs](https://developers.google.com/speed/docs/insights/v5/get-started)

## Setup

| Variable | | What it is |
| - | - | - |
| `PAGESPEED_API_KEY` | required | a Google Cloud API key from a project with the PageSpeed Insights API enabled (Google Cloud console > APIs & Services > Credentials) |

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

## Notes

* Each call runs a fresh Lighthouse audit of the live page, so it takes seconds to tens of seconds; the answer is large (every audit's details under lighthouseResult).
* Lab data is lighthouseResult; field data from real Chrome users is loadingExperience (the URL) and originLoadingExperience (the whole origin), present only when Chrome has enough traffic for it. Google says this field data will leave the API: use the Chrome UX Report API for it.
* Lighthouse category scores are 0 to 1 (multiply by 100 for the score PageSpeed shows).

## Endpoints

GET

Audit a page with Lighthouse

Lighthouse scores and audits for one URL on mobile or desktop, with the page's and origin's Chrome field data.

[Open](#google-pagespeed-insights-run)

### Audit a page with Lighthouse

GET

`/runPagespeed`

`google-pagespeed-insights.run`

Lighthouse scores and audits for one URL on mobile or desktop, with the page's and origin's Chrome field data.

Input

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

      <th>
        Type
      </th>

      <th>
        In
      </th>

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

  <tbody>
    <tr><td>`url` required</td><td>string</td><td>query</td><td>The full URL to audit. Example `https://www.example.com/`</td></tr>
    <tr><td>`category`</td><td>array</td><td>query</td><td>Lighthouse categories to run, repeated: PERFORMANCE, ACCESSIBILITY, BEST\_PRACTICES, SEO. Only PERFORMANCE runs when omitted. Example `["PERFORMANCE", "SEO"]`</td></tr>
    <tr><td>`strategy`</td><td>string</td><td>query</td><td>Device to emulate. DESKTOP when omitted. One of `DESKTOP`, `MOBILE`</td></tr>

    <tr>
      <td>
        `locale`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Locale for the audit text in the answer, e.g. en or de.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed)

```python Python theme={null}
router.call_data_api("google-pagespeed-insights.run", {'url': 'https://www.example.com/', 'category': ['PERFORMANCE', 'SEO']})
```

```text MCP theme={null}
call_data_api(endpoint="google-pagespeed-insights.run", params={"url": "https://www.example.com/", "category": ["PERFORMANCE", "SEO"]})
```

> [!NOTE]
>
> * Asks for PERFORMANCE alone unless category names more; send each category as its own category value.


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