PageSpeed Insights
developer/v1/domain/pagespeedRuns 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 Monitoring
Track PageSpeed scores over time to detect performance regressions after deployments.
Catch performance issues before they impact user experience and SEO.
CI/CD Performance Gate
Block deployments when PageSpeed performance score drops below a threshold.
Prevent performance regressions from reaching production.
Competitive Benchmarking
Compare PageSpeed scores against top competitors to identify performance gaps.
Set data-driven performance targets based on competitive landscape.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Required | Domain or full URL — accepts `example.com` or `https://example.com/path`.Example: https://example.com |
strategy | string | Optional | Audit strategy: mobile or desktop (default: mobile)Example: mobileOptions: mobile, desktop |
Response Fields
| Field | Type | Description |
|---|---|---|
domain | string | The audited domain (bare hostname). |
url | string | Full URL that was fetched, echoing the protocol used in the request. |
strategy | string | The audit strategy used (mobile/desktop) |
fetchTime | string | ISO 8601 timestamp when the Lighthouse audit was performed |
scores | object | Category scores: performance, accessibility, bestPractices, seo, and per-metric performance breakdown |
scores.performanceMetrics | object | Per-metric Lighthouse breakdown (lcp, cls, tbt, fcp, si, tti, ttfb) each with numericValue, displayValue, score, and rating (good/needs-improvement/poor) |
opportunities | array | Optimization opportunities with estimated savings (savings string, savingsMs, savingsBytes) |
diagnostics | array | Diagnostic information and display values |
passedAudits | array | Audits that scored a perfect 1.0 — what is already correct |
categoryAudits | object | Failed audits per non-perf category (accessibility, bestPractices, seo) with weight, displayValue, helpUrl — actionable WCAG-mapped list |
redirects | array | Redirect chain with URLs and wasted time per redirect |
loadingExperience | object | Real-world CrUX loading experience metrics |
fieldLabDelta | object | Per-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
curl "https://api.edgedns.dev/v1/domain/pagespeed" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "domain=https://example.com"const response = await fetch(
'https://api.edgedns.dev/v1/domain/pagespeed?domain=https%3A%2F%2Fexample.com',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(data);import requests
response = requests.get(
'https://api.edgedns.dev/v1/domain/pagespeed',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'domain': 'https://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.