Spain Fuel Prices by Station
Official pump prices at every service station in a Spanish province or municipality, from the Ministry for the Ecological Transition: price of the chosen fuel, all fuels sold, brand, address, coordinates and opening hours, cheapest first, with min, median, average and max. Optional nearby search and past dates.
GET
/api/v1/energy/es/fuel-pricesData source
- Precios de Carburantes (Geoportal de Gasolineras) REST serviceMinisterio para la Transición Ecológica y el Reto Demográfico (Spain)
Query parameters
| Parameter | Description | Try value |
|---|---|---|
provincestring | Province code, e.g. 28 for Madrid (or use municipality; codes from /energy/es/fuel-areas) | |
municipalitystring | Municipality code, e.g. 4354 for Madrid city | |
fuelstring | gasoline-95 (default diesel), gasoline-98, gasoline-95-e10, diesel, diesel-premium, diesel-b, renewable-diesel, biodiesel, lpg, cng, lng, hydrogen, adblue… | |
latnumber | Latitude (with lon) to keep stations within radiusKm | |
lonnumber | Longitude (with lat) | |
radiusKmnumber | Radius for lat/lon in km (default 10, max 100) | |
sortstring | price (default) or distance (needs lat/lon) | |
datedate | Past date YYYY-MM-DD (prices in force at 00:00); default live | |
limitnumber | Rows (default 50, max 500) | |
apikeystring required | Your API key. Can also be sent as the X-API-Key header. | demo key used here |
Response envelope
Success: { data, meta: { sources, fetchedAt, cached } }. Errors: { error: { code, message } } with HTTP 400, 401, 404, 502, 503 or 504.