BYTETOOLS

Spanish Fuel Prices (MINETUR) API

Free official Spanish fuel price API with no key: current prices for every fuel at every filling station in Spain, filterable by town or province. Tested example included.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the Spanish Fuel Prices (MINETUR) API?

The Spanish Ministry for Ecological Transition publishes a free, key-free API listing current fuel prices at every filling station in Spain. Each record carries the station's brand, address, coordinates, opening hours and the price of every fuel it sells, updated through the day.

Spanish filling stations are legally required to report their prices to the ministry, which means this is not a crowdsourced approximation but the official register — the same data behind the government's own price comparison site. Coverage is complete, including motorway services, supermarket forecourts and independent stations.

Working with it requires accepting Spanish conventions throughout. Field names are Spanish and several contain spaces, dots or accents — `"C.P."`, `"Dirección"`, `"Longitud (WGS84)"` — so bracket notation is mandatory in most languages. Prices and coordinates use a comma as the decimal separator, so `"1,739"` is one euro seventy-four and must be converted before arithmetic. An empty string means the station does not sell that fuel, which is not the same as a price of zero. The response also carries a UTF-8 byte order mark that trips some strict JSON parsers.

Quick facts

Base URL
https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes
Authentication
No API key or account. Official Spanish government open data.
Rate limit
No published quota. Prices are revised through the day but not by the minute; hourly polling is more than sufficient.
Pricing
Free.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the Spanish Fuel Prices (MINETUR) API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. Fetch current fuel prices for every station in a town

GET https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/EstacionesTerrestres/FiltroMunicipio/4281

curl
curl 'https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/EstacionesTerrestres/FiltroMunicipio/4281'
JavaScript (fetch)
const res = await fetch("https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/EstacionesTerrestres/FiltroMunicipio/4281");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/EstacionesTerrestres/FiltroMunicipio/4281", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "Fecha": "21/08/2026 10:01:21",
  "ListaEESSPrecio": [
    {
      "C.P.": "28100",
      "Dirección": "AVENIDA VALDELAPARRA, 3",
      "Horario": "L-D: 24H",
      "Latitud": "40,537306",
      "Localidad": "ALCOBENDAS",
      "Longitud (WGS84)": "-3,644250",
      "Margen": "N",
      "Municipio": "Alcobendas",
      "Precio Adblue": "",
      "Precio Amoniaco": "",
      "Precio Biodiesel": "",
      "Precio Bioetanol": "",
      "Precio Biogas Natural Comprimido": "",
      "Precio Biogas Natural Licuado": "",
      "Precio Diésel Renovable": "",
      "Precio Gas Natural Comprimido": "",
      "Precio Gas Natural Licuado": "",
      "Precio Gases licuados del petróleo": "",
      "Precio Gasoleo A": "1,739",
      "Precio Gasoleo B": "",
      "Precio Gasoleo Premium": "1,759",
      "Precio Gasolina 95 E10": "",
      "Precio Gasolina 95 E25": "",
      "Precio Gasolina 95 E5": "1,649",
      "Precio Gasolina 95 E5 Premium": "1,669",
      "Precio Gasolina 95 E85": "",
      "Precio Gasolina 98 E10": "",
      "Precio Gasolina 98 E5": "",
      "Precio Gasolina Renovable": "",
      "Precio Hidrogeno": "",
      "Precio Metanol": "",
      "Provincia": "MADRID",
      "Remisión": "OM",
      "Rótulo": "BALLENOIL",
      "Tipo Venta": "P",
      "% BioEtanol": "0,0",
      "% Éster metílico": "0,0",
      "IDEESS": "15991",
      "IDMunicipio": "4281",
      "IDProvincia": "28",
      "IDCCAA": "13"
    },
    {
      "C.P.": "28100",
      "Dirección": "CALLE VALGRANDE, 30",
      "Horario": "L-D: 24H",
      "Latitud": "40,539583",
      "Localidad": "ALCOBENDAS"

Parameters

ParameterTypeRequiredDescription
FiltroMunicipiopathOptional`/EstacionesTerrestres/FiltroMunicipio/{id}` returns stations in one municipality. 4281
FiltroProvinciapathOptionalThe same filter at province level. Response sizes get large. 28
(all stations)pathOptional`/EstacionesTerrestres/` returns the entire country — several megabytes.
(municipality list)pathOptional`/Listados/MunicipiosPorProvincia/{provinceId}` gives the municipality ids the filter needs. 28
(province list)pathOptional`/Listados/Provincias/` lists provinces with their ids. Provincias
(product filter)pathOptionalProduct-specific paths return one fuel type across stations.

Response fields

Fechastring
When the price list was generated, as `DD/MM/YYYY HH:MM:SS` Spanish local time.
ListaEESSPrecioarray
The stations. EESS is the Spanish abbreviation for filling station.
Rótulostring
Brand or sign on the forecourt — Repsol, Cepsa, BALLENOIL and so on.
Dirección / Municipio / Provincia / "C.P."string
Street address, municipality, province and postcode. Note the dots in the postcode key.
Latitud / "Longitud (WGS84)"string
Coordinates with a comma decimal separator. Convert before use — "40,537306" is 40.537306.
Horariostring
Opening hours in Spanish shorthand: "L-D: 24H" means Monday to Sunday, around the clock.
Precio Gasolina 95 E5 / Precio Gasoleo Astring
Prices in euros per litre with a comma decimal. Empty string means the fuel is not sold here.
Precio Gasoleo Premium / Gasolina 98 E5 / Hidrogeno / Biodieselstring
The full product range, including hydrogen and biofuels where offered.
IDEESS / IDMunicipio / IDProvincia / IDCCAAstring
Station, municipality, province and autonomous community identifiers.
Margenstring
Which side of the road the station is on: `D` right, `I` left, `N` not applicable.

What you can build with the Spanish Fuel Prices (MINETUR) API

  • Show the cheapest fuel near a town or along a route
  • Track diesel and petrol price movements over time
  • Compare brand pricing across provinces
  • Map filling stations with their opening hours
  • Find stations selling LPG, CNG or hydrogen

Common errors and how to fix them

Prices sort or compare incorrectly

Prices are strings using a comma decimal separator.

Fix: Replace the comma with a full stop and cast to a number. "1,739" parsed naively becomes 1 or fails outright.

A price is an empty string

The station does not sell that fuel.

Fix: Treat empty as absent, never as zero. A zero-price station will win every cheapest-fuel query you run.

JSON parser rejects the response

The body begins with a UTF-8 byte order mark.

Fix: Decode as `utf-8-sig`, or strip the BOM before parsing. Strict parsers fail on the very first character.

Empty ListaEESSPrecio

The municipality has no filling stations, or the id is wrong.

Fix: Small villages genuinely have none. Confirm the id against `/Listados/MunicipiosPorProvincia/{province}` before assuming a fault.

Spanish Fuel Prices (MINETUR) API — frequently asked questions

Is the Spanish fuel price API free?

Yes, free with no key or account. It is official Spanish government open data, published because filling stations are legally required to report their prices.

How often do prices update?

Through the day as stations report changes. The `Fecha` field gives the moment the list was generated, and hourly polling is more than enough to stay current.

Why will the prices not parse as numbers?

Because they use Spanish formatting, with a comma as the decimal separator. "1,739" is one euro and 73.9 cents. Replace the comma before casting, and do the same for the coordinates.

Can I filter to one town rather than the whole country?

Yes, and you should — the national response runs to several megabytes. Use `/EstacionesTerrestres/FiltroMunicipio/{id}`, taking the id from the municipality listing endpoint.

Tools that pair with this API

Spanish Fuel Prices (MINETUR) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.