Website Carbon Emissions API

Use our API to export your reports and make your website carbon aware

Endpoint Details

  • URL: https://api.ecoping.earth
  • HTTP Headers
    • x-api-token -
      • Login to get this from your settings page
    • accept - (text/csv | application/json)
      • optional
      • default is application/json
  • Query Parameters
    • ?token=
      • Login to get this from your settings page
    • ?format=(text/csv | application/json)
      • optional
      • default is application/json

Reports API

Site Performance

  • Endpoint: https://api.ecoping.earth/v2/reports/sites/:siteId/performance
  • URL Parameters
    • :siteId - required - find this from the All Sites Performance Report
      • required
  • Query Parameters
    • ?format=(text/csv | application/json)
      • optional
      • default is application/json
  • HTTP Headers
    • accept - (text/csv | application/json)
      • optional
      • default is application/json

Example Request

Example Response

Notes

  • ecoscore - percentage between 0..1
  • co2grams - carbon dioxide equivalent (CO2-eq) in grams. This is a weighted average over all of the sites resources
  • transferSize - in bytes
  • pageLoadTime - in milliseconds
  • co2intensity - carbon dioxide equivalent (CO2-eq) in grams. This is a weighted average Power Grid output used. This comes from the "Carbon Aware API" below
  • accessibility - percentage between 0..1 from Lighthouse
  • pwa - percentage between 0..1 from Lighthouse
  • seo - percentage between 0..1 from Lighthouse

{
  "url": "https://www.nsandi.com/",
  "ecoscore": 0.98,
  "co2grams": 0.25,
  "transferSize": 47235,
  "pageLoadTime": 2457,
  "averages": {
    "accessibility": 0.8015942028985508,
    "co2grams": 0.12333333333333334,
    "co2intensity": 247.42753623188406,
    "ecoscore": 0.7742028985507247,
    "pageLoadTime": 1351.376811594203,
    "performance": 0.9306521739130434,
    "pwa": 0.44,
    "seo": 0.9528260869565217,
    "transferSize": 859521.3913043478
  },
  "comparedTo": {
    "accessibility": 0.8015131578947369,
    "co2grams": 0.13138157894736843,
    "co2intensity": 258.2631578947368,
    "ecoscore": 0.75875,
    "pageLoadTime": 1367.8947368421052,
    "performance": 0.9357236842105263,
    "pwa": 0.44,
    "seo": 0.9486842105263158,
    "transferSize": 880982.3881578947,
    "period": "7d"
  },
  "percentageChange": {
    "accessibility": 0.01011150010646976,
    "co2grams": -6.125855449841435,
    "co2intensity": -4.195573906545801,
    "ecoscore": 2.0366258386457496,
    "pageLoadTime": -1.2075435925746134,
    "performance": -0.5419880230734703,
    "pwa": 0,
    "seo": 0.43659169028522826,
    "transferSize": -2.4360301797202983
  }
}

Site Impact

  • Endpoint: https://api.ecoping.earth/v2/reports/sites/:siteId/impact
  • URL Parameters
    • :siteId - required - find this from the All Sites Performance Report
      • required

Example Request

Example Response

Notes

  • ecoscore - percentage between 0..1
  • co2grams - carbon dioxide equivalent (CO2-eq) in grams. This is a weighted average over all of the sites resources
  • transferSize - in bytes
  • pageLoadTime - in milliseconds
  • co2intensity - carbon dioxide equivalent (CO2-eq) in grams. This is a weighted average Power Grid output used. This comes from the "Carbon Aware API" below
  • accessibility - percentage between 0..1 from Lighthouse
  • pwa - percentage between 0..1 from Lighthouse
  • seo - percentage between 0..1 from Lighthouse

{
  "url": "https://www.nsandi.com/",
  "ecoscore": 0.98,
  "co2grams": 0.25,
  "transferSize": 47235,
  "pageLoadTime": 2457,
  "averages": {
    "accessibility": 0.8015942028985508,
    "co2grams": 0.12333333333333334,
    "co2intensity": 247.42753623188406,
    "ecoscore": 0.7742028985507247,
    "pageLoadTime": 1351.376811594203,
    "performance": 0.9306521739130434,
    "pwa": 0.44,
    "seo": 0.9528260869565217,
    "transferSize": 859521.3913043478
  },
  "comparedTo": {
    "accessibility": 0.8015131578947369,
    "co2grams": 0.13138157894736843,
    "co2intensity": 258.2631578947368,
    "ecoscore": 0.75875,
    "pageLoadTime": 1367.8947368421052,
    "performance": 0.9357236842105263,
    "pwa": 0.44,
    "seo": 0.9486842105263158,
    "transferSize": 880982.3881578947,
    "period": "7d"
  },
  "percentageChange": {
    "accessibility": 0.01011150010646976,
    "co2grams": -6.125855449841435,
    "co2intensity": -4.195573906545801,
    "ecoscore": 2.0366258386457496,
    "pageLoadTime": -1.2075435925746134,
    "performance": -0.5419880230734703,
    "pwa": 0,
    "seo": 0.43659169028522826,
    "transferSize": -2.4360301797202983
  }
}

Carbon Aware API

Power Production

  • Endpoint: https://api.ecoping.earth/v2/power/:countryCode
  • URL Parameters
    • Parameter: :countryCode
    • Any valid 2 letter country code in uppercase, e.g. GB, US, SE
    • XX - use this for the world average
    • IP - use this to detect the user's country

Example Request

fetch("https://api.ecoping.earth/v2/power/IP", {
  "method": "GET",
  "mode": "cors",
  "headers": {
    "x-api-token": "ci1egxw2v.clixa5qci0000e7og427vx8lrf9ecf2a6.2141e66cad2dbea8"
  }
});
fetch("https://api.ecoping.earth/v2/power/IP?token=ci1egxw2v.clixa5qci0000e7og427vx8lrf9ecf2a6.2141e66cad2dbea8", {
  "method": "GET",
  "mode": "cors",
});

Example Response

Loading

Example Usage

Loading...

Loading...

Loading...

🚀 On a mission to reduce the carbon footprint of the Internet! 🌎
EcoPing logo - tracking website carbon emissionsbeta

© EcoPing 2020-2024