# Renewably public API (v1)

Cheapest and greenest times to use electricity on time-of-use tariffs in Great Britain - Octopus Agile
by default, or any tariff in [`/tariffs`](#get-tariffs) from Octopus, EDF and E.ON Next - as JSON, the
same calculations as the public pages on renewably.uk.

- Base URL: `https://renewably.uk/api/v1`
- Machine-readable spec: [`/api/v1/openapi.json`](https://renewably.uk/api/v1/openapi.json) (OpenAPI 3.1)
- Docs (this page, as Markdown): [`/api/v1/docs`](https://renewably.uk/api/v1/docs); for AI tools, [`/llms.txt`](https://renewably.uk/llms.txt) and an [MCP server](#using-it-with-ai) at `/mcp`

## Contents

- [Prices: which endpoint?](#prices-which-endpoint)
- [Using it with AI](#using-it-with-ai)
- [Using it with voice](#using-it-with-voice)
- [Using it with home automation](#using-it-with-home-automation): [Home Assistant](#home-assistant) · [Predbat](#predbat) · [evcc](#evcc) · [carbon](#carbon-intensity)
- [Conventions](#conventions) · [Solar panels](#solar-panels)
- [Caching, rate limits and CORS](#caching-rate-limits-and-cors)
- [Errors](#errors)
- [Data sources and licences](#data-sources-and-licences)
- [Endpoints](#endpoints): [index](#get-) · [regions](#get-regions) · [tariffs](#get-tariffs) · [prices](#get-prices) ·
  [unit-rates (Octopus-compatible)](#get-unit-rates) · [cheapest-window](#get-cheapest-window) · [ev-plan](#get-ev-plan) · [heat-pump](#get-heat-pump) ·
  [home-battery](#get-home-battery) · [battery-plan](#get-battery-plan) · [home](#get-home) · [flexibility-events](#get-flexibility-events) · [openapi.json](#get-openapijson)
- [Terms of use](#terms-of-use)
- [Versioning](#versioning)

## Prices: which endpoint?

There are two ways to get the half-hourly prices, with the same figures behind them. Use `/prices` unless your
software was built to read Octopus's own API.

| | [`/prices`](#get-prices) | [`/unit-rates`](#get-unit-rates) |
|---|---|---|
| **For** | Everything: apps, Home Assistant, scripts, AI assistants | Only software built for Octopus's API, such as Predbat and evcc |
| **Format** | Renewably's own, and it can grow | Octopus's standard-unit-rates, exactly - so it never changes. It's the Kraken platform's format, which EDF's and E.ON Next's APIs use too |
| **Times** | UK local, oldest first | UTC, newest first |
| **How far** | Today and up to four more days (`days=1`-`5`) | Today and four more days |
| **Estimates** | Always included, each half hour flagged `estimate` | Only with `estimates=true` (those tools take every row as a real price) |
| **How good the estimates are** | `estimate_accuracy`, for each day ahead | Not given - Octopus's format has no room for it |
| **Solar panels, region and tariff details** | Yes | No |

The MCP server offers AI assistants `/prices` alone (as `get_prices`).

## Using it with AI

The API is built to be easy to use from AI assistants and coding agents.

**Let your assistant call it directly (MCP).** `https://renewably.uk/mcp` is a remote
[Model Context Protocol](https://modelcontextprotocol.io) server (Streamable HTTP, no key, protocol
versions 2024-11-05 to 2026-07-28) with a tool for each endpoint - prices, cheapest window, EV plan, heat pump and battery times, tariff
comparison. Add it as a custom connector (Claude, ChatGPT) or, in Claude Code:

```sh
claude mcp add --transport http renewably https://renewably.uk/mcp
```

Each tool answers with its endpoint's JSON as text, the answer first and its sources after.

Then ask things like "when should I run my dishwasher tonight in Yorkshire, on Octopus Go?".

**Point a coding assistant at the spec.** Everything it needs is machine-readable:
[`/api/v1/openapi.json`](https://renewably.uk/api/v1/openapi.json) (every parameter and field, with a
worked example per endpoint), [`/llms.txt`](https://renewably.uk/llms.txt) (a short guide) and
[`/llms-full.txt`](https://renewably.uk/llms-full.txt) (these docs in full). Every response carries
`Link` headers to the spec and docs, and every error a `docs` link, so an agent can find its own way.
A prompt to start from:

```text
Use the Renewably API (https://renewably.uk/api/v1, no key, GET only; OpenAPI spec at
https://renewably.uk/api/v1/openapi.json, guide at https://renewably.uk/llms.txt). Times are UK
local ISO 8601, prices pence per kWh including VAT. For "when should I run X", use
/cheapest-window; for an electric car, /ev-plan; list regions with /regions and tariffs with
/tariffs. Credit the CC BY sources in each response's meta.sources if you show the data.
```

**By hand:**

```sh
curl "https://renewably.uk/api/v1/cheapest-window?region=london&duration_hours=2&finish_by=07:00"
```

```python
import requests

window = requests.get("https://renewably.uk/api/v1/cheapest-window",
                      params={"region": "london", "duration_hours": 2, "finish_by": "07:00"}).json()["window"]
print(window["start"], window["average_p_per_kwh"])
```

```js
const r = await fetch("https://renewably.uk/api/v1/cheapest-window?region=london&duration_hours=2");
const { window } = await r.json();
console.log(window.start, window.average_p_per_kwh);
```

## Using it with voice

`GET /say` answers in one sentence, ready for a voice assistant to read aloud - no key, nothing to
parse. Seven questions, the day-to-day ones (`ask=price` if none is given):

| `ask` | Answers | Example |
|---|---|---|
| `price` | Whether now's a good time, and when it's cheaper | "Not really - electricity on Octopus Go in London is 30p a unit now. It drops to 8p from half past midnight tomorrow." |
| `greenest` | The greenest time | "From 1 am tomorrow - the grid in London will be at 50 grams of carbon dioxide per unit then, against 200 now." |
| `appliance` | What to do to run something for `hours` (default 2) at the cheapest time before `ready_by` (default 07:00) | "Set its delay to 7 hours - or, if the delay sets when it finishes, to 9 hours. That runs it from 1 am to 3 am tomorrow - the cheapest 2 hours before 7 am tomorrow on Octopus Agile in London, at about 5p a unit." |
| `car` | The cheapest `hours` (default 4) to charge before `ready_by` | "Charge the car from 1 am to 5 am tomorrow - the cheapest 4 hours before 7 am tomorrow on Octopus Agile in London, at 5p a unit on average." |
| `flexibility` | Whether the grid is asking homes to use less (a Saving Session) or more, today or tomorrow | "Yes - the grid is asking homes in London to use less from 5 pm to 6 pm. It only pays if you've signed up to a scheme such as Octopus's Saving Sessions." |
| `export` | What the export tariff in `tariff` (default `agile-outgoing`) pays now, and when it pays most | "Exporting pays 15p a unit on Agile Outgoing Octopus in London now. It pays most, about 28p, from 5 pm." |
| `battery` | What to set a home battery to now, and next - with `/battery-plan`'s parameters (`battery`, `rate`, `usage`, `soc` and the rest) | "Leave it running the house as usual. Then charge it from the grid to 54 per cent from half past midnight to half past 2 am tomorrow, at 9p a unit." |

All take `region`, and all but `flexibility` a `tariff`. Mistakes are spoken too ("Renewably couldn't answer that: region
is required...").

**Siri** (iPhone, iPad, HomePod): the easiest way is a ready-made Shortcut from
[renewably.uk/smart-home](https://renewably.uk/smart-home/#siri) - "Is now a good time to use electricity",
"When's the greenest time to use electricity", "What time should I run the appliance" and "What time
should I charge the car", "Is there a Saving Session today", "What does exporting pay now" and "What should
my battery do". Tap *Add to Siri*, answer its questions (your region and tariff, and for the appliance and
car how many hours, your export tariff, or your battery's size and charge rate), and ask Siri the question. Or make your own:
in the Shortcuts app, a shortcut with two actions - **Get Contents of URL** with your address, for example
`https://renewably.uk/api/v1/say?ask=price&region=london&tariff=agile`, then **Speak Text**. Then:

- **Name it as the question you'll ask** - Siri runs a shortcut when you say its name. If Siri
  answers the question itself instead, use a word it won't guess at, like "Renewably price"; and
  never "timer", which can start a countdown in the Clock app instead.
- **Run it once by tapping** and choose *Always Allow* when it asks to connect to renewably.uk.
- **On a HomePod**, turn on *Recognise My Voice* and *Personal Requests* in the Home app, and make
  sure *Find My* uses your iPhone as *My Location* - the HomePod runs your shortcuts through it.

**Home Assistant** (and Google Home and Nest speakers through it): ready-made settings at
[renewably.uk/smart-home](https://renewably.uk/smart-home/#ha-voice), with your region and tariff filled in.
**Alexa**: a Renewably skill is on its way. **Anything else that speaks text** can fetch the same addresses.

## Using it with home automation

Ready-made settings for the home-energy software people already run. [renewably.uk/smart-home](https://renewably.uk/smart-home/#home-assistant)
has them with your region and tariff filled in; here they're for `london` on `agile` - replace those
with your region from [`/regions`](#get-regions) and your tariff from [`/tariffs`](#get-tariffs).

### Home Assistant

Add this to `configuration.yaml` and restart (if it already has a `rest:` or `template:` section, put these
entries under it) - or, simplest, use it as a package: [renewably.uk/smart-home](https://renewably.uk/smart-home/#home-assistant)
gives it as a `renewably.yaml` file to drop in. It makes `sensor.renewably_price_now` (the price now, worked out
every minute from the half hours, so right from the first minute of each), `sensor.renewably_prices` (today's and
tomorrow's half hours in its `slots` attribute), `sensor.renewably_cheapest_3_hours_start` (a timestamp),
`binary_sensor.renewably_cheapest_3_hours_now` (on during that window - for a smart plug or an immersion heater) and
`sensor.renewably_grid_flexibility` (`use less`, `use more` or `none`, with the events and their `note` as
attributes). The prices are fetched every 30 minutes, the flexibility events every 15. Every sensor is
`unavailable`, not an error, when an answer can't be had, and comes back by itself:

```yaml
rest:
  # Today's and tomorrow's half hours, in its slots attribute (for charts, and "price now" below). Prices change each
  # half hour but are published once a day, so every 30 minutes is enough: "price now" is worked out from them every
  # minute, right from the first minute of each half hour.
  - resource: https://renewably.uk/api/v1/prices?region=london&tariff=agile&days=2
    scan_interval: 1800
    sensor:
      - name: Renewably prices
        unique_id: renewably_prices
        device_class: timestamp
        # When the published prices run to (after that, estimates); unavailable when there's no answer.
        availability: "{{ value_json is mapping and value_json.slots is defined }}"
        value_template: "{{ value_json.published_until }}"
        json_attributes:
          - slots
  # The cheapest three hours before 7am - for a dishwasher, an immersion heater, a smart plug.
  - resource: https://renewably.uk/api/v1/cheapest-window?region=london&tariff=agile&duration_hours=3&finish_by=07:00
    scan_interval: 1800
    sensor:
      - name: Renewably cheapest 3 hours start
        unique_id: renewably_cheapest_start
        device_class: timestamp
        availability: "{{ value_json is mapping and value_json.window is defined }}"
        value_template: "{{ value_json.window.start }}"
        json_attributes_path: "$.window"
        json_attributes:
          - end
          - average_p_per_kwh
          - includes_estimates
  # NESO's flexibility events here - and who they pay (the note). Announced at short notice: every 15 minutes.
  - resource: https://renewably.uk/api/v1/flexibility-events?region=london
    scan_interval: 900
    sensor:
      - name: Renewably flexibility events
        unique_id: renewably_flexibility_events
        availability: "{{ value_json is mapping and value_json.events is defined }}"
        value_template: "{{ value_json.events | count }}"
        json_attributes:
          - events
          - note

template:
  - sensor:
      - name: Renewably price now
        unique_id: renewably_price_now
        unit_of_measurement: "p/kWh"
        state_class: measurement
        # Unavailable, not an error, when there's no price for now (an outage, a gap in a supplier's prices).
        availability: >-
          {% set ns = namespace(ok=false) %}
          {% for slot in state_attr('sensor.renewably_prices', 'slots') or [] %}
            {% if as_datetime(slot.start) <= now() < as_datetime(slot.end) and slot.price_p_per_kwh is not none %}{% set ns.ok = true %}{% endif %}
          {% endfor %}
          {{ ns.ok }}
        # With solar panels in the address, what a kWh costs with them.
        state: >-
          {% set ns = namespace(price=none) %}
          {% for slot in state_attr('sensor.renewably_prices', 'slots') or [] %}
            {% if as_datetime(slot.start) <= now() < as_datetime(slot.end) %}{% set ns.price = slot.with_panels_p_per_kwh if slot.with_panels_p_per_kwh is defined and slot.with_panels_p_per_kwh is not none else slot.price_p_per_kwh %}{% endif %}
          {% endfor %}
          {{ ns.price }}
      - name: Renewably grid flexibility
        unique_id: renewably_grid_flexibility
        # Unavailable when the events can't be had - not "none", which would say there's no event.
        availability: "{{ has_value('sensor.renewably_flexibility_events') }}"
        state: >-
          {% set ns = namespace(now_='none') %}
          {% for e in state_attr('sensor.renewably_flexibility_events', 'events') or [] %}
            {% if as_datetime(e.start) <= now() < as_datetime(e.end) %}{% set ns.now_ = 'use ' ~ e.direction %}{% endif %}
          {% endfor %}
          {{ ns.now_ }}
        attributes:
          events: "{{ state_attr('sensor.renewably_flexibility_events', 'events') }}"
          note: "{{ state_attr('sensor.renewably_flexibility_events', 'note') }}"
  - binary_sensor:
      - name: Renewably cheapest 3 hours now
        unique_id: renewably_cheapest_now
        availability: "{{ has_value('sensor.renewably_cheapest_3_hours_start') }}"
        state: >-
          {% set start = states('sensor.renewably_cheapest_3_hours_start') | as_datetime(none) %}
          {% set end = state_attr('sensor.renewably_cheapest_3_hours_start', 'end') | as_datetime(none) %}
          {{ start is not none and end is not none and start <= now() < end }}
```

To have Home Assistant answer by voice, see
[renewably.uk/smart-home](https://renewably.uk/smart-home/#ha-voice).

### Predbat

[Predbat](https://springfall2008.github.io/batpred/) can read prices from any address in Octopus's
format, which [`/unit-rates`](#get-unit-rates) gives - on any tariff in `/tariffs`, not just Octopus's.
In `apps.yaml`:

```yaml
  rates_import_octopus_url: "https://renewably.uk/api/v1/unit-rates?region=C&tariff=agile"
```

That's the published prices only. Add `&estimates=true` to let it plan beyond them on Renewably's
Agile estimates - but Predbat takes every price it's given as real, so it will plan on estimates as
if they were certain.

### evcc

[evcc](https://evcc.io) plans car charging on
a price forecast: this gives it Renewably's prices through [`/unit-rates`](#get-unit-rates) - UTC, as
evcc requires - and your region's carbon forecast from NESO (evcc's own `ngeso` template, NESO's
region number from the table below):

```yaml
tariffs:
  currency: GBP
  grid:
    type: custom
    forecast:
      source: http
      uri: https://renewably.uk/api/v1/unit-rates?region=london&tariff=agile
      jq: '[.results[] | {start: .valid_from, end: .valid_to, value: (.value_inc_vat / 100)}] | sort_by(.start) | tojson'
  co2:
    type: template
    template: ngeso
    region: 13
```

`value` is pounds per kWh, as evcc expects. That's published prices only; add `&estimates=true` to the
`uri` to plan up to four days ahead on Renewably's estimates.

### Carbon intensity

Renewably's carbon figures are NESO's regional forecast, which NESO serves free from its
[Carbon Intensity API](https://carbonintensity.org.uk/) - and home-energy tools already read it
(evcc's `ngeso` template above, and community integrations for Home Assistant), so point them at NESO
directly. Its region numbers, against Renewably's regions:

| Region | NESO | Region | NESO |
|---|---|---|---|
| North Scotland (`P`) | 1 | South Wales (`K`) | 7 |
| South Scotland (`N`) | 2 | West Midlands (`E`) | 8 |
| North West England (`G`) | 3 | East Midlands (`B`) | 9 |
| North East England (`F`) | 4 | Eastern England (`A`) | 10 |
| Yorkshire (`M`) | 5 | South West England (`L`) | 11 |
| Merseyside and North Wales (`D`) | 6 | Southern England (`H`) | 12 |
| London (`C`) | 13 | South East England (`J`) | 14 |

`cheapest-window` with `optimise=carbon` and `ev-plan` do the planning on NESO's forecast for you.

## Conventions

- **Times** are ISO 8601 in UK local time with the offset: `2026-10-12T01:00:00+01:00` (BST) or
  `...+00:00` (GMT). Times of day in the typical-day endpoints are `HH:MM`, UK local.
- **Regions** are a letter (`C`), a slug (`london`), the region's name or one of the well-known places
  `/regions` lists for it (`Manchester`). The regions are the electricity networks' areas, not counties:
  for anywhere `/regions` doesn't list, find its region there first.
- **Half hours**: each slot has `start` (inclusive) and `end` (exclusive), 30 minutes apart.
- **Units are in field names**: `_p_per_kwh` (pence per kWh, including VAT - 0% on household
  electricity since October 2026), `_pounds`, `_kwh`, `_kw`, `_pct`, `_gco2_per_kwh`, `_c` (degrees
  Celsius), `_minutes`, `_hours`.
- **Estimates are always flagged.** `estimate: true` on a price means Renewably's estimate, not
  Octopus's published price; plans say `includes_estimates`.
- **`null`** means "not available" (a price neither published nor estimable, a carbon figure past the
  end of NESO's forecast) - never zero.
- **Rounding**: prices 2 decimal places, kWh 3, carbon 1, money 2.
- **Regions** are given as the Agile region letter (`C`) or the slug from the site's addresses
  (`london`), case-insensitive for letters. Responses always echo the region in full. Not sure of a
  home's region? [`/regions`](#get-regions) lists well-known places in each; the regions are the local
  electricity networks' areas, not counties, so some surprise. The first two digits of the 13-digit MPAN
  on the home's electricity bill settle it (`mpan_prefix`), as does the last letter of an Octopus tariff
  code. Postcodes aren't taken.
- **Tariffs**: `prices`, `cheapest-window`, `ev-plan`, `heat-pump` and `home-battery` take an optional
  `tariff`, a key from [`/tariffs`](#get-tariffs) (default `agile`), and echo it as a `tariff` block
  (`key`, `name`, `supplier`, `kind`). Agile has estimates beyond the published prices, and so do
  EDF FreePhase Dynamic and Shape Shifters: Agile, estimated from Agile's; other tariffs show their
  supplier's prices. Fixed-window and flat tariffs' times are fixed, so days the
  supplier hasn't published yet (EDF and E.ON Next publish a day at a time) repeat the latest
  published day; EDF FreePhase Dynamic goes as far as tomorrow once it's out. On fixed-window and flat tariffs the
  typical-day endpoints use today's rates, which are the same every day.
- Every response has a **`meta`** block: `api_version`, `generated_at`, and `sources` (see below).

## Solar panels

A home with solar panels can say so on every endpoint whose answer they change - `prices`,
`cheapest-window`, `ev-plan`, `heat-pump`, `home-battery` and `say` - and the answer is then the one the
site's pages and widgets give with the same panels. (The [`/home`](#get-home) endpoint has its own,
fuller description of a home's panels; `unit-rates` stays the grid's alone, as tools that read it model
their own solar.)

| Parameter | Range | Default | What |
|---|---|---|---|
| `solar_kwp` | 0.2-50 kWp | none | The panels' size. Without it, everything below is refused. |
| `solar_facing` | S/SE/SW/E/W/NE/NW/N, or 0-359 | S | Which way they face, or the exact compass bearing (south is 180). |
| `solar_pitch` | 0-90 degrees | 35 | Their angle from flat. |
| `solar_kwp_2`, `solar_facing_2`, `solar_pitch_2` | as above (a compass point) | none | Panels on a second roof face; `_3` for a third. They share one inverter. |
| `solar_inverter_kw` | 0.5-50 kW | none | The inverter's limit, if it's smaller than the panels. |
| `export` | `paired`, `fixed`, `fit`, `none`, or an export tariff's key | `paired` (`fixed` with a rate) | How export is paid: the tariff's own export tariff (Agile Outgoing for Agile - its tomorrow estimated until Octopus publishes it), a fixed rate, the Feed-in Tariff's deemed export (paid whatever is exported, so the sun used at home gives nothing up), not at all, or a key from [`/tariffs?direction=export`](#get-tariffs) (used where the tariff can have it, its own otherwise). |
| `export_rate` | 0-100 p/kWh | none | The fixed rate. |

What the panels should make comes from the Met Office's sunshine forecast for the region, as on the
site's pages. A typical home's own use comes off first; in a half hour the rest covers, a kWh used at home
costs the export it gives up rather than the grid's price (and emits no carbon). Without a current forecast
the answer is the grid's alone, and `panels.forecast` says so.

Each answer echoes the panels as a `panels` block (`kwp`, `faces`, `inverter_kw`, `export`,
`export_rate_p_per_kwh`, `forecast`; null without `solar_kwp`) and adds:

- **`prices`**: each slot's `solar_kw` and `with_panels_p_per_kwh` (for a 1 kW load), and the
  panels' forecast `days` (`date`, `kwh`).
- **`cheapest-window`**: the window as a home with the panels pays (its power is `kwh` over
  `duration_hours`, or 1 kW without `kwh`), with `average_grid_p_per_kwh` and `solar_share`.
- **`ev-plan`**: the plan partly on the sun - `plan.solar` (`kwh`, `grid_only_pounds`) and each slot's
  `with_panels_p_per_kwh`.
- **`home-battery`**: `overnight_with_panels` - how full to charge overnight so the next day's spare
  sun fills the battery for the evening (`advice`: `lower`, `full` or `sun_short`; `charge_to_pct`,
  `saving_pounds`...).
- **`heat-pump`**: `hot_water_with_panels` - the next day's best daytime reheat against the overnight
  one, and whether it's cheaper by 2p/kWh of heat or more.
- **`say`**: the spoken answer counts them, and says "with your panels".

## Caching, rate limits and CORS

**Caching.** Every 200 response carries `Cache-Control` sized to how often its data can change:

| Endpoints | `max-age` |
|---|---|
| `prices`, `unit-rates` | To the next half hour (5 minutes from 15:55 to 16:45, when tomorrow's prices come out) |
| `cheapest-window`, `ev-plan`, `battery-plan`, `say` | 5 minutes |
| `flexibility-events` | 10 minutes |
| `heat-pump`, `home-battery`, `home` | 1 hour |
| index, `regions`, `tariffs`, `openapi.json` | 1 day |

Each also says `stale-while-revalidate=60, stale-if-error=3600`: a copy may be used a minute past its time while
a fresh one is fetched, and for up to an hour if the API can't answer. Errors are `no-store`. Answers are the same
for everyone asking the same question, so a cache in front of your own clients may share them.

**Rate limits.** About 60 requests a minute per IP address; over it, `429` with `Retry-After`
(seconds). Very rapid bursts can also get a `429` with `{"message": "Too Many Requests"}`. Back off and retry after the time given - the
responses' `Cache-Control` says how long an answer stays good, so caching them helps too.

**CORS.** Any site may call the API from a browser: `Access-Control-Allow-Origin: *`,
GET/HEAD/OPTIONS, no credentials; `Link` and `Retry-After` are readable. The MCP server allows POST.

## Errors

Errors are JSON with the matching HTTP status:

```json
{"error": {"status": 400, "code": "invalid_parameter", "message": "`battery` must be between 5 and 200.", "parameter": "battery",
           "docs": "https://renewably.uk/api/v1/docs#get-ev-plan"}}
```

| Status | `code` | When |
|---|---|---|
| 400 | `missing_parameter` | A required parameter (such as `region`) is absent. |
| 400 | `invalid_parameter` | Out of range, not a number, not an allowed value, a malformed time. |
| 400 | `unknown_parameter` | A parameter the endpoint doesn't take. |
| 404 | `not_found` | No such endpoint. |
| 405 | `method_not_allowed` | Anything but GET, HEAD or OPTIONS. |
| 429 | `rate_limited` | Over the rate limit; see `Retry-After`. |
| 503 | `data_unavailable` | Upstream data (prices, temperatures) can't be fetched right now. |
| 500 | `internal_error` | A bug - logged. |

`parameter` is present when one parameter is to blame, and `docs` links to the endpoint's part of this
page. An unknown parameter close to a real one is told which ("did you mean `region`?"). Plans that can't be made for reasons of the
request itself (already at the target, no time before the deadline) are *not* errors: `ev-plan`
returns `200` with a `status` saying so.

## Data sources and licences

Each response's `meta.sources` lists what it's built from:

| Source | Used for | Licence |
|---|---|---|
| [Octopus Energy API](https://developer.octopus.energy/) | Octopus tariffs' prices | Octopus's terms |
| [EDF's public tariff API](https://api.edfgb-kraken.energy/v1/products/) | EDF tariffs' prices | EDF's terms |
| [E.ON Next's public tariff API](https://api.eonnext-kraken.energy/v1/products/) | E.ON Next tariffs' prices | E.ON Next's terms |
| [Ofgem's price cap levels](https://www.ofgem.gov.uk/energy-regulation/domestic-and-non-domestic/energy-pricing-rules/energy-price-cap/energy-price-cap-default-tariff-levels) | The comparison's baseline | Ofgem's terms |
| [NESO Carbon Intensity API](https://carbonintensity.org.uk/) | Carbon in `cheapest-window` (carbon) and `ev-plan` | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) |
| [Met Office](https://www.metoffice.gov.uk/) (contains Met Office data © Crown copyright) | Weather | [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) |
| [ECMWF open data](https://www.ecmwf.int/en/forecasts/datasets/open-data) | Weather | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) |
| [Bundesnetzagentur \| SMARD.de](https://www.smard.de/), via [Energy-Charts](https://www.energy-charts.info/) | Market data | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) |
| [Elexon](https://www.elexon.co.uk/) (contains BMRS data © Elexon Limited copyright and database right) | Grid forecasts | [BMRS data licence](https://www.elexon.co.uk/data/balancing-mechanism-reporting-agent/copyright-licence-bmrs-data/) |

Each response lists only the supplier whose prices it uses. Anyone republishing the data must credit
the CC BY sources and Elexon, as the site does. Renewably isn't affiliated with any of them.

## Endpoints

All are `GET`. Examples below are real responses, trimmed (`"..."` marks cut list items).

### `GET /`

Links to every endpoint and the spec.

### `GET /regions`

The 14 Agile regions (GSP groups), by name, each with well-known `places` in it and its `mpan_prefix`:
the first two digits of the 13-digit MPAN on an electricity bill there. Some places surprise: Milton
Keynes and Coventry are in the East Midlands, Croydon in South East England, York in North East England.
People can also use the site's guide: https://renewably.uk/find-your-region/.

```json
{
  "meta": {"api_version": "1.1.0", "generated_at": "2026-10-11T22:50:42+01:00", "sources": []},
  "regions": [{"code": "A", "name": "Eastern England", "slug": "eastern-england", "places": ["Norwich", "Cambridge", "Ipswich", "Peterborough", "Luton", "Chelmsford"], "mpan_prefix": "10"}, "..."]
}
```

### `GET /tariffs`

The tariffs `tariff` accepts: Octopus (Agile, Go, Intelligent Go, Cosy, Flux, Flexible, and Shape
Shifters: Agile for businesses - `agile-business`, priced excluding VAT, as `meta.unit` says), EDF
(FreePhase Dynamic and Static, GoElectric, Heat Pump Tracker, Standard Time of Use, Standard) and
E.ON Next (Drive, Drive Smart, Pumped, Flex). Each has `key`, `name`, `supplier`, `kind` (`dynamic`:
a new price every half hour; `windows`: fixed cheap and expensive times; `flat`), `direction`
(`import`), `who_for` (null if anyone can have it) and `note`.

```json
{"key": "go", "name": "Octopus Go", "supplier": "Octopus Energy", "kind": "windows", "direction": "import", "who_for": "For electric car owners", "note": null}
```

With `direction=export`, the export tariffs instead - what a home with solar panels (or a battery) is
paid for what it sends to the grid: Octopus (Agile Outgoing, Outgoing, Prime Outgoing, Flux Export,
its Smart Export Guarantee deal), E.ON Next (Next Flex Export, Next Export Exclusive, Next Export
Premium) and EDF (SEG Export Variable, SEG Export Variable Value, Export Exclusive - EDF publishes these
only on its website, so they're its page's rates, checked monthly). `who_for` says which homes can have
each, from the suppliers' terms; where they don't say, check with the supplier. Their keys go in
`/prices` and `/unit-rates`' `tariff`, and in `export` wherever the panels go.

```json
{"key": "flux-export", "name": "Octopus Flux Export", "supplier": "Octopus Energy", "kind": "windows", "direction": "export", "who_for": "homes on Octopus Flux only", "note": null}
```

### `GET /prices`

Half-hourly prices for a region from midnight today (UK): on Agile, published or estimated, and
on FreePhase Dynamic and Shape Shifters: Agile, published or estimated from Agile's; on other tariffs, as
published. On an export tariff, what it pays for export (`meta.unit` says so) -
Agile Outgoing's estimated beyond what Octopus has published.

| Parameter | | Default | |
|---|---|---|---|
| `region` | required | | Letter, slug or a listed place. |
| `tariff` | key | `agile` | From `/tariffs`, or `/tariffs?direction=export` (no panels with an export tariff). |
| `days` | 1-5 | 2 | Days from today: 2 is today and tomorrow, 5 today and the next four. |

```json
{
  "meta": {"api_version": "1.1.0", "generated_at": "...", "sources": ["...Octopus...", "...Met Office...", "...ECMWF..."],
           "unit": "p/kWh, including VAT", "estimate_note": "Beyond Octopus's published prices ..."},
  "region": {"code": "C", "name": "London", "slug": "london"},
  "published_until": "2026-10-12T23:00:00+01:00",
  "summary": {
    "now_p_per_kwh": 24.13,
    "lowest": {"start": "2026-10-12T01:00:00+01:00", "end": "2026-10-12T02:00:00+01:00", "average_p_per_kwh": 14.2, "estimate": false},
    "highest": {"start": "2026-10-11T17:30:00+01:00", "end": "2026-10-11T18:30:00+01:00", "average_p_per_kwh": 38.92, "estimate": false}
  },
  "slots": [
    {"start": "2026-10-11T00:00:00+01:00", "end": "2026-10-11T00:30:00+01:00", "price_p_per_kwh": 17.78, "estimate": false},
    "..."
  ]
}
```

`summary` is the slots in brief, for a reader after "when is it cheapest?": the price now, and the
lowest- and highest-priced hour from now to the last slot (longer than an hour where a tariff's set
times keep the price the same). A published hour is given unless an estimated one beats it by more
than 3p/kWh. On an export tariff they are the worst- and best-paid hours.

Before Octopus publishes (around 16:00), all of tomorrow is estimated; after, only its last hour
(Octopus's day runs 23:00-23:00). Estimates are a guide, and rougher the further ahead they are:
`estimate_accuracy` says how far out each day's has typically been.

`estimate_accuracy` (on Agile; empty on other tariffs) has a block for each later day with estimates in it:

```json
"estimate_accuracy": [
  {"date": "2026-10-12", "days_ahead": 1, "typical_error_p_per_kwh": 3.1, "cheapest_window_within_1p_share": 0.82, "days_scored": 89},
  "..."
]
```

`typical_error_p_per_kwh` is how far out the estimate that many days ahead has been in a typical half hour, over the
last 90 days in every region; `cheapest_window_within_1p_share`, the share of days on which the cheapest 3.5 hours it
picked cost within 1p/kWh of the real cheapest. Tomorrow's are the estimate with continental Europe's prices once
those are out (about 1pm). Both are `null` until there are four weeks of record for that day ahead. They're the
figures on [About the data](https://renewably.uk/data/#estimate).

### `GET /unit-rates`

**Only for software built to read Octopus's own API** - Predbat, evcc and the like. For anything else, use
[`/prices`](#get-prices) (see [Prices: which endpoint?](#prices-which-endpoint)). The format is the Kraken
platform's, so it's also what EDF's and E.ON Next's public APIs give; it serves any tariff in `/tariffs` that way.

The same prices as [`/prices`](#get-prices), in the shape of Octopus's own
[standard-unit-rates](https://developer.octopus.energy/rest/guides/endpoints) endpoint, so software
built to read Octopus's API (like [Predbat](#predbat)) can read Renewably's unchanged - on any
tariff, export tariffs included (with no VAT: `value_exc_vat` is `value_inc_vat`). From midnight today,
newest first, times in UTC, everything on one page, for today and the next four days. Its format is
Octopus's and is kept exactly so: it won't gain fields such as `/prices`'s `estimate_accuracy`.

| Parameter | | Default | |
|---|---|---|---|
| `region` | required | | Letter or slug. |
| `tariff` | key | `agile` | From `/tariffs`, or `/tariffs?direction=export`. |
| `estimates` | `true`, `false` | `false` | Include Renewably's estimates beyond the published prices (Agile, Agile Outgoing, FreePhase Dynamic, Shape Shifters: Agile), each flagged `estimate`. |
| `period_from`, `period_to` | ISO 8601 | | As on Octopus's API: only half hours ending after `period_from` and starting before `period_to` (UTC if no offset). Nothing before midnight today. |
| `page_size` | 1-1500 | | Accepted, as on Octopus's API; everything is on one page anyway. |

`/unit-rates?region=london&period_from=2026-10-14T23:00:00Z&period_to=2026-10-15T00:30:00Z`:

```json
{
  "count": 3, "next": null, "previous": null,
  "results": [
    {"value_exc_vat": 22.33, "value_inc_vat": 22.33, "valid_from": "2026-10-15T00:00:00Z", "valid_to": "2026-10-15T00:30:00Z", "payment_method": null},
    "..."
  ],
  "meta": {"api_version": "1.2.0", "generated_at": "...", "sources": ["...Octopus..."]}
}
```

Published prices only by default, because tools reading this format take every row as a real price.
On fixed-window tariffs, days the supplier hasn't published yet repeat its latest published day, as
everywhere in the API (see [Conventions](#conventions)) - their times don't change.
`value_exc_vat` is the same as `value_inc_vat` while household electricity has no VAT, and `null`
where the VAT rate isn't decided yet. `meta` is Renewably's own addition; tools reading Octopus's
format ignore it.

### `GET /cheapest-window`

The cheapest (or lowest-carbon) run of `duration_hours`, starting from the next half hour and
finishing by the next `finish_by` at least that long away - what to set a delay timer to.

| Parameter | | Default | |
|---|---|---|---|
| `region` | required | | |
| `duration_hours` | 0.5-12, in halves | 3.5 | How long it runs. |
| `finish_by` | `HH:MM` | `07:00` | Local time it must finish by. |
| `optimise` | `cost`, `carbon` | `cost` | Carbon uses NESO's regional forecast (about two days). |
| `tariff` | key | `agile` | From `/tariffs`. |
| `kwh` | 0-20 | - | Energy the run uses, for `cost` (pounds in the window, and if started now). |

```json
{
  "meta": {"...": "..."},
  "region": {"code": "C", "name": "London", "slug": "london"},
  "request": {"duration_hours": 3.0, "finish_by": "2026-10-12T07:00:00+01:00", "optimise": "cost"},
  "window": {
    "start": "2026-10-12T01:00:00+01:00", "end": "2026-10-12T04:00:00+01:00",
    "starts_in_minutes": 129, "average_p_per_kwh": 25.61, "average_gco2_per_kwh": null,
    "includes_estimates": false
  },
  "if_started_now": {"average_p_per_kwh": 26.75, "average_gco2_per_kwh": null}
}
```

`starts_in_minutes` is the delay to set (from when the response was generated). `if_started_now`
gives the same average for starting immediately, for comparison.

### `GET /ev-plan`

The cheapest or greenest half hours to charge an electric car by a ready-by time up to four days
ahead - the `/ev-charging/` planner, with **the same parameters** (so a page address and an API call
describe the same plan).

| Parameter | | Default | |
|---|---|---|---|
| `region` | required | | |
| `battery` | 5-200 kWh | 60 | Usable capacity. |
| `now` | 0-100 % | 30 | Charge now. |
| `target` | 0-100 % | 80 | Charge wanted. |
| `charger` | 1-22 kW | 7.4 | Charging power. |
| `day` | `today`, `tomorrow`, `in2`, `in3` | next | Ready-by day; default the next time `time` comes round, at least four hours away. |
| `time` | `HH:MM` | `07:00` | Ready-by time. |
| `mode` | `timer`, `smart` | `timer` | One unbroken block (a car's timer), or any half hours (a smart charger). |
| `efficiency` | 60-100 % | 90 | Charging efficiency (wall to battery). |
| `mpk` | 1.5-6 | 3.3 | Miles per kWh, for the per-mile figures. |
| `optimise` | `cost`, `carbon` | `cost` | |
| `tariff` | key | `agile` | From `/tariffs`, as the planner's tariff picker. |

```json
{
  "meta": {"...": "..."},
  "region": {"code": "C", "name": "London", "slug": "london"},
  "request": {"battery_kwh": 60.0, "now_pct": 30, "target_pct": 80, "charger_kw": 7.4,
              "ready_by": "2026-10-12T07:00:00+01:00", "mode": "timer", "efficiency_pct": 90,
              "miles_per_kwh": 3.5, "optimise": "cost"},
  "status": "ok",
  "notes": [],
  "next_publish": "2026-10-12T16:00:00+01:00",
  "plan": {
    "fits": true, "end_pct": 80,
    "windows": [{"start": "2026-10-12T00:00:00+01:00", "end": "2026-10-12T05:00:00+01:00", "hours": 5.0, "includes_estimates": false}],
    "energy": {"into_battery_kwh": 30.0, "from_grid_kwh": 33.333, "miles_added": 105.0},
    "cost": {"pounds": 8.63, "average_p_per_kwh": 25.9, "pence_per_mile": 8.22,
             "if_charged_now_pounds": 8.78, "saving_pounds": 0.15, "extra_cost_pounds": 0.0},
    "carbon": {"kg": 5.063, "average_gco2_per_kwh": 151.9, "if_charged_now_kg": 5.277, "saving_kg": 0.215},
    "includes_estimates": false,
    "published_until": "2026-10-12T07:00:00+01:00",
    "optimised_for": "cost"
  },
  "slots": [
    {"start": "2026-10-11T23:00:00+01:00", "end": "2026-10-11T23:30:00+01:00", "price_p_per_kwh": 28.64,
     "carbon_gco2_per_kwh": 174, "estimate": false, "charging_fraction": 0, "battery_pct": 30.0},
    "..."
  ]
}
```

- `status`: `ok`; `nothing_to_do` (already at the target); `no_prices` (no time, or no prices, before
  the ready-by time); `no_carbon` (optimising for carbon, but the forecast is unavailable). Anything
  but `ok` has `plan: null` and no slots.
- `notes`: adjustments made, such as a ready-by time that had passed today moved to the next one.
- `fits: false`: the target can't be reached in time - the plan charges throughout and `end_pct` says
  how far it gets.
- `slots`: every half hour from now to the ready-by time; `charging_fraction` is the share of the half
  hour spent charging (the last one usually partial), `battery_pct` the charge at its end.
- Estimated prices firm up when Octopus publishes (`next_publish`) - call again after it.

### `GET /heat-pump`

For a typical weekday and weekend day at this time of year: the cheapest time to reheat hot water
(and the cheapest ready by 07:00), and the cost of each kWh of heat by hour.

| Parameter | | |
|---|---|---|
| `region` | required | |
| `tariff` | key, default `agile` | From `/tariffs`. |

Response (trimmed): `season` (the weeks averaged), `assumptions` (the heat pump model, flow and hot
water temperatures), and per `day_type`: `hot_water.cheapest` / `hot_water.ready_by` (`start` as
`HH:MM`, `p_per_kwh_heat`), `day_average_p_per_kwh_heat`, and `heating.hours` - 24 entries of
`p_per_kwh_heat`, `price_p_per_kwh`, `cop`, `outdoor_temperature_c` - with `cheapest_hour` and
`dearest_hour`. When the ready-by time costs within 5 per cent of the cheapest, both are the same time.

The cost of each kWh of heat allows for how efficiently a typical air-source heat pump runs at that
hour's typical temperature - a guide to a typical day, not a forecast.

### `GET /home-battery`

For a typical weekday and weekend day at this time of year: the cheapest slot to fill a home battery
before the 16:00 peak, an optional afternoon top-up, and what it saves a home of a given size.

| Parameter | | Default | |
|---|---|---|---|
| `region` | required | | |
| `battery` | 2-50 kWh | 10 | Usable capacity. |
| `rate` | 0.5-15 kW | 3 | Grid charge rate. |
| `usage` | 500-30000 kWh | 2500 | The home's yearly use (2500 is average). |
| `tariff` | key | `agile` | From `/tariffs`. |
| `battery_export` | `terms`, `all`, `solar`, `never` | `terms` | What the battery may export: `terms`, what the export terms pay for; `all`, what it charged from the grid too, on any export tariff; `solar`, only what the panels put in, even on Flux; `never`. |
| `export`, `export_rate` | as with panels | | Without panels: the export tariff a battery on its own is paid on. |

Per `day_type`: `charge` (`start`, `end`, `average_p_per_kwh`, `fills_battery`), `top_up` (or null),
`evening_average_p_per_kwh` (16:00-23:00), `saving_p_per_kwh` (after round-trip losses),
`worth_it`, `battery_kwh_used_per_day` and `saving_pounds_per_day` (the battery runs the house after
its charge until it's empty, through a typical day's use for `usage`), and 24 `hours` with
`price_p_per_kwh` and `charging`. Not counting the battery's wear. With
[solar panels](#solar-panels), `overnight_with_panels` says how full to charge for the next day's sun.

On an export tariff that pays most at the evening peak - the panels' `export` (Agile Outgoing, Flux
Export, Prime Outgoing), or Flux itself - `evening_export` says whether to export from the battery then:
the house's use until the next charge comes first (an evening kWh bought costs more than the peak pays),
and what's left is exported if the peak pays more than buying it back overnight, after losses. Off Flux,
only what the panels put in counts: the suppliers' terms pay nothing for exporting what a battery
charged from the grid. `battery_export=never` keeps the battery from exporting, and the answer says what
that leaves. Null where the export rate doesn't peak.

### `GET /battery-plan`

A home battery's plan from the half hour under way to the end of tomorrow, on the tariff's real prices
(Agile's, and those estimated from it, beyond what their supplier has published), half hour by half hour.
Each half hour the battery does one of five things: `charge` (from the grid, and the sun), `hold` (keep
what's in it for later), `self_use` (the sun first, then the battery runs the house - the inverter's
normal mode), `export` (run the house and send the rest to the grid), or `sun_to_grid` (the panels' spare
goes to the grid, not the battery). The plan is the cheapest way through: imports less exports, counting
the round trip's losses and `wear` for each kWh the battery gives back. Renewably never controls a battery:
this is advice, and data for the owner's own automation.

| Parameter | | Default | |
|---|---|---|---|
| `region` | required | | |
| `tariff` | key | `agile` | From `/tariffs`. |
| `battery` | 2-50 kWh | 10 | Usable capacity. |
| `rate` | 0.5-15 kW | 3 | Charge and discharge rate. |
| `usage` | 500-30000 kWh | 2500 | The home's yearly use: the plan follows a typical home's day for it. |
| `soc` | 0-100 % | the reserve | The battery's charge now - give it for a plan from where it is (a Home Assistant sensor can fill it in). |
| `reserve` | 0-90 % | 0 | Never below this. |
| `ceiling` | 10-100 % | 100 | Never charged above this, for an inverter set to stop short of full. Above `reserve`. |
| `round_trip` | 60-100 % | 90 | Round-trip efficiency. |
| `wear` | 0-20p | 2 | Wear for each kWh the battery gives back - what stops it cycling for a penny. |
| `export_limit` | 0-30 kW | 3.68 | The home's export limit (a G98 connection's, unless the network operator agreed more). |
| `grid_charging` | `1`, `0` | `1` | `0` charges only from the panels. |
| `battery_export` | `terms`, `all`, `solar`, `never` | `terms` | `terms`: what the export terms pay for; `all`: what the battery charged from the grid too, on any export tariff - for a home whose supplier pays for that; `solar`: only what the panels put in, even on Flux; `never`. |
| `export`, `export_rate` | as with panels | | Without panels: the export tariff a battery on its own is paid on (its key, or `fixed` with `export_rate`). |

With [solar panels](#solar-panels), the plan counts their forecast output, cautiously, so a dull day doesn't
leave the battery short, and the panels' `export` sets what exporting pays. **Exporting follows what the export tariff pays for**: Octopus's (`outgoing`,
`agile-outgoing`, `prime-outgoing`, `flux-export`) pay for everything a battery exports; the others only for
what the panels put in (`battery_may_export`: `all`, `solar` or `none`) - unless `battery_export=all` says the home is paid for
grid-charged export anyway, as a Powerwall's "Everything" setting does.
**A battery without panels** gives its `export` and trades on the grid: it charges cheap and exports at the
peak, everything it exports having come from the grid (`battery_may_export=all`). Octopus pays for that on
`outgoing`, `agile-outgoing` and `prime-outgoing` (with Octopus for the import too), and E.ON on
`eon-next-export-premium` for a battery it fitted; `fixed` with `export_rate` covers anyone else's. Smart
Export Guarantee tariffs, and EDF's, pay only for what panels made, so without panels they count as not paid.
A half hour never imports and exports at once.

- `now`: the half hour under way - `action`, `soc_pct` (how full at its end), `target_pct` (the charge's
  target, or the export's floor), and both prices. What an automation sets the battery to.
- `settings`: the runs worth typing into the inverter's app, in order - each with `when` (`now`,
  `today`, `tonight`, `tomorrow`), `target_pct`, `kwh`, `p_per_kwh` and why: a charge's
  `house_p_per_kwh` (what the house's use it covers would have cost) and `sun_after_kwh`, a hold's
  `kept_for`. Only runs that save at least 5p (`assumptions.min_setting_pence`), or export 0.3 kWh, are
  listed; anything else is self-use.
- `summary`: the plan's bill to `until`, against the same battery in plain self-use and no battery.
- `slots`: every half hour - its action, `soc_pct`, prices and kWh each way.

`status` is `no_prices` when the tariff's prices aren't to hand, with the rest empty.

### `GET /flexibility-events`

When the grid operator, NESO, is asking homes in a region to use less electricity (often the evening
peak) or more (often in Scotland, when there's more wind than the grid can carry south), through its
Demand Flexibility Service. Live events from now to the end of tomorrow, earliest first; back-to-back
events of the same kind run together. Since April 2026 there's one most days, usually announced the
same morning, so it's worth asking again through the day. Cached for 10 minutes.

**They only pay through a scheme.** NESO asks *providers* - energy suppliers (Octopus's Saving
Sessions, for one) and other companies - which decide whether to take part in each event and how to
reward the customers signed up with them. So an event applies to a household only if it has joined
such a scheme and its provider takes part; the provider tells it, and says what it pays. Every
response carries this as `note`: pass it on.

| Parameter | | Default | |
|---|---|---|---|
| `region` | required | | Letter or slug. |

```json
{
  "meta": {"api_version": "1.4.0", "generated_at": "...", "sources": ["...NESO Demand Flexibility Service..."]},
  "region": {"code": "N", "name": "South Scotland", "slug": "south-scotland"},
  "note": "Households can sometimes get paid for taking part – but only if they've signed up to a scheme ... isn't paid.",
  "events": [{"direction": "more", "start": "2026-10-27T11:00:00+00:00", "end": "2026-10-27T23:00:00+00:00", "whole_region": true}]
}
```

`whole_region` is false where an event covers only some of NESO's 12 zones within the region
(scripts/dfs_region_zones.py maps them). No events is an empty list; NESO unreachable is a `503`.

### `GET /home`

A home's past year, as on the [/your-home/](https://renewably.uk/your-home/) page: what it paid, and what
switching tariff, an electric car, a heat pump, solar panels or a battery would save. Each of car,
heating, solar and battery is something the home **has** (it's in the bill) or is **considering**;
each considered change is added to everything before it, in the order tariff, car, heating, solar,
battery - so the `steps` add up exactly to `saving_pounds`, and how they interact (a battery after
panels, a car changing the best tariff) is in the numbers. Totals are electricity, gas at the price
cap, and petrol or diesel - only what changes (a gas boiler or petrol car that stays isn't counted).

With `switch=1` (the default) each step is on the tariff that would have been cheapest for the home
at that point - staying on `tariff` counts - and the first step is the switch itself; with `switch=0`
everything stays on `tariff`.

| Parameter | | Default | |
|---|---|---|---|
| `region` | required | | |
| `usage` | 500-30000 kWh | 2500 | Electricity a year as on the bill - what's bought now. |
| `tariff` | `price-cap`, a key, `tracker`, `snug`, an Economy 7 key, `custom` | `price-cap` | The tariff it's on: a key from `/tariffs`, `tracker` (Octopus Tracker, off sale but priced for the homes on it), `snug` (Snug Octopus, for storage heaters), `flexible-e7`, `edf-standard-e7` or `eon-next-flex-e7` (Economy 7, at the meter's night hours), or `custom` with `unit` (p/kWh) and `standing` (p/day). |
| `switch` | `1` or `0` | `1` | Find the best tariff at each step, or keep `tariff`. |
| `car` | `petrol`, `diesel`, `ev`, `none` | `petrol` | What the home drives now: a petrol or diesel car (counted only when replacing it is being considered), an electric car in the bill, or none. |
| `consider_ev` | `0`, `1` | `0` | With a petrol or diesel car: `1` shows what an electric car replacing it would save. |
| `miles`, `mpk`, `charger` | 500-40000, 1.5-6, 2-22 kW | 7100, 3.3, 7 | Miles a year, the electric car's miles per kWh, the home charger. |
| `mpg`, `ppl` | 10-120, 50-400 p/litre | 36 petrol, 42 diesel; UK average | The car being replaced (`consider_ev=1`). |
| `heating` | `gas`, `oil`, `lpg`, `solid`, `heat_pump`, `storage`, `electric`, `other` | `gas` | What heats the home now: a boiler, or wood or coal (counted only when replacing it is being considered), a heat pump in the bill, storage heaters, panel or other direct electric heaters, or something else. |
| `consider_heat_pump` | `0`, `1` | `0` | With a boiler, or storage or electric heaters: `1` shows what a heat pump replacing them would save. The heaters' electricity is taken as the heat the heat pump supplies, and an air-to-water heat pump takes over the immersion heater's hot water. |
| `heater_kwh` | 0-30000 kWh | estimated | Storage or electric heaters' own use; hot water is taken as an immersion heater. |
| `storage_meter`, `storage_kw`, `boost` | `1`/`0`, 1-30 kW, `0`/`10`/`25` % | 1, 6, 10 | Storage heaters: switched by the meter at night (`0`: their own timer), their power together, and the share of heat from evening boost. Snug Octopus needs `storage_meter=1`. |
| `preheat` | `0` or `1` | `0` | Electric heaters warm the home from 1pm rather than 4pm–7pm when that's cheaper. |
| `night_start`, `night_gmt` | `44`-`47`, `0`-`3`; `0`/`1` | 1, 0 | The meter's 7 night hours (Economy 7 and meter-switched heaters) by the half hour they start (1: 00:30-07:30), and whether they're an hour later in summer (on GMT). |
| `gas`, `boiler`, `keep_gas`, `replacing` | 1000-60000 kWh, `condensing`/`older`, `0`/`1`, `0`/`1` | 9500, condensing, 0, 0 | The boiler being replaced (`consider_heat_pump=1`); `gas` and `keep_gas` for gas only. Oil and LPG are bought by the litre, with no price cap or standing charge; their homes get the £9,000 grant towards a heat pump in England and Wales until 31 March 2027. |
| `heat_litres`, `heat_ppl` | 100-10000 litres, 20-300p | as much heat as 9500 kWh of gas; oil a recent national average | With `heating=oil` or `lpg`: litres a year and the price a litre. LPG has no published price, so `heat_ppl` is needed. |
| `solid_fuel`, `appliance` | `logs`/`pellets`/`coal`, `stove`/`fire` | logs, stove | With `heating=solid`: what's burnt, and in a stove or boiler or an open fire. |
| `heat_amount`, `heat_spend` | 0.1-50000, £10-20000 | none | With `heating=solid` and `consider_heat_pump=1`, both needed: how much the home buys a year (logs in loose cubic metres, pellets and coal in kg) and what it spends. A heat pump in place of wood gets no grant. |
| `scop`, `hp_cost` | 1.5-6, £0-100000 | typical | The installer's seasonal efficiency and quote, after grants. |
| `hp_kwh` | 0-20000 kWh | estimated | An existing heat pump's own use (`heating=heat_pump`). |
| `solar` | `no`, `have`, `consider` | `no` | Solar panels. |
| `panels` | `roof` or `plug_in` | `roof` | Roof panels, or a plug-in kit: its inverter capped at 800 W, export unpaid, panels up to 2 kWp. |
| `kwp`, `aspect`, `pitch` | 0.2-50, S/SE/SW/E/W/NE/NW/N, 35/20/50/10 | 4 (0.8 plug-in), S, 35 | Their size, direction and roof; or `bearing` (0-359) and `tilt` (0-90) exactly. |
| `kwp2`, `aspect2`, `tilt2` | 0.2-50, S/SE/.../N, 0-90 | none, S, 35 | Roof panels on a second face (`kwp3`, `aspect3`, `tilt3` for a third), sharing the inverter. |
| `mount` | `90`, `60`, `30`, `10` | `90` | A plug-in kit's angle: upright on a balcony or wall, leaning, on a stand, flat. |
| `daytime` | `usual`, `out`, `home` | `usual` | Whether anyone's home in the day - how much of the panels' output the home uses. |
| `solar_cost` | £0-100000 | typical | The quote, or the kit's price. |
| `battery` | `no`, `have`, `consider` | `no` | A home battery. |
| `battery_kwh`, `battery_kw`, `battery_cost` | 0.5-40, 0.5-15, £0-100000 | 5, 3, none | Size, power and quote (no payback without one). |
| `battery_charge_kw`, `battery_discharge_kw` | 0.5-15 kW | `battery_kw` | Charging and discharging power, where they differ. |
| `round_trip`, `standby_w` | 60-100 %, 0-200 W | 90, 20 | Round-trip efficiency, standby draw. |
| `charge_eff`, `plug_in`, `plug_out` | 70-100 %, 0-23, 0-23 | 90, 18, 7 | The car's charging efficiency and the local hours it's plugged in (the same hour twice: always). |
| `inverter_kw`, `export_limit` | 0.5-50 kW | none | The solar inverter's rating (above it, generation is lost) and the export limit (above it, export is lost). |
| `export`, `export_rate` | `paired`/`fixed`/`fit`/`none` or an export tariff's key, 0-100 p/kWh | `paired`, 12 | How export is paid: each tariff's own export tariff, a fixed rate of your own (with `export_rate`), the Feed-in Tariff's deemed export (counted as not paid for export), not at all - or an export tariff from `/tariffs?direction=export`, used with every tariff that can have it (each tariff's own with the rest; `export_prices` says which, and where to check with the supplier). |
| `battery_export` | `terms`, `all`, `solar` or `never` | `terms` | `terms`: on Octopus's export tariffs it exports anything it holds at the evening peak (Agile Outgoing, Flux Export, Prime Outgoing all pay for grid-charged export). `all`: the same on any export tariff, for a home paid for grid-charged export. `solar`: only what it stored from the panels. `never`: it never exports. |
| `shift` | `0`, `15`, `30` | `0` | The share of everyday use (appliances) run at each day's cheapest times - for fine-tuning. |

`caution`, when not null, is a sentence to pass on with the answer: the figures are the past year's, and it
says when an answer that ends on Agile meets a month in which Agile is unlikely to beat a standard tariff.

`now` and `with_changes` give `total_pounds`, the electricity `tariff` and the electricity, gas and
fuel parts. Each step has its `saving_pounds`, `moves_to_tariff` (where it changes), `cost_pounds`
(typical or the quote; `cost_is_typical`; `cost_is_over_new_boiler` where it's what a heat pump costs beyond a
new boiler), `payback_years` (none for a heat pump, which buys the home's heating), a heat pump's `saving_range_pounds` for a
better or worse installation, and a `detail` line; a typical heat pump's `cost_before_grant_pounds` and
`grant_pounds`; and `funding`, the grants, loans and offers that can pay for it, each with a `link` to apply.
`bills` sets out what the home pays a year now and `with_changes`, line by line - electricity bought, its
standing charge, export (negative), the boiler's or stove's fuel, petrol or diesel - adding up to the two
totals, with each line's `saving_pounds`: where the saving comes from. `price_cap_saving_pounds` is the same changes with
electricity on the price cap throughout; `todays_prices_saving_pounds` at this quarter's cap and this
week's pump price. `co2_saving_kg` only where the changes save carbon worth mentioning. `tariffs`:
the home with every change on each tariff (electricity only), cheapest first; `for_this_home` is false
for a tariff the home can't have, with `who_for` saying why, and `on_sale` false for one only the homes
already on it can have (never a step's `moves_to_tariff`); `price_cap` the baseline. With panels paid by
an export tariff, `export_switch` prices the export tariffs the answer's tariff can have against the one
it's paid on (`pounds_a_year_more`, `check_with_supplier` where the terms don't say), and `suggested` the
one worth switching to - £10 a year or more; null otherwise.

### `GET /openapi.json`

The OpenAPI 3.1 spec, with every request parameter and response field.

## Terms of use

- **Free** for personal and non-commercial use, with no key or sign-up. For anything commercial,
  get in touch first ([hello@renewably.uk](mailto:hello@renewably.uk)).
- **Fair use.** Stay within the rate limits, cache responses for as long as their `Cache-Control`
  says, and put your app's name and a contact in your `User-Agent` - so we can reach you before
  having to block anything.
- **Credit the sources.** NESO's and ECMWF's data is CC BY 4.0 and the Met Office's CC BY-SA 4.0: credit them as each response's
  `meta.sources` lists, wherever you show it. A link to renewably.uk is appreciated. The suppliers'
  prices are theirs - follow Octopus's, EDF's and E.ON Next's own terms for their data.
- **No warranty.** Prices beyond what suppliers have published are estimates; everything is a guide,
  not advice, and may be wrong. The API may change, slow down or stop, without notice.
- **Privacy.** No accounts, and no IP addresses stored. Calls are counted anonymously for 13 months,
  and not at all if the client sends Global Privacy Control or Do Not Track. More at
  [renewably.uk/privacy](https://renewably.uk/privacy/).

Questions, problems or ideas: [hello@renewably.uk](mailto:hello@renewably.uk).

## Versioning

`/api/v1/` changes **additively**: new endpoints, new optional parameters, new response fields
(clients should ignore fields they don't know). Anything that would break a client - removing or
renaming a field, changing a unit or meaning - goes in `/api/v2/`, with v1 kept running for a while.
`meta.api_version` is the spec's version.
