Environment — entry 009 of 18
National Grid ESO
This is Great Britain's electricity system operator's open-data portal, publishing generation mix, demand forecasts, and grid balancing datasets. The operator was transferred to public ownership and rebranded the National Energy System Operator (NESO) on 1 October 2024; the old data.nationalgrideso.com host no longer resolves at all, with the same CKAN data portal now living at neso.energy/data-portal. Its real CKAN gateway at api.neso.energy returns Access-Control-Allow-Origin: * on every response, resolving cors unknown -> yes.
National Grid ESO's open-data portal -- now rebranded NESO, the National Energy System Operator, after transferring to public ownership on 1 October 2024 -- runs on the CKAN data-catalog engine at `api.neso.energy`, exposing every published dataset through CKAN's generic `/api/3/action/*` interface. A live GET this run against `package_list` returned 129 real dataset names, and a live GET against `datastore_search` for the Historic GB Generation Mix dataset returned genuine rows going back to 2009, all keyless.
GreatAPIs Score
Auth quickstart
- No API key required for reading published datasets -- live GETs this run against `package_list` and `datastore_search` both returned real data with zero credentials, and both carried `access-control-allow-origin: *` (confirmed live this run; this had been an open `cors: unknown` on this entry until now). A CKAN API key only matters for write actions (uploading or editing datasets), which are out of scope for a read-only quickstart.
Your key is stored only in this browser (localStorage) and sent directly to the API — never to greatapis.
Read rows from the Historic GB Generation Mix dataset
GEThttps://api.neso.energy/api/3/action/datastore_search?resource_id=f93d1835-75bc-43e5-84ad-12472b180a98&limit=1
{"help":"https://api.neso.energy/api/3/action/help_show?name=datastore_search","success":true,"result":{"resource_id":"f93d1835-75bc-43e5-84ad-12472b180a98","fields":[{"type":"int","id":"_id"},{"type":"timestamp","id":"DATETIME"},{"...":"30+ more numeric fuel-mix and carbon-intensity fields"}],"records":[{"_id":7259,"DATETIME":"2009-06-01T05:00:00","GAS":13916.0,"COAL":4431.0,"CARBON_INTENSITY":353.0,"...":"remaining fuel-mix columns omitted"}],"total":308181}}Every CKAN action wraps its payload in this same `{help, success, result}` envelope, confirmed live this run. `resource_id` (here the Historic GB Generation Mix table, `f93d1835-75bc-43e5-84ad-12472b180a98`) identifies one specific table within a dataset -- see the gotcha below on how to find one for a different dataset.
Try it
Developer reference
https://api.neso.energy/api/3/action- GET/package_list
- GET/package_show?id={dataset}
- GET/datastore_search?resource_id={id}&limit={n}
Gotchas & limits
- `package_list` only gives you dataset *names* (slugs like `historic-generation-mix`), not the `resource_id` a `datastore_search` call actually needs -- a live GET against `package_list` this run returned a plain array of names with no ids. To go from a dataset name to a queryable `resource_id`, call `package_show?id=<dataset-name>` first and read the `resources[].id` field of its response; there's no shortcut that skips this lookup.
- An unknown `resource_id` fails with the dataset-level envelope still intact -- a live GET this run against `datastore_search` with a made-up id returned **HTTP 404** `{"help":...,"success":false,"error":{"message":"Not found: Resource \"...\" was not found.","__type":"Not Found Error"}}`, so check `success` and `error.message` rather than assuming a 404 means the whole API is down.
- An unknown *action* name (a typo in the URL path itself, e.g. `/action/dataset_search`) comes back as **HTTP 400** with a bare JSON string body, not the usual `{help, success, result}` object -- a live GET this run against `/action/not_a_real_action` returned exactly `"Bad request - Action name not known: not_a_real_action"`. Code that always reads `body.success` will throw on this shape instead of the ordinary error path.
- The legacy `data.nationalgrideso.com` host from this API's pre-rebrand docs no longer resolves at all -- always use `api.neso.energy` (confirmed live and CORS-enabled this run); the CKAN action names and resource ids themselves carried over unchanged across the rebrand.