Spain fuel prices API (precio de la gasolina y el gasóleo)
Spain’s Ministry for the Ecological Transition publishes prices for about 11,500 stations, refreshed roughly every 30 minutes (Geoportal Gasolineras). This API returns them as normalized JSON with radius search, brand filters and cheapest-first sorting.
What you get for Spain
- Gasolina 95 E5 →
gasoline_95; 95 E10 →gasoline_95_e10 - Gasolina 98 E5 →
gasoline_98 - Gasóleo A →
diesel; Gasóleo Premium →diesel_premium - GLP →
lpg; GNC →cng; GNL →lng(per kg) - Hidrógeno →
hydrogen; Diésel Renovable →hvo
Spanish rows include the brand (Rótulo) and an accessRestricted flag for members-only stations (cooperatives, fleets) — set excludeRestricted: true to drop them. The timestamp is the time of the national snapshot.
Example: cheapest diesel near a point
Send coordinates, a radius and a fuel type. The country is detected automatically and results come sorted cheapest first, each with distanceKm.
curl -X POST "https://api.apify.com/v2/acts/sste~official-fuel-prices/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"latitude":40.4168,"longitude":-3.7038,"radiusKm":10,"fuelTypes":["diesel"],"maxResults":20}'
Each result row looks like this (fields the government does not publish are null):
{
"country": "IT",
"city": "MILANO",
"address": "Via Giuseppe Ripamonti 567 20142",
"stationName": "IP",
"brand": "Api-Ip",
"latitude": 45.4713,
"longitude": 9.1919,
"fuelType": "gasoline_95",
"fuelName": "Benzina",
"price": 1.99,
"currency": "EUR",
"unit": "L",
"serviceType": "full",
"priceUpdatedAt": "2026-09-30T19:42:31+02:00",
"distanceKm": 0.8,
"source": "Ministero delle Imprese e del Made in Italy (MIMIT) — Osservaprezzi Carburanti",
"license": "IODL 2.0"
}
Pricing: pay per use on Apify — $0.005 per run plus $0.0005 per price row ($0.50 per 1,000). A "cheapest 10 stations near a point" query costs about $0.01. You set maxResults, so you only pay for the rows you ask for.
Questions about Spain fuel price data
How often are Spanish fuel prices updated?
The Ministry refreshes the national snapshot about every 30 minutes.
Can I compare brands such as Repsol or Cepsa?
Yes. Use the brands filter (for example ["repsol", "cepsa"]) together with a city or a radius.
What are members-only stations?
Some Spanish stations only sell to cooperative or fleet members. They are flagged with accessRestricted: true and can be excluded.
See also: API reference · Find the cheapest station near coordinates · European fuel price data sources
Datos: Ministerio para la Transición Ecológica (Geoportal Gasolineras), reutilización según la Ley 37/2007. Herramienta independiente, no afiliada.