Live tool on this site
UK Fuel Finder
A free tool on this site that finds petrol and diesel prices near a postcode or your location, using the UK Government’s official Fuel Finder data.
How it fits together
- Source
- GOV.UK Fuel Finder API
- API
- Azure Functions
- In-memory national cache
- Search
- Postcode lookup
- Distance filter
- Visitors
- Fuel Finder page
- Map and list
The challenge
The UK Government’s Fuel Finder service publishes forecourt prices, but its API has no “near me” search: it hands out the whole country in batches, with strict limits on how fast it can be called. The goal was a quick, simple search for drivers that respects those limits, keeps prices current and is honest about how old each price is.
What was built
- A search by postcode or current location, with a choice of fuel and search radius, sorted by cheapest or nearest.
- An Azure Functions API that loads the national forecourt and price data, keeps it current with incremental updates at the intervals the data’s guidance asks for, and answers each search from memory.
- Result cards showing the price, how long ago it was reported, the distance, opening hours (including 24-hour sites), facilities and directions.
- Older prices listed separately, so a price nobody has updated for a week is never ranked as the cheapest.
- A map of the results using Leaflet and OpenStreetMap, kept in step with the list.
- A labelled demo mode, so the tool can be developed and tested without live credentials.
Technical highlights
- 01
Working within the data’s limits
The upstream API only offers the whole country in batches, so the back end fetches it politely, caches it, refreshes it incrementally and keeps serving the last good data if a refresh fails.
- 02
Honest about freshness
Every price shows when the forecourt last reported it, implausible prices are dropped rather than shown, and distances are labelled as straight-line rather than driving distance.
- 03
Private by design
The browser only talks to this site’s own API, credentials stay on the server, and a visitor’s location is used for their search and not stored.
What it demonstrates
Integrating a government API with OAuth, batching and rate limits Serverless APIs on Azure Functions with in-memory caching Search by postcode and browser geolocation Clear, accessible results on phones and desktops
Start with a conversation
Have something similar in mind?
Real-time data, unusual interfaces, integrations or automation: if it’s a problem software can solve, let’s talk about it.
No technical knowledge needed. No obligation.