Website Carbon Calculator API - Measure Any Website's Carbon Footprint

Calculate the carbon emissions of any web page with a single API call. Our Website Carbon Calculator API uses the Sustainable Web Design Model V4 to estimate CO₂ per page view, check green hosting status, and assign a carbon rating from A+ to F.

Build website carbon calculators, sustainability dashboards, green web badges, or automated carbon auditing tools. The API analyzes any public URL, computes emissions based on page weight and hosting energy source, and returns detailed statistics including grid vs. renewable energy comparisons.


How it works

When you submit a URL to the API, the following happens:

  1. Page analysis — The page is loaded and analyzed to measure the total data transfer size (HTML, CSS, JavaScript, images, fonts, and third-party resources).
  2. Green hosting check — The domain is checked against the Green Web Foundation directory to determine if the hosting uses renewable energy.
  3. Carbon calculation — Using V4 of the Sustainable Web Design Model, the API computes CO₂ emissions per page view across data centers, networks, user devices, and embodied (manufacturing) emissions.
  4. Rating — The page is assigned a letter grade (A+ through F) based on how it compares to other websites globally.

Results are cached for 7 days. Subsequent requests for the same URL return the cached result instantly unless recalculate=true is passed.


GET/v1/carbon

Calculate website carbon

This endpoint calculates the carbon emissions for a given website URL. Pass any public URL and receive a detailed carbon report including CO₂ per page view, carbon rating, green hosting status, and energy statistics.

Required query parameters

  • Name
    url
    Type
    string
    Description

    The website URL to analyze. Can be a bare domain (e.g., example.com), a subdomain (e.g., docs.example.com), or a full URL with path (e.g., https://example.com/page). Redirects are followed automatically. Must be a valid, publicly accessible URL. Maximum 2048 characters.

Optional query parameters

  • Name
    recalculate
    Type
    boolean
    Description

    Set to true to bypass the 7-day cache and force a fresh analysis. The new result will replace the cached value. Defaults to false.

Response attributes

  • Name
    url
    Type
    string
    Description

    The normalized URL that was analyzed (lowercase, no protocol, no trailing slash). If the site redirects, this reflects the final destination URL.

  • Name
    cleaner_than
    Type
    float
    Description

    A value between 0.0 and 1.0 representing the percentage of websites this page is cleaner than. For example, 0.91 means cleaner than 91% of all web pages tested. Interpolated within rating bands for granular accuracy.

  • Name
    rating
    Type
    string
    Description

    The carbon rating grade: A+, A, B, C, D, E, or F. Based on CO₂ per page view thresholds from the Digital Carbon Ratings standard.

    RatingMax CO₂/viewDescription
    A+0.040gExceptional
    A0.079gExcellent
    B0.145gGood
    C0.209gAverage
    D0.278gBelow average
    E0.359gPoor
    F>0.359gVery poor
  • Name
    green_hosting
    Type
    boolean
    Description

    Whether the website's hosting provider uses renewable energy, as verified by the Green Web Foundation directory.

  • Name
    statistics
    Type
    object
    Description

    Detailed carbon and energy statistics for the page.

  • Name
    statistics.transfer_size
    Type
    integer
    Description

    The total data transfer size of the page in bytes (includes all resources: HTML, CSS, JS, images, fonts, etc.).

  • Name
    statistics.energy
    Type
    float
    Description

    Energy consumed per page view in kilowatt-hours (kWh). Calculated across data centers, networks, user devices, and embodied energy using the SWDM V4 intensity of 0.30 kWh/GB.

  • Name
    statistics.co2
    Type
    object
    Description

    CO₂ emissions in grams, shown for both standard grid energy and renewable energy scenarios.

  • Name
    statistics.co2.grid.grams
    Type
    float
    Description

    Grams of CO₂ per page view assuming the hosting uses standard grid energy (global average: 494 gCO2e/kWh).

  • Name
    statistics.co2.renewable.grams
    Type
    float
    Description

    Grams of CO₂ per page view assuming the hosting uses renewable energy (33.4 gCO2e/kWh for the data center portion).

  • Name
    tested_on
    Type
    string
    Description

    The date the page was analyzed, in YYYY-MM-DD format. Results are cached for 7 days from this date.

Request

GET
/v1/carbon
curl --location 'https://api.1clickimpact.com/v1/carbon?url=example.com' \
--header 'x-api-key: {PRODUCTION API KEY}'

Response

{
  "url": "example.com",
  "cleaner_than": 0.91,
  "rating": "A",
  "green_hosting": false,
  "statistics": {
    "transfer_size": 495573,
    "energy": 0.000139,
    "co2": {
      "grid": {
        "grams": 0.068
      },
      "renewable": {
        "grams": 0.057
      }
    }
  },
  "tested_on": "2026-04-20"
}

Force recalculation

GET
/v1/carbon
curl --location 'https://api.1clickimpact.com/v1/carbon?url=example.com&recalculate=true' \
--header 'x-api-key: {PRODUCTION API KEY}'

Sandbox response

{
  "url": "example.com",
  "cleaner_than": 0.65,
  "rating": "C",
  "green_hosting": false,
  "statistics": {
    "transfer_size": 1450000,
    "energy": 0.000405,
    "co2": {
      "grid": {
        "grams": 0.21
      },
      "renewable": {
        "grams": 0.196
      }
    }
  },
  "tested_on": "2026-04-20"
}

Methodology

The Website Carbon Calculator API uses V4 of the Sustainable Web Design Model (SWDM), the industry-standard open methodology for estimating digital carbon emissions. V4 was released in July 2025 with updated datasets reflecting more accurate internet energy consumption data.

Energy intensity (V4)

SegmentOperational (kWh/GB)Embodied (kWh/GB)Total (kWh/GB)
Data centers0.0550.0120.067
Networks0.0590.0130.072
User devices0.0800.0810.161
Total0.1940.1060.300

Carbon intensity

  • Global average grid intensity: 494 gCO2e/kWh (source: Ember's Data Explorer)
  • Renewable energy intensity: 33.4 gCO2e/kWh (applied to data center portion when green hosting is detected)

Calculation

CO₂ per page view = (transferSize / 1,073,741,824) × 0.30 kWh/GB × 494 gCO2e/kWh

When green hosting is detected, the data center portion (0.055 kWh/GB) uses the renewable intensity (33.4 gCO2e/kWh) instead of the global average, reducing total emissions.

Sources