Automate page performance audits using the PageSpeed Insights API

domain: core-web-vitals · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Enable the PageSpeed Insights API in a Google Cloud project and generate credentials for server-to-server calls
  2. Call GET https://pagespeedonline.googleapis.com/pagespeedonline/v5/runPagespeed with the target URL and a strategy parameter (mobile or desktop)
  3. Parse both the lighthouseResult (lab data) and loadingExperience/originLoadingExperience (field CrUX data) sections — they answer different questions
  4. Schedule recurring calls (e.g., nightly per key template/URL) and store results to trend Core Web Vitals and Lighthouse scores over time
  5. Stay within the default quota of 25,000 queries/day (400 per 100 seconds), or request a quota increase before scaling to large URL sets

Known gotchas

Related routes

Automate PageSpeed Insights API calls across a page inventory while respecting daily and per-second rate limits
developers.google.com · 6 steps · unrated
Manage PageSpeed Insights API rate limits when running large-scale batch Lighthouse audits
developers.google.com · 5 steps · unrated
Automate Lighthouse runs using the PageSpeed Insights API
developers.google.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans