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.

NextWhat it covers
Home AssistantStep-by-step sensors for live power, energy, prices and forecasts.
API referenceEvery endpoint a key can call, the live WebSocket, and an OpenAPI document.
  1. 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:

    ScopeAllows
    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.

  2. Step 2: Find your battery id

    Run this from any terminal, using your key:

    Terminal
    curl -H "Authorization: Bearer ak_your_key_here" \
      https://api.aoteaenergy.com/api/v1/battery/all

    Each 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.

  3. 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_... to https://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

ResponseMeans
401The key is wrong, expired or revoked.
403The 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 valuesThe battery id is wrong, or the battery hasn't reported yet. Re-run the battery list to check the id.
429Too many requests from your network. Poll less often.