Skip to main content

Page Weight

developer
GET/v1/domain/page-weight

Analyzes 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

Frontend Developer

Performance Optimization

Identify the largest resources and resource types contributing to slow page loads.

Focus optimization on the highest-impact resource types.

Performance Engineer

Budget Monitoring

Track page weight over time to ensure it stays within performance budgets.

Prevent page bloat from creeping in with new features.

Mobile Developer

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

NameTypeRequiredDescription
domainstringRequiredThe domain to analyze page weight forExample: example.com

Response Fields

FieldTypeDescription
domainstringThe analyzed domain
totalSizeBytesnumberTotal page size in bytes
totalSizeFormattedstringHuman-readable total size
htmlSizeBytesnumberHTML document size in bytes
breakdownobjectSize breakdown by resource type (JS, CSS, images, fonts)
resourcesMetaobjectResource extraction metadata (extracted, analyzed, failed, truncated)
requestCountnumberTotal number of HTTP requests
renderBlockingobjectRender-blocking resources count and details
largestResourcesarrayTop resources by size with URLs
estimatedLoadTimeobjectEstimated load times for 3G, 4G, and broadband
scorenumberPage weight score 0-100
gradestringLetter grade A-F
breakdown_scoresobjectIndividual score components with details
recommendationsarrayOptimization suggestions

Code Examples

cURL
curl "https://api.edgedns.dev/v1/domain/page-weight" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "domain=example.com"
JavaScript
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);
Python
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.

Try This Endpoint

Test the Page Weight endpoint live in the playground.