Introduction
Welcome to the CO2 Signal API! You can use our API to get access to information about how much carbon is emitted when producing electricity in a country.
Authentication
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl 'https://api.co2signal.com/v1/latest?countryCode=DK-DK1'
-H 'auth-token: myapitoken'
Make sure to replace
myapitoken
with your API key.
CO2 Signal uses API keys to allow access to the API. You can get an API key here.
CO2 Signal expects the API key to be included as a header in all requests to the server:
auth-token: myapitoken
Routes
Get latest by country code
curl 'https://api.co2signal.com/v1/latest?countryCode=FR'
-H 'auth-token: myapitoken'
The above command returns JSON structured like this:
{
"countryCode": "FR",
"data": {
"carbonIntensity": 92.97078744790771,
"datetime": "2017-02-09T08:30:00.000Z",
"fossilFuelPercentage": 12.028887656434616
},
"status": "ok",
"units": {
"carbonIntensity": "gCO2eq/kWh"
}
}
This endpoint retrieves the last known state of a country. It is also possible to get data for a specific zone, in case the country is divided by zones seen on app.electricitymap.org.
See http://api.electricitymap.org/v3/zones for list of available zones.
HTTP Request
GET https://api.co2signal.com/v1/latest
Query Parameters
Parameter | Default | Description |
---|---|---|
countryCode | two-letter iso country code |
Get latest by geographic coordinate
curl 'https://api.co2signal.com/v1/latest?lon=6.8770394&lat=45.9162776'
-H 'auth-token: myapitoken'
The above command returns JSON structured like this:
{
"countryCode": "FR",
"data": {
"carbonIntensity": 93.0727344671727,
"datetime": "2017-02-09T08:30:00.000Z",
"fossilFuelPercentage": 12.032514442152996
},
"status": "ok",
"units": {
"carbonIntensity": "gCO2eq/kWh"
}
}
This endpoint retrieves the last known state of the zone. Currently we default to zones by country, but this will quickly evolve to be as granular as possible.
HTTP Request
GET https://api.co2signal.com/v1/latest
Query Parameters
Parameter | Default | Description |
---|---|---|
lon | longitude | |
lat | latitude |