Ir al contenido

Dónde repostar en tu ruta

POST
/v1/route/fuel
curl --request POST \
--url https://api.preciosgasolina.es/v1/route/fuel \
--header 'Content-Type: application/json' \
--data '{ "points": [ [ "example" ] ], "fuel": "gasoline_95", "corridor_km": 3, "limit": 10, "open_24h": true, "consumption": 1 }'

Envía los puntos de tu ruta en orden (polilínea [lat, lng]) y devuelve las gasolineras más baratas a menos de corridor_km, con su posición en el recorrido y el coste estimado del viaje.

Herramienta MCP equivalente: find_fuel_along_route.

Límite: 30 peticiones/min por IP (consulta pesada). Caché: sin caché.

Tipo de contenidoapplication/json
object
points
obligatorio

Puntos [lat, lng] en orden de recorrido (2–200).

Array<array>
>= 2 elementos <= 200 elementos
fuel

Carburante: gasoline_95, gasoline_98, diesel, diesel_premium, lpg, cng.

string
por defecto: gasoline_95
Valores permitidos: gasoline_95 gasoline_98 diesel diesel_premium lpg cng
corridor_km
number
por defecto: 3 > 0 <= 10
limit
integer
por defecto: 10 >= 1 <= 50
open_24h
boolean
consumption

Consumo en L/100 km (kg con GNC) para estimar el coste.

number
> 0 <= 40

Correcto: sobre { data, meta }.

Tipo de contenidoapplication/json
object
data
obligatorio
object
key
propiedades adicionales
any
meta
obligatorio
object
api_version
obligatorio
string
request_id
obligatorio
string
last_updated
obligatorio

Fecha y hora de los datos (ISO 8601).

string | null
next_update
obligatorio

Próxima actualización prevista (≈ 8:00 y 20:00, hora peninsular).

string
data_age_seconds
obligatorio
Cualquiera de:
integer
>= -9007199254740991 <= 9007199254740991
stale
obligatorio

True si la fuente no respondió y se sirve la última copia buena.

boolean
source
obligatorio
string
attribution
obligatorio

Texto que debes mostrar junto a los datos (CC BY 4.0).

string
license
obligatorio
string formato: uri
web_url
obligatorio
Cualquiera de:
string formato: uri
Ejemplogenerated
{
"data": {},
"meta": {
"api_version": "example",
"request_id": "example",
"last_updated": "example",
"next_update": "example",
"data_age_seconds": 1,
"stale": true,
"source": "example",
"attribution": "example",
"license": "https://example.com",
"web_url": "https://example.com"
}
}
RateLimit-Policy
string

Política de límites aplicada (borrador IETF).

X-Request-Id
string

Identificador de la petición.

X-Cache
string

Hit, miss o stale.

Parámetros no válidos (INVALID_PARAMETER) o desconocidos.

Tipo de contenidoapplication/problem+json
object
type
obligatorio
string formato: uri
title
obligatorio
string
status
obligatorio
integer
>= -9007199254740991 <= 9007199254740991
detail
obligatorio
string
code
obligatorio

Código estable del error (p. ej. STATION_NOT_FOUND, RATE_LIMITED).

string
request_id
obligatorio
string
instance
string
Ejemplogenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"instance": "example"
}

No encontrado (STATION_NOT_FOUND, PROVINCE_NOT_FOUND…).

Tipo de contenidoapplication/problem+json
object
type
obligatorio
string formato: uri
title
obligatorio
string
status
obligatorio
integer
>= -9007199254740991 <= 9007199254740991
detail
obligatorio
string
code
obligatorio

Código estable del error (p. ej. STATION_NOT_FOUND, RATE_LIMITED).

string
request_id
obligatorio
string
instance
string
Ejemplogenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"instance": "example"
}

Demasiadas peticiones (RATE_LIMITED). Reintenta tras Retry-After.

Tipo de contenidoapplication/problem+json
object
type
obligatorio
string formato: uri
title
obligatorio
string
status
obligatorio
integer
>= -9007199254740991 <= 9007199254740991
detail
obligatorio
string
code
obligatorio

Código estable del error (p. ej. STATION_NOT_FOUND, RATE_LIMITED).

string
request_id
obligatorio
string
instance
string
Ejemplogenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"instance": "example"
}
Retry-After
integer

No disponible temporalmente (TEMPORARILY_UNAVAILABLE). Reintenta tras Retry-After.

Tipo de contenidoapplication/problem+json
object
type
obligatorio
string formato: uri
title
obligatorio
string
status
obligatorio
integer
>= -9007199254740991 <= 9007199254740991
detail
obligatorio
string
code
obligatorio

Código estable del error (p. ej. STATION_NOT_FOUND, RATE_LIMITED).

string
request_id
obligatorio
string
instance
string
Ejemplogenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"code": "example",
"request_id": "example",
"instance": "example"
}
Retry-After
integer

Fuente de los datos: Ministerio para la Transición Ecológica y el Reto Demográfico (Geoportal de Gasolineras). Datos de la API y del servidor MCP con licencia CC BY 4.0: cita Gasolina hoy y la fuente.