# Spain Fuel Prices – Cheapest Petrol & Diesel Stations (MITECO) (`flets_sv/gasolineras-precios-espana`) Actor

Cheapest petrol and diesel stations in Spain from the official MITECO feed: price per litre, address, hours, distance and savings per tank. Updated daily.

- **URL**: https://apify.com/flets_sv/gasolineras-precios-espana.md
- **Developed by:** [FlEtsv](https://apify.com/flets_sv) (community)
- **Categories:** Automation, Travel
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 station price returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Spain Fuel Prices – Cheapest Petrol & Diesel Stations (MITECO)

Find the cheapest petrol, diesel and LPG stations in Spain from the official MITECO price feed, ranked by price, with address, opening hours, distance and savings per 50-litre tank. *Versión en español más abajo.*

***

### Use cases

- Transport and delivery fleets: cheapest diesel by province every morning
- Price comparison sites and apps: fresh fuel data through one API call
- Consumers: alert when a station in your town drops below your price
- Analysts: price trends by province, brand and fuel type

### English

#### What does it do?

The Actor downloads the Spanish Ministry (MITECO) feed of fuel station prices, filters by province, town or radius around your coordinates, and ranks the stations by the price of the fuel you choose. Each result includes the brand, price per litre, estimated saving against the average of the selection for a 50-litre tank, full address, opening hours, a 24-hour flag, coordinates, distance, all the fuel prices of the station and a map link.

#### Input

- `provincia`: name or INE code, or `todas` for all of Spain (default Madrid).
- `municipio`: optional town filter.
- `combustible`: diesel, premium diesel, gasoline 95/98, LPG, CNG, LNG or AdBlue.
- `latitud`, `longitud`, `radioKm`: filter by distance from a point.
- `solo24h`, `maxItems`.

The default input already works: press **Start** and you get results in seconds.

Example:

```json
{"provincia":"Madrid","combustible":"gasoleoA","maxItems":10}
```

#### Output

One record per result with: `posicion`, `rotulo`, `combustible`, `precioEurLitro`, `ahorroDepositoEur`, `direccion`, `codigoPostal`, `municipio`, `provincia`, `horario`, `abierto24h`, `latitud`, `longitud`, `distanciaKm`, `precios`, `fechaDatos`, `urlMapa`.

#### Pricing (pay per event)

| Event | Price | Per 1,000 |
|---|---|---|
| Station returned (`station-price`) | $0.001 | $1.00 |

You only pay for results returned. Set a maximum spend per run and the Actor stops when the limit is reached, keeping what it saved. The Apify FREE plan includes monthly credit to try it.

#### Integrations (Make, Zapier, Google Sheets)

- **Make**: add the Apify module "Run an Actor" (Actor `Flets_sv/gasolineras-precios-espana`), paste the input JSON, chain "Get Dataset Items" and map the fields to Google Sheets, Slack, Airtable or your CRM.
- **Zapier**: the Apify app offers "Run Actor" and "Fetch Dataset Items". Add a Schedule trigger and send each row to Gmail, Slack or Notion.
- **Google Sheets**: enable the official Google Sheets integration in the Actor's Integrations tab to append every run to a sheet, or call `https://api.apify.com/v2/acts/Flets_sv~gasolineras-precios-espana/run-sync-get-dataset-items?format=csv` with POST and your input from Apps Script (`UrlFetchApp`).
- **API and webhooks**: start the Actor from the REST API, use Schedules for recurring runs and add a webhook to notify your system when a run finishes.

Input to paste into Make or Zapier:

```json
{"provincia":"Madrid","combustible":"gasoleoA","maxItems":10}
```

#### FAQ

**How fresh is the data?** The ministry updates prices during the day; `fechaDatos` shows the timestamp of the feed.

**Does it cover the Canary Islands?** Yes. Use provincia Las Palmas or Santa Cruz de Tenerife.

**Is it free to reuse?** The feed is open data from the Spanish government.

***

### Español

#### ¿Qué hace?

El Actor descarga el listado oficial de precios de carburantes del Ministerio (MITECO), filtra por provincia, municipio o radio desde tus coordenadas y ordena las gasolineras por el precio del combustible elegido, con dirección, horario, distancia y ahorro estimado por depósito de 50 litros.

#### Input

Por defecto devuelve las 10 gasolineras con el gasóleo A más barato de Madrid en unos 3 segundos. Usa los mismos campos que la sección inglesa.

#### Output

Un registro por resultado con los campos de la sección inglesa.

#### Precios (pago por evento)

Station returned (`station-price`): $0.001 ($1.00 por cada 1.000). Solo pagas por los resultados devueltos y puedes fijar un gasto máximo por ejecución.

#### Integraciones (Make, Zapier, Google Sheets)

- **Make**: añade el módulo de Apify «Run an Actor» (Actor `Flets_sv/gasolineras-precios-espana`), pega el input JSON y encadena «Get Dataset Items»; después mapea los campos a Google Sheets, Slack, Airtable o tu CRM.
- **Zapier**: la app de Apify ofrece «Run Actor» y «Fetch Dataset Items». Ponle un disparador de horario y envía cada fila a Gmail, Slack o Notion.
- **Google Sheets**: en la pestaña Integrations del Actor activa la integración oficial con Google Sheets para añadir cada ejecución a una hoja, o llama desde Apps Script (`UrlFetchApp`) a `https://api.apify.com/v2/acts/Flets_sv~gasolineras-precios-espana/run-sync-get-dataset-items?format=csv` con POST y tu input.
- **API y webhooks**: lanza el Actor por API REST, programa ejecuciones (Schedules) y avisa a tu sistema con un webhook al terminar.

Ejemplo de input para pegar en Make o Zapier:

```json
{"provincia":"Madrid","combustible":"gasoleoA","maxItems":10}
```

#### Preguntas frecuentes

**¿Puedo ver la más barata cerca de mí?** Sí: indica `latitud`, `longitud` y `radioKm`.

**¿Sirve para flotas?** Sí, programa una ejecución diaria por provincia y envíala a una hoja.

### Ejemplos de uso / Usage examples

#### Example output (real run, 2026-11-05)

First rows returned by a real run of this Actor on 2026-11-05 (shortened columns, values truncated):

| posicion | rotulo | precioEurLitro | municipio | provincia | horario | urlMapa |
|---|---|---|---|---|---|---|
| 1 | PETROPRIX | 1.709 | Leganés | MADRID | L-D: 24H | https://www.google.com/maps?q=40.314889,-3.760694 |
| 2 | PLENERGY | 1.709 | Leganés | MADRID | L-D: 24H | https://www.google.com/maps?q=40.323444,-3.751389 |
| 3 | FAMILY ENERGY | 1.709 | Leganés | MADRID | L-D: 24H | https://www.google.com/maps?q=40.319472,-3.744306 |

#### Copy-paste inputs

**1. Cheapest diesel in Madrid**

```json
{
  "provincia": "Madrid",
  "combustible": "gasoleoA",
  "maxItems": 10
}
```

**2. Petrol 95 within 10 km of a point, open 24h**

```json
{
  "latitud": 41.3874,
  "longitud": 2.1686,
  "radioKm": 10,
  "combustible": "gasolina95E5",
  "solo24h": true,
  "maxItems": 10
}
```

#### Call it from your code (Apify API)

```bash
curl -X POST "https://api.apify.com/v2/acts/Flets_sv~gasolineras-precios-espana/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"provincia": "Madrid", "combustible": "gasoleoA", "maxItems": 10}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("Flets_sv/gasolineras-precios-espana").call(run_input={"provincia": "Madrid", "combustible": "gasoleoA", "maxItems": 10})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

No code? Use the Apify modules for **Make** and **Zapier** (run the Actor, then fetch dataset items), or the **Google Sheets** integration in the Actor's Integrations tab to append each run to a sheet.

# Actor input Schema

## `provincia` (type: `string`):

Spanish province name (Madrid, Barcelona, Sevilla...) or INE code. Write "todas" for the whole country.

## `municipio` (type: `string`):

Only stations whose town contains this text, e.g. "Alcobendas". Leave empty for the whole province.

## `combustible` (type: `string`):

Fuel used to rank the stations.

## `latitud` (type: `number`):

With latitude, longitude and radius you get the distance to each station and can filter by radius.

## `longitud` (type: `number`):

Longitude of your location, e.g. -3.7038 for Madrid centre.

## `radioKm` (type: `integer`):

Only stations within this distance of your coordinates.

## `solo24h` (type: `boolean`):

Keep only stations open 24 hours.

## `maxItems` (type: `integer`):

Number of cheapest stations to return. It also caps your spend.

## Actor input object example

```json
{
  "provincia": "Madrid",
  "municipio": "",
  "combustible": "gasoleoA",
  "latitud": null,
  "longitud": null,
  "radioKm": 0,
  "solo24h": false,
  "maxItems": 10
}
```

# Actor output Schema

## `resultados` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "provincia": "Madrid",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("flets_sv/gasolineras-precios-espana").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "provincia": "Madrid",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("flets_sv/gasolineras-precios-espana").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "provincia": "Madrid",
  "maxItems": 10
}' |
apify call flets_sv/gasolineras-precios-espana --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,flets_sv/gasolineras-precios-espana"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ulr7qSeSDz5Xzu4Xl/builds/buwSiUMkLBrRpuHHc/openapi.json
