Skip to main content

PageSpeed Insights

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. Lighthouse 13 performance scoring weights: TBT 30%, LCP 25%, CLS 25%, FCP 10%, SI 10%.

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

NameTypeRequiredDescription
domainstringRequiredThe domain to run PageSpeed audit onExample: example.com
strategystringOptionalAudit strategy: mobile or desktop (default: mobile)Example: mobileOptions: mobile, desktop

Response Fields

FieldTypeDescription
domainstringThe audited domain
strategystringThe audit strategy used (mobile/desktop)
fetchTimestringISO 8601 timestamp when the Lighthouse audit was performed
scoresobjectCategory scores: performance, accessibility, bestPractices, seo
opportunitiesarrayOptimization opportunities with estimated savings
diagnosticsarrayDiagnostic information and display values
redirectsarrayRedirect chain with URLs and wasted time per redirect
loadingExperienceobjectReal-world CrUX loading experience metrics

Code Examples

cURL
curl "https://api.edgedns.dev/v1/domain/pagespeed" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "domain=example.com"
JavaScript
const response = await fetch(
  'https://api.edgedns.dev/v1/domain/pagespeed?domain=example.com',
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const data = await response.json();
console.log(data);
Python
import requests

response = requests.get(
    'https://api.edgedns.dev/v1/domain/pagespeed',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={
    'domain': 'example.com'
    }
)

data = response.json()
print(data)

Read the full PageSpeed Insights guide

Why it matters, real-world use cases, parameters, response fields, and how to call it from Claude, ChatGPT, or Gemini via MCP.

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.