Automate PageSpeed Insights API calls across a page inventory while respecting daily and per-second rate limits

domain: developers.google.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Generate a PageSpeed Insights API key in Google Cloud Console to unlock the higher quota tier (unauthenticated calls are far more limited)
  2. Call the pagespeedonline v5 runPagespeed endpoint per URL, specifying strategy (mobile/desktop) and category params to avoid pulling unneeded audits
  3. Throttle concurrent requests to stay under roughly 400 queries per 100 seconds per project, in addition to the daily cap
  4. Queue and retry on 429 responses with exponential backoff rather than immediately re-requesting the same URL
  5. Cache results for a reasonable interval (e.g. hours, not seconds) since PSI runs a fresh Lighthouse audit and CrUX lookup on every call, which is comparatively expensive
  6. Separate lab metrics (from the Lighthouse result) from field metrics (from the embedded loadingExperience/CrUX block) when storing results, since they answer different questions

Known gotchas

Related routes

Automate page performance audits using the PageSpeed Insights API
core-web-vitals · 5 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