Skip to main content
Technical Preview
API key and plan. Every data endpoint needs an Electricity Maps API key in the auth-token header. Which signals, zones and granularities a key can reach depends on its plan (14-day trial or paid). Call ListZones with your key to see what each zone allows.

Overview

Electricity Maps publishes hourly and sub-hourly data about the electricity on the grid in about 350 zones worldwide: how carbon-intensive it is, which sources produce it, what it costs on the day-ahead market, and forecasts of all of these. The API v4 (https://api.electricitymaps.com/v4) is documented at app.electricitymaps.com/docs. The ElectricityMapsApi connector maps 35 MQTT topics onto that API, all read-only GET calls. Typical uses are carbon-aware scheduling (shift flexible loads such as compressors, chillers, EV charging or batch processes into low-carbon or low-price hours), Scope 2 reporting per production line, and showing grid carbon intensity on a plant dashboard next to energy meters. Each event publishes the API reply on <topic>/response.

Authentication

Every request sends auth-token: {value.json.token}. Keep the API key in a broker secret, for example ELECTRICITY_MAPS_TOKEN, and map it into the payload with GET SECRET. ListZones and GetZone answer without a key, so send token = "" for them. A wrong key on ListZones returns 401 Token is invalid; the data endpoints return 401 Invalid auth-token without a valid key.

Choosing a zone

Pass zone=PT (zone keys come from ListZones) or lat= and lon= in query. GetZone turns coordinates into a zone key once, for example lat=41.15&lon=-8.61 returns PT for Porto. Without a zone or coordinates the API falls back to the location of the caller’s IP address, which for a broker in a data center is usually the wrong grid. Add disableCallerLookup=true to turn that fallback off.

Request payload

Every event reads its values from the JSON payload published on the request topic: Common query parameters are temporalGranularity (5_minutes, 15_minutes or hourly), emissionFactorType (lifecycle or direct), flowTraced (true for consumption-based values, false for the zone’s own production), disableEstimations, horizonHours for forecasts, datetime for a past point and start plus end for a past range (ISO 8601, UTC). Leave query as "" when an event needs no parameters, which leaves a harmless trailing ? on the URL.

Connector template

The complete connector with all 35 events is in the package file ElectricityMapsRestApi.lot.

Example actions

These actions poll Portugal (PT) at about 6 calls per hour. Replace the zone with your own.

Testing

  1. Store your key: add the secret ELECTRICITY_MAPS_TOKEN on the broker.
  2. Deploy ElectricityMapsRestApi.lot.
  3. Publish {"token": "", "query": "lat=41.15&lon=-8.61"} to energy/electricitymaps/zone/get and check that energy/electricitymaps/zone/get/response returns "zoneKey":"PT".
  4. Publish {"token": "<your key>", "query": "zone=PT"} to energy/electricitymaps/carbon-intensity/latest/get and check that the response carries carbonIntensity and datetime.

Notes and limits

  • Version: this connector uses v4. The v3 paths still answer, but in v4 the old power-breakdown endpoints are called electricity-mix.
  • Hourly data changes once an hour. Polling faster only helps with 5_minutes or 15_minutes granularity on plans that include it.
  • GetLmpDayAheadLatest is for US pricing nodes (node= is required); price-day-ahead covers European zones.
  • Marginal emission signals were discontinued by Electricity Maps and are not part of this connector.
Last modified on October 21, 2026