REST API reference
Base URL https://data.cleantechcontent.co.uk/v1. All endpoints are GET unless stated. The machine-readable version is the OpenAPI 3.1 document.
Tariffs
| Endpoint | What it returns | Filters |
|---|---|---|
/tariffs | Tariff products with their regional rates nested under rates | region, type, supplier, fuel, payment_method, include_unverified, include_unavailable, limit, offset |
/tariffs/{id} | One tariff by numeric id or slug | region |
/tariffs/ev | EV time-of-use tariffs and EV add-ons | region, supplier, include_unverified |
/tariffs/cap | Ofgem default tariff cap rows | region, payment_method, fuel, period (YYYY-MM-DD), include_history |
Tariff types: standard_variable, fixed, ev_tou, smart_tou, economy_7, tracker, agile, heat_pump, export, ev_addon, prepayment. Payment methods: direct_debit, standard_credit, prepayment (Octopus tariffs priced the same for every method appear as varying and match a direct debit filter).
curl "https://data.cleantechcontent.co.uk/v1/tariffs?region=C&type=ev_tou"
curl "https://data.cleantechcontent.co.uk/v1/tariffs/octopus-go-fix-12m-26-08-19-electricity?region=M"
curl "https://data.cleantechcontent.co.uk/v1/tariffs/cap?region=N&fuel=gas&payment_method=prepayment"
Rate fields
unit_rate_pence, standing_charge_pence_per_day, off_peak_rate_pence and off_peak_windows, peak_rate_pence and peak_windows, bands (full list for three-band tariffs), export_rate_pence and export_bands for export tariffs, dynamic_summary (7, 30 and 90-day averages) for Agile and Tracker, and provenance: source_url, verified_at, verified_by, confidence, notes.
EV public charging
| Endpoint | What it returns | Filters |
|---|---|---|
/charging/networks | Networks with operator, pricing page and notes | include_unverified |
/charging/prices | Price rows per network, power band and pricing basis | network, power_band, basis, include_unverified, limit, offset |
/charging/compare | Cost table for one session, cheapest first | kwh (required), power_band (required), basis |
curl "https://data.cleantechcontent.co.uk/v1/charging/compare?kwh=40&power_band=dc_ultra_150kw_plus"
Power bands: ac_slow_7kw, ac_fast_22kw, dc_rapid_50kw, dc_ultra_150kw_plus. Bases: contactless_payg, app_payg, member, subscription. More in the EV charging guide.
Meta (never metered)
| Endpoint | What it returns |
|---|---|
/meta/status | Row counts and newest and oldest verified_at per dataset, the cap period in force, recent syncs |
/meta/changelog | Every insert, update and retirement with old and new values (limit, table) |
/meta/sources | Every source URL the data cites, with first and last seen dates |
/meta/enums | Allowed values for regions, types, bands and bases |
Keys and credit
| Endpoint | What it does |
|---|---|
POST /keys/free | Issues a free key (100 calls a day). Body optional: { "label", "email" } |
POST /credits/checkout | Body { "pack": "1200" | "7000", "email"?, "api_key"? }. Returns a Stripe Checkout link and a credit key that is topped up when payment completes |
POST /credits/buy?pack=50|250|750 | Stripe Machine Payments: returns a 402 challenge; retry with the credential to receive a key holding the pack |
GET /credits/balance | Remaining calls for the key in Authorization |
Paying per call
When the free tier is used up you get a 402 Payment Required. That one response carries three ways to continue:
- x402: the
PAYMENT-REQUIREDheader holds the requirement (USD 0.01 in USDC on Base, exact scheme). An x402 client signs a payment and retries withPAYMENT-SIGNATURE; the settled transaction comes back inPAYMENT-RESPONSE. - Stripe Machine Payments: the
WWW-Authenticate: Paymentheader holds an MPP challenge for a 50-call pack (USD 0.50). Retry with the credential; the data comes back together with anX-API-Key-Issuedheader holding the rest of the pack. - Credit key: buy 1,200 or 7,000 calls with a card on the pricing page and send the key as a bearer token.
X-Credit-Balanceshows what is left.
# Node example with the official x402 client
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { toClientEvmSigner } from "@x402/evm";
const client = new x402Client();
registerExactEvmScheme(client, { signer: toClientEvmSigner(account) }); // a viem account holding USDC on Base
const paidFetch = wrapFetchWithPayment(fetch, client);
const res = await paidFetch("https://data.cleantechcontent.co.uk/v1/tariffs?region=H&type=ev_tou");