UK fuel price tracker using the GOV.UK Fuel Finder API. Collects fuel prices from every petrol station in the UK and stores them in InfluxDB for Grafana dashboards and trend analysis.
- Fetches live fuel prices for all ~7,400 UK petrol stations from the GOV.UK Fuel Finder API
- Stores price data in InfluxDB with station name, brand, and region tags
- Classifies stations into configurable regions (e.g. by city/area) for comparison
- Runs on a schedule via systemd timer (every 4 hours by default)
- Data visualised in Grafana dashboards
Prices come from the GOV.UK Fuel Finder service. Under UK regulations, fuel retailers must report price changes within 30 minutes.
| Code | Fuel |
|---|---|
| E5 | Super Unleaded |
| E10 | Unleaded |
| B7_STANDARD | Diesel |
| B7_PREMIUM | Premium Diesel |
- Go to developer.fuel-finder.service.gov.uk
- Sign in with GOV.UK One Login
- Create an application as an Information Recipient
- Copy your
client_idandclient_secret
cp config.example.yaml config.yamlEdit config.yaml with your API credentials and InfluxDB connection details. Add regions with keywords to classify stations near you:
regions:
- name: "my-area"
label: "My Area"
keywords:
- "TOWN_NAME"
- "NEARBY_TOWN"python3 -m venv venv
venv/bin/pip install -r requirements.txt
venv/bin/python -m fueltrack.mainThe included deploy.sh rsyncs to a remote server and sets up systemd timer:
./deploy.shBucket: fueltrack (365-day retention)
| Measurement | Tags | Fields |
|---|---|---|
| fuel_price | station_id, station_name, brand, region, fuel_type | price_pence |
Stations are classified into regions by matching their trading name against configured keywords. Stations that don't match any region are tagged as "other" but still stored -- all data is searchable in Grafana.
The Fuel Finder API allows 30 requests per minute. A full collection run uses 15-16 requests (one per batch of 500 stations). Running every 4 hours is well within limits.
Data from the GOV.UK Fuel Finder service is available under the Open Government Licence v3.0.