Aotea Energy API
An API key lets your own tools, like Home Assistant, Node-RED or a script, read your battery's data. A key can only read, only sees the batteries your account can see, and only reaches the data you choose when you create it.
Get a key and your battery id below, then pick where to go next.
| Next | What it covers |
|---|---|
| Home Assistant | Step-by-step sensors for live power, energy, prices and forecasts. |
| API reference | Every endpoint a key can call, the live WebSocket, and an OpenAPI document. |
Step 1: Create an API key
Go to Account → API keys here, or API keys in the Aotea app, and choose Create key. Name it after what will use it and tick only the scopes it needs:
Scope Allows battery:liveLatest readings, and live updates over the WebSocket. battery:historicalHistorical time series, fine-grained telemetry and forecasts. pricing:readCost summaries, tariff rates and the daily fixed charge. Copy the key straight away. It starts with
ak_and is only shown once. You can change a key's scopes later, or revoke it, and anything using it stops working immediately.Step 2: Find your battery id
Run this from any terminal, using your key:
Terminalcurl -H "Authorization: Bearer ak_your_key_here" \ https://api.aoteaenergy.com/api/v1/battery/allEach battery comes back as an id and a name. Any key can do this, whatever its scopes.
Response{ "data": [ ["824f16be-3ab2-4d9a-b761-461fd4df94da", "Garage battery"] ] }Choose the battery you want, or paste its id, and every example in these docs uses it:
Fills in every snippet in these docs. It stays in your browser.
Step 3: Test your key
Optional. Check the key works, see which scopes it has, and pick your battery from the ones it can see.
Good to know
- Send the key as
Authorization: Bearer ak_...tohttps://api.aoteaenergy.com. - Power is in kW, energy in kWh, prices in $/kWh. Grid power is positive when importing and negative when exporting.
- Each network can make 120 requests a minute. Polling every 30 seconds to 5 minutes stays well inside that.
Troubleshooting
| Response | Means |
|---|---|
401 | The key is wrong, expired or revoked. |
403 | The key is missing the scope that endpoint needs, or the battery isn't one your account can see. Add the scope under API keys. |
| Empty or unknown values | The battery id is wrong, or the battery hasn't reported yet. Re-run the battery list to check the id. |
429 | Too many requests from your network. Poll less often. |