Skip to main content

Core Web Vitals API

developer
GET/v1/domain/web-vitals

Analyzes server response timing and source-HTML factors associated with LCP, CLS and INP. Returns a diagnostic score, grade and recommendations. It does not run a browser, measure actual LCP/CLS/INP, or return Chrome UX Report field data.

What It Does

Measures final-fetch response-headers time separately from body transfer and examines actual source elements for render-blocking resources, image dimensions, resource hints, script loading and other performance risks. The 0–100 diagnostic score weights synthetic headers timing at 25 points, LCP-related factors at 35, CLS-related factors at 25 and INP-related factors at 15. These are heuristic risk checks, not observed user-experience metrics. Use PageSpeed Insights for available lab and field data, and browser or real-user measurements to validate improvements.

Why It's Useful

Identify source-HTML and server-response changes to investigate before running browser measurements. This provides diagnostics even when a site has insufficient traffic for public field data.

Use Cases

Frontend Engineer

Performance Regression Review

Compare server timing and HTML risk factors after a release, then verify changes with browser measurements.

Prioritize concrete markup and response-time improvements without treating heuristics as measured Core Web Vitals.

Parameters

NameLocationTypeRequiredDescription
domainquerystringRequiredThe domain to get Core Web Vitals forExample: example.com

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
assessmentobjectEvidence status, coverage, weights and unavailable component names; error documents are ineligible.
coreWebVitalsMeasuredbooleanAlways false: this endpoint does not measure browser LCP, CLS or INP.
serverAnalysis.bodyReadMsnumberHTML body read duration, separate from headers time.
serverAnalysis.finalUrlstringFinal inspected URL after redirects; protocol is unknown unless actually measured.
domainstringThe queried domain
serverAnalysisobjectServer-side analysis: measured TTFB, LCP optimization factors, CLS risk factors, INP risk factors, and resource hints
serverAnalysis.ttfbobjectSynthetic final-fetch headers time with value and rating, excluding safety validation, prior redirects and body download; not browser navigation TTFB
serverAnalysis.lcpAnalysisobjectLCP risk factors: render-blocking stylesheets/scripts, preconnect/preload/fetchpriority usage. Plus lcpCandidate (source-inferred large image; actual LCP and viewport position are unmeasured with hasFetchPriorityHigh + hasMatchingPreload + isLazyLoaded flags — Google's #1 LCP recommendations), lazyLoadedAboveFold (empty because source order cannot establish viewport position), and modernFormats (AVIF/WebP adoption + remaining jpg/png-only count for a conversion-project sizing).
serverAnalysis.clsAnalysisobjectCLS risk factors: images without dimensions, font-display strategy, viewport meta
serverAnalysis.inpAnalysisobjectINP risk factors: third-party script domains, synchronous scripts in head, total script count
serverAnalysis.resourceHintsobjectResource hints found: preconnect, preload, dns-prefetch, prefetch origins
scorenumberServer-side diagnostic score (0–100); not a browser or CrUX score.
gradestringComplete static-signal grade; null for unavailable/provisional evidence
issuesarrayDetected performance issues from server-side analysis
recommendationsarrayPrioritized recommendations from server timing and source-HTML risk factors

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/web-vitals?domain=example.com' \
  --header "Authorization: Bearer YOUR_API_KEY"
JavaScript
const response = await fetch(
  "https://api.edgedns.dev/v1/domain/web-vitals?domain=example.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/web-vitals?domain=example.com",
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    timeout=60,
)
response.raise_for_status()
data = response.json()
print(data)

Read the full Core Web Vitals guide

Learn the concepts, choose a practical workflow, and interpret the observations from Core Web Vitals 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 Core Web Vitals endpoint live in the playground.

Core Web Vitals API Reference | EdgeDNS