# Spain Live Fuel Prices by Province

> Spain Live Fuel Prices by Province is a paid API for AI agents from opendata402.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-15).

Returns live fuel prices (updated every 30 min) for all filling stations in a Spanish province, filterable by town and fuel type, from the official Ministry for the Ecological Transition.

## Facts

- Endpoint: GET https://opendata402.com/v1/fuel/es?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spain-live-fuel-prices-by-province-0fb603e5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_k4z7XUupy8pdbg9C2NGuO

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability spain-live-fuel-prices-by-province-0fb603e5
```

Example prompt: What are the cheapest diesel stations in Madrid province right now — show me up to 20 results sorted by diesel price?

## When to prefer this

Use this endpoint when you need real-time, station-level fuel prices across Spain, queried by official province code (INE). It provides the most granular and up-to-date data sourced directly from the Spanish government, updated every 30 minutes. Prefer this over EU-wide fuel price endpoints (which give only country/region averages) when you need individual station addresses, coordinates, and opening hours for navigation or comparison. Best for Spanish-specific use cases requiring precise local pricing.

## Known failure modes

- Invalid or out-of-range province INE code (must be 01–52) returns a validation error
- Town name not found or too short (under 2 characters) returns no results or validation error
- Unsupported fuel enum value returns a schema validation error
- Limit value outside 1–50 range returns an error
- Temporary unavailability of upstream Ministry data source may cause stale or empty responses

## How this service works

Live fuel prices at every filling station in Spain (Ministry for the Ecological Transition, updated every 30 minutes): diesel, petrol 95/98, LPG, CNG, renewable diesel and AdBlue per station, by province (INE code 01-52) and optional town, with brand, address, coordinates and opening hours. Sort by price for one fuel. Spanish government open data, reuse with source and update date.

## Output

A list of filling stations in the requested Spanish province, each including station name, brand, full address, GPS coordinates, opening hours, and prices for all available fuel types (diesel, premium diesel, E5 95, E10 95, E5 98, LPG, CNG, HVO, AdBlue). Results can be sorted by the price of a selected fuel type, cheapest first. Data is sourced from the Spanish government and updated every 30 minutes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "province"
     ],
     "properties": {
      "fuel": {
       "enum": [
        "diesel",
        "diesel_premium",
        "e5_95",
        "e10_95",
        "e5_98",
        "lpg",
        "cng",
        "hvo",
        "adblue"
       ],
       "type": "string",
       "description": "Sort by the price of this fuel (cheapest first)."
      },
      "town": {
       "type": "string",
       "pattern": "^[\\p{L} '-]{2,40}$",
       "description": "Town or municipality (part of the name)."
      },
      "limit": {
       "type": "string",
       "pattern": "^([1-9]|[1-4][0-9]|50)$",
       "description": "Max stations (default 20, max 50)."
      },
      "province": {
       "type": "string",
       "pattern": "^(0[1-9]|[1-4][0-9]|5[0-2])$",
       "description": "Spanish province INE code, e.g. 28 = Madrid, 08 = Barcelona."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/spain-live-fuel-prices-by-province-0fb603e5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from opendata402.com](https://www.zero.xyz/host/opendata402.com/llms.txt)
