halfhourly.uk
Get started— it's free

Using the Octopus Energy API

Guide · updated 2026-08-23

Octopus publishes its full tariff catalogue on an open REST API with no key and no sign-up. It is one of the most usable pieces of open data in the UK energy sector, and this whole site is built on it.

Prices need no authentication

The products and tariff endpoints under `/v1/` are public. You can list every product, resolve a tariff code for a region, and pull standard unit rates and standing charges without any credential at all. Only account data — your meters, your consumption, your agreements — needs an API key.

That distinction matters if you are building something: you almost certainly do not need to ask users for a key to show them prices, and asking anyway is a security cost you are imposing for nothing.

The endpoints that matter

  • `/v1/products/` — the catalogue. Paginated, and it changes: Octopus rotates fixed products every few months and names each one after its launch date.
  • `/v1/products/{code}/` — one product, including per-region tariff codes for each payment method and register.
  • `/v1/products/{code}/electricity-tariffs/{tariff}/standard-unit-rates/` — the rates themselves, as spans with a `valid_from` and `valid_to`.
  • `/v1/electricity-meter-points/{mpan}/consumption/` — your readings. Needs the API key as the Basic-auth username, with an empty password.

Traps worth knowing before you start

  • Never hardcode a product code. The current fixed product is renamed every few months. Discover from `/v1/products/` and filter, or your integration breaks silently within a quarter.
  • Rates are spans, not a grid. Agile publishes 30-minute spans, but Go publishes a 5-hour and a 19-hour span, and Flexible publishes open-ended ones with a null `valid_to`. Expand everything onto a common half-hourly grid before you compare anything.
  • Flat tariffs return one row per payment method for the same window. Filter by payment method or you will get two prices for one slot.
  • The region is a GSP group, A to P, with no I and no O. Derive it from the first two digits of the MPAN — see find your electricity region.
  • A meter exchange leaves two serial numbers on one MPAN. Consumption is per (MPAN, serial), so you have to walk both or you lose either the old history or the new readings.
  • Daylight saving is not optional. A local day is 46, 48 or 50 half hours. Step through time in UTC and convert for display; stepping in local time silently skips the repeated hour every October.

Or skip all of that

This site exposes its own read-only JSON endpoints — current prices, the cheapest window, a tariff comparison and the product list — already expanded onto a half-hourly grid with VAT included and the traps above already handled. No key, no sign-up: see the API documentation.

Common questions

Do I need an API key for Octopus tariff prices?

No. The products and tariff endpoints are public and unauthenticated. An API key is only needed for account data such as your own consumption.

Is the Octopus API REST or GraphQL?

Both exist. The public tariff data is REST under /v1/; account operations use a GraphQL endpoint that requires a token.

How far back does Octopus Agile price history go?

Agile launched in 2018, so there is no data before then. Rate history is published per tariff and per region from each product's launch date.

See it on your own numbers. halfhourly.uk shows live half-hourly prices for every GB region for free, and if you connect an Octopus account it prices your own smart-meter readings against every tariff.

See live prices

Related guides