Website Carbon API
Overview
Website Carbon estimates the carbon footprint of loading any web page by analyzing its data transfer size and hosting type. It returns a simple carbon rating so developers can measure the environmental impact of their sites. No API key is required, making it easy to integrate into sustainability dashboards or CI pipelines.
Beginner Tip
Pass any URL as a query parameter to get a carbon estimate — for example, /b?url=example.com. Results are cached for performance, so repeated calls for the same URL return quickly.
Available Data
Example Response
{
"make": "Toyota",
"model": "Camry",
"year": 2025,
"engine": "2.5L 4-cylinder",
"fuel_economy": {
"city_mpg": 28,
"highway_mpg": 39
},
"msrp": 28400
} Field Reference
url The URL that was analyzed green Whether the site is hosted on a green (renewable energy) host bytes Page size in bytes used for the carbon calculation cleanerThan Percentage of web pages this site is cleaner than (0 to 1 scale) statistics.co2.grid.grams Estimated CO2 in grams per page view on a standard grid statistics.co2.renewable.grams Estimated CO2 in grams per page view using renewable energy Implementation Example
const url = "https://api.websitecarbon.com/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Matrix Score Breakdown
Fully tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →CO2 Offset
⭐ Beginner's PickCO2 Offset API calculates and validates the carbon footprint of electricity consumption using the Sustainable Scope 2 framework.
Danish data service Energi
Danish data service Energi provides programmatic access to open energy data from energinet to society via REST API.
GrünstromIndex
⭐ Beginner's PickGrünstromIndex (Green Power Index) provides real-time and forecast data about the proportion of renewable energy in the German electricity grid.
Luchtmeetnet
⭐ Beginner's PickLuchtmeetnet API provides real-time and predicted air quality measurements from the official Dutch national air quality monitoring network (RIVM).
National Grid ESO
National Grid ESO provides programmatic access to open data from great britain’s electricity system operator via REST API.