Skip to main content

PageSpeed Insights API

developer
GET/v1/domain/pagespeed

Runs a Lighthouse audit via the Google PageSpeed Insights API. Returns performance, accessibility, best-practices, and SEO scores, plus top optimization opportunities and diagnostics.

What It Does

Submits the domain to Google PageSpeed Insights API for a full Lighthouse audit. Returns category scores (performance, accessibility, best practices, SEO), detailed optimization opportunities with estimated savings, diagnostic information, and real-world loading experience data from CrUX. Supports both mobile and desktop strategies. Category and audit output follows the upstream Lighthouse version; field data is only included when available for the requested page.

Why It's Useful

PageSpeed Insights is the industry standard for web performance measurement. Integrating it via API enables automated performance monitoring, CI/CD gates, and competitive benchmarking without manual browser testing.

Use Cases

Performance Engineer

Performance Monitoring

Track PageSpeed scores over time to detect performance regressions after deployments.

Catch performance issues before they impact user experience and SEO.

DevOps Engineer

CI/CD Performance Gate

Block deployments when PageSpeed performance score drops below a threshold.

Prevent performance regressions from reaching production.

Product Manager

Competitive Benchmarking

Compare PageSpeed scores against top competitors to identify performance gaps.

Set data-driven performance targets based on competitive landscape.

Parameters

NameLocationTypeRequiredDescription
domainquerystringRequiredDomain or full URL — accepts `example.com` or `https://example.com/path`.Example: https://example.com
strategyquerystringOptionalAudit strategy: mobile or desktop (default: mobile)Example: mobileOptions: mobile, desktop

Response Fields

Result fields below are inside the JSON data object. Any row named meta describes the sibling response metadata object. See response and error handling for status codes and error responses. Optional observations may be absent or null; inspect warnings and partial-failure fields before treating a missing result as a negative finding.

FieldTypeDescription
domainstringThe audited domain (bare hostname).
urlstringFull URL that was fetched, echoing the protocol used in the request.
strategystringThe audit strategy used (mobile/desktop)
fetchTimestringISO 8601 timestamp when the Lighthouse audit was performed
scoresobjectCategory scores: performance, accessibility, bestPractices, seo, and per-metric performance breakdown
scores.performanceMetricsobjectPer-metric Lighthouse breakdown (lcp, cls, tbt, fcp, si, tti, ttfb) each with numericValue, displayValue, score, and rating (good/needs-improvement/poor)
opportunitiesarrayOptimization opportunities with estimated savings (savings string, savingsMs, savingsBytes)
diagnosticsarrayDiagnostic information and display values
passedAuditsarrayAudits that scored a perfect 1.0 — what is already correct
categoryAuditsobjectFailed audits per non-perf category (accessibility, bestPractices, seo) with weight, displayValue, helpUrl — actionable WCAG-mapped list
redirectsarrayRedirect chain with URLs and wasted time per redirect
loadingExperienceobjectReal-world CrUX loading experience metrics
fieldLabDeltaobjectPer-metric (lcp, cls, fcp, ttfb) gap between CrUX field data and Lighthouse lab; fieldWorseThanLab flag identifies real-user issues invisible to synthetic tests

Code Examples

Replace YOUR_API_KEY with your API key. This endpoint requires the developer plan or higher; see plans and usage limits.

cURL
curl --request GET 'https://api.edgedns.dev/v1/domain/pagespeed?domain=https%3A%2F%2Fexample.com' \
  --header "Authorization: Bearer YOUR_API_KEY"
JavaScript
const response = await fetch(
  "https://api.edgedns.dev/v1/domain/pagespeed?domain=https%3A%2F%2Fexample.com",
  {
    "method": "GET",
    "headers": {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  }
);

if (!response.ok) {
  throw new Error(`EdgeDNS returned HTTP ${response.status}`);
}
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    'GET',
    "https://api.edgedns.dev/v1/domain/pagespeed?domain=https%3A%2F%2Fexample.com",
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    timeout=60,
)
response.raise_for_status()
data = response.json()
print(data)

Read the full PageSpeed Insights guide

Learn the concepts, choose a practical workflow, and interpret the observations from PageSpeed Insights before acting on them. Run supported checks via MCP or through REST.

Read the guide →

    Related Endpoints

    External References

    Learn more about the standards and protocols behind this endpoint.

    Try This Endpoint

    Test the PageSpeed Insights endpoint live in the playground.

    PageSpeed Insights API Reference | EdgeDNS