Page Weight
developer/v1/domain/page-weightAnalyzes total page size and resource breakdown including JavaScript, CSS, images, fonts, render-blocking resources, and estimated load times across different network speeds.
What It Does
Fetches the page and all its resources, measuring the size of each resource type. Breaks down page weight by JavaScript, CSS, images, fonts, and other assets. Identifies render-blocking resources, lists the largest resources, and estimates load times for slow 3G, regular 4G, and broadband connections.
Why It's Useful
Page weight directly impacts load time, data costs, and Core Web Vitals. Understanding which resource types contribute most to page weight helps prioritize optimization efforts for the biggest impact.
Use Cases
Performance Optimization
Identify the largest resources and resource types contributing to slow page loads.
Focus optimization on the highest-impact resource types.
Budget Monitoring
Track page weight over time to ensure it stays within performance budgets.
Prevent page bloat from creeping in with new features.
Mobile Optimization
Analyze page weight with estimated load times on 3G/4G to ensure acceptable mobile performance.
Optimize for mobile users on slower connections.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Required | Domain or full URL — accepts `example.com` or `https://example.com/path`.Example: https://example.com |
Response Fields
| Field | Type | Description |
|---|---|---|
domain | string | The analyzed domain (bare hostname). |
url | string | Full URL that was fetched, echoing the protocol used in the request. |
coverage | string | Analysis coverage indicator — "static-html-only". JavaScript-injected resources are not visible to non-rendering analysis |
totalSizeBytes | number | Total page size in bytes |
totalSizeFormatted | string | Human-readable total size |
htmlSizeBytes | number | HTML document size in bytes |
breakdown | object | Size breakdown by resource type (JS, CSS, images, fonts, media, other) with percentages |
resourcesMeta | object | Resource extraction metadata (extracted, analyzed, failed, unmeasuredCount, truncated) |
compression | object | Per-resource compression coverage — { compressed, uncompressed, unknown, uncompressedExamples } |
byOrigin | array | Per-origin breakdown — { origin, count, sizeBytes, percentage, isThirdParty }. Reveals third-party weight |
lcpCandidate | object | Heuristic LCP candidate from above-the-fold HTML — { url, type, sizeBytes, sizeFormatted, hasFetchPriorityHigh, isPreloaded } |
imageFormatAudit | array | JPEG/PNG/GIF >50KB that could be served as AVIF/WebP — typical 30–50% savings |
fontDisplayCoverage | object | @font-face audit across external CSS — { cssScanned, withFontDisplay, fontResourcesFound, missingDisplay[] } |
requestCount | number | Total number of HTTP requests |
renderBlocking | object | Render-blocking resources — { count, resources, largest } where largest is the prime optimization target |
largestResources | array | Top resources by size with URLs |
estimatedLoadTime | object | Estimated load times for 3G, 4G, broadband, with protocolModel (http1 vs http2-or-3) accounting for connection multiplexing |
score | number | Page weight score 0-100 |
grade | string | Letter grade A-F |
breakdown_scores | object | Individual score components with details |
recommendations | array | Optimization suggestions tied to detected issues (uncompressed assets, legacy image formats, third-party weight, missing font-display, blocking JS) |
Code Examples
curl "https://api.edgedns.dev/v1/domain/page-weight" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "domain=https://example.com"const response = await fetch(
'https://api.edgedns.dev/v1/domain/page-weight?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/page-weight',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'domain': 'https://example.com'
}
)
data = response.json()
print(data)Read the full Page Weight 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.