What the Octopus API actually gives you access to
An API is simply a way of asking a computer for data and getting it back in a structured format. The Octopus Energy API is public, documented, and free to use. It gives you access to several distinct data types:
- Agile tariff rates: every half-hourly price slot for your region, published daily for the next 24 hours
- Your consumption data: how much electricity and gas you used in each half-hour slot, going back to when you got a smart meter
- Account information: your current balance, recent payments, and tariff details
- Product listings: details of all Octopus tariffs, useful for comparing rates
- Meter point information: your MPAN, meter serial number, and meter type
The Agile rate endpoint requires no login or API key. It is a public URL. The consumption and account endpoints require your personal API key. Both types are freely accessible to any Octopus customer.
Understanding what the API contains helps you understand what services like AgileAlert, Home Assistant integrations, and IFTTT applets are actually doing behind the scenes. They call the same endpoints you could call yourself.
Getting your API key (the 60-second process)
For anything beyond public price data, you need your personal API key. Here is how to get it:
- Log in to your Octopus Energy account at octopus.energy.
- Click on your account in the top right corner.
- Scroll down to the section labelled "API access".
- Click "Create API key" if one doesn't already exist.
- Copy the key and store it somewhere safe, like a password manager.
The key looks like a string of random characters, something like "sk_live_a1b2c3d4e5f6...". Treat it like a password. Anyone with this key can read your consumption data and account balance, though they cannot make changes or payments.
You will use this key whenever you connect a third-party tool to your Octopus account, including Home Assistant, IFTTT, Zapier, and Google Sheets integrations.
The live price endpoint: viewing your region's prices right now
The Agile price endpoint is public and requires no key. You access it as a URL in any browser. The format is:
https://api.octopus.energy/v1/products/AGILE-24-10-01/electricity-tariffs/E-1R-AGILE-24-10-01-[REGION]/standard-unit-rates/
Replace [REGION] with your DNO region code. Common codes are:
| Region | Code |
|---|---|
| South East England | H |
| London | C |
| East Midlands | E |
| North West England | A |
| Yorkshire | F |
| South West England | L |
| Scotland (South) | N |
| Scotland (North) | P |
| Wales | K |
Paste the URL with your region code into a browser. You will see a page of JSON data listing every price slot for today and tomorrow, with the price in pence per kWh. It looks like raw text but every element is labelled and readable. This is the raw data behind every Agile price dashboard on the internet, including AgileAlert.
For a much cleaner view, head to the AgileAlert price dashboard, which displays this same data as a colour-coded chart with peak and cheap windows clearly highlighted.
No-code tools that use the API: IFTTT, Zapier, Make
Several automation platforms can query the Octopus API without you writing code. The setup involves pasting your API key into a form and choosing what data to use as a trigger or action.
IFTTT (If This Then That) has Octopus Energy triggers built into its platform. You can create an applet that fires a notification or turns on a smart device when the Agile rate drops below a value you choose. Setup takes about 10 minutes. There is a free tier that covers basic automations. See the dedicated IFTTT article in this series for step-by-step instructions.
Zapier offers a more powerful "Webhooks by Zapier" action that can call the Octopus price URL and pass the result into other apps. You can set up a zap that checks the current price every 30 minutes and sends you a Slack or WhatsApp message if it drops below 5p. The free Zapier tier limits runs, but the 750 free tasks per month covers simple price checks.
Make (formerly Integromat) is the most flexible of the three. It handles JSON responses natively, meaning you can extract specific price slots, compare them, and trigger different actions based on price ranges. Make suits users who want more logic without writing code.
Google Sheets live Agile price tracker (no coding)
Google Sheets has a built-in function called IMPORTDATA and a more powerful IMPORTJSON extension. You can use these to pull live Agile prices directly into a spreadsheet, updated whenever you open or refresh the sheet.
The simplest approach uses the ImportJSON add-on, which is free from the Google Workspace Marketplace:
- Install ImportJSON from the Workspace Marketplace into your Google account.
- In any cell, enter the formula: =ImportJSON("https://api.octopus.energy/v1/products/AGILE-24-10-01/electricity-tariffs/E-1R-AGILE-24-10-01-C/standard-unit-rates/") (replace C with your region code).
- The sheet populates with every price slot for today and tomorrow, in two columns: time and price.
- Add a conditional formatting rule to highlight cells where the price is below 5p in green and above 30p in red.
You now have a live Agile price tracker in a spreadsheet you already know how to use. Sort by price to find the three cheapest slots of the day. Share the sheet with your household. Add a column for estimated appliance cost at each price level.
This approach requires no ongoing maintenance. The formula refreshes automatically. It suits people who are comfortable with spreadsheets but do not want to learn a new platform.
What AgileAlert does with the API (and why you don't need to build your own)
AgileAlert calls the public Octopus API every 30 minutes and transforms the raw JSON response into the visual price chart you see on the live dashboard. The chart colour-codes each slot, marks the cheapest window, shows the peak rate, and flags negative price events as they happen.
Building this yourself from scratch would take several hours. AgileAlert does it for free, on every device, with no setup required. You open the page and the information is there.
The value of understanding the API is knowing what is possible. You can extend AgileAlert's data with your own consumption numbers from the API, cross-reference your usage patterns against price patterns, and identify which appliances are costing you the most at peak times. That analysis, done once in a spreadsheet, informs every automation you build.
For most Agile users, the combination of the AgileAlert dashboard for price visibility and IFTTT or Home Assistant for automated action covers everything the API can provide, without writing a line of code.