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 | The domain to analyze page weight forExample: example.com |
Response Fields
| Field | Type | Description |
|---|---|---|
domain | string | The analyzed domain |
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) |
resourcesMeta | object | Resource extraction metadata (extracted, analyzed, failed, truncated) |
requestCount | number | Total number of HTTP requests |
renderBlocking | object | Render-blocking resources count and details |
largestResources | array | Top resources by size with URLs |
estimatedLoadTime | object | Estimated load times for 3G, 4G, and broadband |
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 |
Code Examples
curl "https://api.edgedns.dev/v1/domain/page-weight" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "domain=example.com"const response = await fetch(
'https://api.edgedns.dev/v1/domain/page-weight?domain=example.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': '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.