The Fuel Finder API & Our Open Data Contribution
How FuelCosts.co.uk implements the UK Government's Fuel Finder scheme, and how we give back to the open data community by publishing a curated, daily dataset of petrol and diesel prices.
What is the Fuel Finder scheme?
The Fuel Finder scheme is an open data initiative operated by the Competition and Markets Authority (CMA). It was established following the CMA's road fuel market study, which recommended that greater price transparency would help drivers get a fairer deal at the pump.
Under the scheme, large fuel retailers — including the major supermarkets, oil company forecourts, and independent operators above a certain size — are required to publish their pump prices within 30 minutes of any change. The CMA collects those submissions and exposes them through a single, standardised JSON feed covering every participating station in the UK.
It's a snapshot-only feed, however: it tells you what prices are right now, but it does not provide any historical record of previous prices. Once a retailer changes a price, the old value is simply overwritten in the feed.
The data is released under the Open Government Licence v3.0, meaning anyone can use it freely for personal, commercial, research, or journalistic purposes, provided the source is acknowledged.
How we implement the API
FuelCosts.co.uk is built around a dedicated background worker that consumes the Fuel Finder feed on a fixed schedule. We don't fetch prices on-demand when you visit the site — everything is pre-synced into our own PostgreSQL database so pages load fast and the upstream feed isn't hammered unnecessarily.
The sync pipeline
- Fetch every 4 minutes. A
node-cronscheduler triggers a Node.js worker that pulls the latest Fuel Finder JSON feed, with retries and timeouts to handle transient network errors. - Diff against the last known state. We compare every station and fuel type against the previous snapshot and only write a new row when a price actually changes. This is how we turn a snapshot-only feed into a complete historical record.
- Refresh station metadata daily. Names, addresses, opening hours, amenities, and closures change less frequently, so a separate daily job keeps the station directory in sync.
- Serve the cached data. The website and our public JSON API read from the database (with Redis in front for hot queries), never directly from the upstream feed.
What we track
- Over 5,000 forecourts across England, Scotland, Wales and Northern Ireland
- All fuel grades reported under the scheme: E10, E5, B7, B7 Premium and HVO
- Every individual price change, with the exact timestamp the retailer reported it
- Station-level metadata including brand, address, opening hours, and fuel availability
We do not interpolate, estimate or adjust the data. What you see on FuelCosts.co.uk is what the retailers reported, exactly as the Government published it.
Why every 4 minutes?
The Fuel Finder scheme requires retailers to publish price changes within 30 minutes. In practice many retailers update far more frequently than that, and we want drivers to see those changes as soon as they land.
A 4-minute cadence is fast enough to catch almost every intra-hour price move, while still being polite to the upstream infrastructure. It also matters for our historical archive: because the feed only exposes the current price, any change that happens between two of our polls is lost forever. Polling every 4 minutes keeps that gap as small as we reasonably can. Over the course of a day that's 360 sync cycles, 24 hours a day, 365 days a year.
You can see the latest sync status, including the last successful run and any errors, on our public status page.
Publishing daily open datasets
The Fuel Finder scheme gives us a real-time window into UK fuel prices, but it only ever exposes the current price. The Government API has no history endpoint — once a retailer updates a price, the previous value is gone from the feed. That's the gap we set out to fill: by polling every 4 minutes and recording every change, we've built up a continuous historical archive that the public feed simply doesn't offer.
Because we already diff and persist every price change, we can turn that history into a public dataset. Each day we export a fresh snapshot of our database as two CSV files:
stations.csv: the full station directory — node ID, brand, address, GPS coordinates, supported fuels, opening hours, motorway and supermarket flags, and closure status.price_history.csv: every recorded price change, linked to a station ID, with fuel type, price in pence per litre, the retailer's update timestamp and our recorded timestamp.
The datasets are published in two places, both free and without registration:
- Directly from fuelcosts.co.uk/download as CSV downloads generated from live data
- On Kaggle as a versioned dataset, refreshed daily, with the full accumulated price history
We publish under the same Open Government Licence v3.0 that covers the underlying CMA data, and we ask users to credit both FuelCosts.co.uk and the UK Government Fuel Finder scheme as the original source.
Why we contribute back
Open data is only as useful as the ecosystem that grows around it. The CMA publishes an excellent real-time feed, but turning that into a long-term research dataset requires continuous collection and storage. Rather than keep that history to ourselves, we make it available so others can build on it.
We've seen the dataset used for:
- Journalism on fuel price transparency and retailer pricing behaviour
- Data science projects, dashboards and machine learning models
- Independent price comparison apps
If you build something with it, we'd love to hear about it — drop us a line at [email protected].
Our own JSON API
On top of the CSV exports, we expose a public, read-only JSON API at fuelcosts.co.uk/api. It's the same API that powers the website, and it surfaces a few things that the raw Fuel Finder feed doesn't, such as:
- Nearest-station queries by latitude and longitude
- Aggregated price trends by brand, county and region
- Per-station price history for any fuel type
- "Best day to buy" statistics
The full reference lives in our API documentation. It's free to use, requires no authentication, and has no hard rate limits — we just ask that you be reasonable and cache where you can.