canonical: https://jentic.com/apis/googleapis.com/pagespeedonline

# Google PageSpeed Insights API

The PageSpeed Insights API runs Lighthouse against any public URL and returns a structured performance report including Core Web Vitals, lab metrics, and optimisation suggestions. It exposes a single runPagespeed endpoint that accepts a URL plus options for strategy (mobile or desktop) and the categories to score (performance, accessibility, best-practices, SEO, PWA). Use it to integrate web performance budgets into CI, build dashboards that track real-user metrics over time, or pull suggestions to feed engineering backlogs. The spec exposes 1 endpoint.

## For AI agents

Run a Lighthouse-based performance audit on any public URL and read back Core Web Vitals, lab metrics, and optimisation suggestions.

## Scope

Does not run real-user monitoring, audit authenticated flows, or fix performance issues - use for synthetic Lighthouse audits of public URLs only.

## Capabilities

- Run a mobile or desktop Lighthouse audit against any public URL
- Read Core Web Vitals (LCP, INP, CLS) along with lab and field metrics
- Pull category scores for performance, accessibility, best-practices, SEO, and PWA
- Surface specific audit failures with their affected DOM nodes and savings estimates
- Capture screenshot timelines and resource summaries for a tested page

## Use cases

### Performance budgets in CI

Run PageSpeed Insights against staging URLs after every deploy and fail the build if the performance score drops below a budget or if a Core Web Vital regresses. The single runPagespeed endpoint returns enough structured data - category scores plus per-audit results - to assert specific thresholds. Pairs naturally with PRs that compare current vs main scores.

Example prompt: Call GET /pagespeedonline/v5/runPagespeed with url=https://staging.example.com and strategy=MOBILE, parse the performance score, and fail the build if it is below 0.85.

### Field metrics dashboards

Aggregate Core Web Vitals from PageSpeed Insights - including the CrUX field data - into a dashboard that tracks LCP, INP, and CLS for a portfolio of URLs over time. The structured response makes it cheap to extract metrics on a daily cron without scraping the public PSI page. Useful for content sites, e-commerce, and marketing teams reporting on page experience.

Example prompt: For every URL in homepages.json, call runPagespeed with strategy=MOBILE, extract loadingExperience metrics, and append them to a BigQuery table for trend reporting.

### Optimisation suggestion feed for engineering

Pull the audits array from a PageSpeed Insights response to surface actionable recommendations - image format conversion, unused JavaScript, render-blocking resources - and turn them into engineering tickets. Each audit comes with details on the offending elements, byte savings estimates, and links to documentation.

Example prompt: Call runPagespeed for the URL https://example.com/products, extract any audit with score below 0.5 and weighted savings above 100ms, and create a Jira ticket for each.

### Agent-driven page health checks via Jentic

A site-reliability agent reacting to a slow-page complaint can use Jentic to call PageSpeed Insights and reply with a precise breakdown of what regressed. Credentials stay in your Jentic One instance, so the agent runs under a scoped key with audit trail. Useful for support bots that need to triage performance complaints automatically.

Example prompt: Use Jentic to find the run-pagespeed operation, load its schema, and execute it for the complained-about URL with strategy=MOBILE, then reply with LCP, INP, and CLS values.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /pagespeedonline/v5/runPagespeed | Run a Lighthouse audit against a URL |

## Key resources

- **runPagespeed** — Single Lighthouse audit run for a URL

## Why Jentic

- **Setup:** Wiring the PageSpeed Insights API by hand means handling Google OAuth 2.0 or an API key, minting scoped tokens, and assembling the runPagespeed query against pagespeedonline.googleapis.com yourself. Through Jentic you install once, import the PageSpeed Insights API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** The PageSpeed Insights API exposes a single read endpoint (/pagespeedonline/v5/runPagespeed), so limit the agent to the operation it needs: running a synthetic Lighthouse audit of a public URL. That read is the only operation in the allowed set, so the agent cannot change anything on your account.
- **Credential handling:** Your PageSpeed Insights credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'audit a page's performance', and Jentic returns the runPagespeed operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Search Console API** — Search Console reports indexing and Core Web Vitals trends in the wider site context
- **Google Analytics Data API** — Analytics Data exposes real-user behaviour metrics that complement Lighthouse audits
- **Web Risk API** — Web Risk checks URL safety; PageSpeed Insights checks performance and quality

## FAQ

### What authentication does the PageSpeed Insights API use?

The API supports anonymous use with a basic quota and Google OAuth 2.0 / API key for higher quotas. Through Jentic, the API key is stored encrypted in your Jentic One instance and attached to each request, so agents never see the raw key.

### Can I get Core Web Vitals from this API?

Yes. The runPagespeed response includes a loadingExperience field with field-level Core Web Vitals (LCP, INP, CLS) sourced from the Chrome User Experience Report when enough field data is available.

### What are the rate limits for the PageSpeed Insights API?

Anonymous calls are limited to a small number of queries per second; with an API key the default is 25,000 queries per day per project. For higher volume, request a quota increase in the Cloud Console rather than retrying on 429.

### How do I run an audit through Jentic?

Search Jentic for run pagespeed audit, load the schema for GET /pagespeedonline/v5/runPagespeed, and execute it with the URL, strategy, and category list. Jentic returns the structured Lighthouse report for parsing.

### Is the PageSpeed Insights API free?

Yes - the public PSI API is free within the documented quota. You only pay if you wrap it inside another billable Google Cloud product like Cloud Run for orchestration.

### Does this API audit pages behind authentication?

No - runPagespeed only reaches public URLs. To audit authenticated flows, run Lighthouse locally with cookies or a service-worker, then use this API only for public benchmarks.

### Can I limit what my agent is allowed to do with the PageSpeed Insights API?

Yes. Because you self-host Jentic One, your own rules decide which operations and credentials the agent may use, and the PageSpeed Insights API exposes a single read operation, runPagespeed, so you can restrict the agent to running a synthetic Lighthouse audit of a public URL and nothing else. That read is the only call in the allowed set, so the agent cannot change anything on your Google account or reach any other endpoint. You control the scoping at the operator level, keeping the agent limited to on-demand performance audits.
