Carbon Estimate API - CO2 Per Page View via Green Web Foundation
Fetches a URL and estimates the carbon dioxide emissions per page view based on the transferred bytes. Uses the Sustainable Web Design methodology with configurable energy and carbon intensity factors. Returns CO2 in grams, energy in kWh, a percentile ranking against the median web page size, and the methodology constants used in the calculation.
Generate carbon estimates for every page on your site. Aggregate the results into a sustainability report showing total estimated CO2 per month based on your traffic volume. Share the report with stakeholders or publish it on your site.
Green web badges
Call this endpoint and display the cleaner_than_percent value as a badge on your website footer. "This page is cleaner than 89% of web pages tested." Encourages performance optimization and builds trust with environmentally conscious users.
Carbon budget tracking in CI
Add a CI step that calls this endpoint after building your site. Fail the build if CO2 per page view exceeds a threshold (e.g., 0.5g). Track the carbon budget over time alongside bundle size and performance metrics.
Frequently asked questions
How accurate is the carbon estimate?
The estimate is based on page transfer size and the Sustainable Web Design methodology. It provides a directional estimate, not a precise measurement. Actual emissions depend on the visitor's device, network, and the energy mix of the data center serving the page.
What does cleaner_than_percent mean?
This is the percentage of web pages that transfer more bytes than the tested URL. A score of 89 means the page transfers fewer bytes than 89% of the median sample. Higher is better.
Does this account for images and third-party scripts?
The estimate is based on the initial HTML response size only. It does not load images, CSS, JavaScript, or third-party resources. For a full-page estimate, combine with a tool that measures total page weight.
What methodology is used?
The calculation follows the Sustainable Web Design Model, which estimates energy per gigabyte transferred and applies a global average carbon intensity factor. The methodology constants are included in every response for transparency.
Can I customize the carbon intensity factor?
Not through this endpoint. The carbon intensity uses a global average. If you know your hosting provider's energy mix, you can apply your own factor to the energy_kwh value returned in the response.
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.