# Fuel Prices Spain & France - Station Diesel & Petrol Prices (`gazidev/fuel-prices-europe`) Actor

Station-level diesel, petrol 95/98, E10, E85 and LPG prices from the official open government feeds of Spain and France (~21,000 stations). Filter by province, department, postcode, radius or fuel; cheapest-N ranking and price-change monitoring. From $0.30 per 1,000 stations.

- **URL**: https://apify.com/gazidev/fuel-prices-europe.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 1,000 station prices

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

## Fuel Prices Spain & France – Station Diesel & Petrol Prices API

Get **station-level fuel prices for Spain and France** – diesel, petrol 95 (E5), E10, petrol 98, E85 superethanol, LPG/autogas and (Spain) CNG, LNG, hydrogen, AdBlue and renewable fuels – straight from the **official open government feeds**. About **21,000 petrol stations** with address, postcode, GPS coordinates, opening hours and brand (Spain), refreshed every 30 minutes (Spain) or in near real time (France).

Filter by **province, department, postcode, radius around a point or fuel type**, get the **cheapest N stations**, or run it on a schedule in **monitor mode** to receive only the stations whose prices changed.

### What it does

- Reads the Spanish Ministry for the Ecological Transition price service (Geoportal de Gasolineras) and the French *Prix des carburants – flux instantané v2* (prix-carburants.gouv.fr).
- Normalises both into one schema: `prices.diesel`, `prices.petrol95`, `prices.e10`, `prices.petrol98`, `prices.e85`, `prices.lpg`, … in EUR per litre.
- Area filters: Spanish provinces (`Madrid`, `Barcelona`, `28`), French departments (`75`, `13`, `2A`), postcode prefixes for both countries.
- Radius search: latitude + longitude + km, sorted by distance, with `distanceKm` on every row.
- Cheapest-N: the N cheapest stations per country for a chosen fuel, with `rank`.
- Monitor mode: keeps a price snapshot between runs and outputs only changed stations with old price, new price and delta.
- Every row carries `source`, `licence`, `licenceUrl` and `attribution` fields so you can meet the open-data licence terms.

### Use cases

- Fleet and logistics fuel cost planning (Spain, France, cross-border Pyrenees routes)
- Price comparison apps, maps and chatbots ("cheapest diesel near me")
- Market research on retail fuel margins, brands and regional price spreads
- Price-change alerts for a list of postcodes, scheduled hourly
- Feeding fuel prices to AI agents and dashboards

### Input example

```json
{
  "countries": ["ES", "FR"],
  "spainProvinces": ["Madrid"],
  "franceDepartments": ["75"],
  "fuelTypes": ["diesel", "petrol95", "e10"],
  "cheapestN": 25,
  "maxStations": 200
}
```

Radius search around Irun / Hendaye (cross-border), 10 cheapest diesel stations per country:

```json
{ "countries": ["ES", "FR"], "latitude": "43.3", "longitude": "-1.75", "radiusKm": 40, "fuelTypes": ["diesel"], "cheapestN": 10 }
```

Leave every area filter empty to get the whole country (Spain ~11,400 stations, France ~9,200 with prices).

### Output example

```json
{
  "country": "ES",
  "countryName": "Spain",
  "stationId": "11445",
  "brand": "SHELL",
  "address": "CALLE SANTO DOMINGO, 10",
  "postcode": "28000",
  "city": "MADRID",
  "province": "MADRID",
  "latitude": 40.508056,
  "longitude": -3.679083,
  "priceDiesel": 1.959,
  "pricePetrol95": 1.829,
  "prices": { "diesel": 1.959, "petrol95": 1.829 },
  "currency": "EUR",
  "priceUnit": "EUR per litre",
  "openingHours": "L-D: 24H",
  "open24h": true,
  "dataTimestamp": "2026-11-03T13:09:30 Europe/Madrid",
  "source": "Ministerio para la Transicion Ecologica y el Reto Demografico - Geoportal de Gasolineras (precios de carburantes)",
  "licence": "Spanish public-sector information reuse conditions (Ley 37/2007, RD 1495/2011): commercial and non-commercial reuse allowed with attribution",
  "licenceUrl": "https://datos.gob.es/es/aviso-legal",
  "attribution": "Fuente: Ministerio para la Transicion Ecologica y el Reto Demografico"
}
```

French rows add `department`, `highway` (motorway station), `services` and per-fuel `pricesUpdatedAt`. French open data does not include brand names. Monitor rows add `changeType` (`price-change` / `new-station`), `priceChanges` (`fuel`, `oldPrice`, `newPrice`, `change`) and `previousPrices`.

### Fuel keys

| Key | Spain | France |
|---|---|---|
| `diesel` | Gasóleo A | Gazole |
| `petrol95` | Gasolina 95 E5 | SP95 |
| `e10` | Gasolina 95 E10 | E10 (SP95-E10) |
| `petrol98` | Gasolina 98 E5 | SP98 |
| `e85` | Gasolina 95 E85 | E85 |
| `lpg` | GLP | GPLc |
| `dieselPremium`, `dieselB`, `dieselRenewable`, `biodiesel`, `petrol95Premium`, `e25`, `petrol98E10`, `petrolRenewable`, `bioethanol`, `cng`, `lng`, `bioCng`, `bioLng`, `hydrogen`, `adblue`, `methanol`, `ammonia` | Spain only | – |

Gas fuels and hydrogen are priced per kg.

### Pricing

Pay per event – you only pay for stations delivered:

| Event | Price |
|---|---|
| Station with prices | $0.0003 (= $0.30 per 1,000 stations) |
| Station price change (monitor mode, after the first run) | $0.0005 |
| Actor start | $0.00005 |

The whole of Spain and France (~20,700 stations) costs about $6.20 and takes ~30 seconds. Set **Max stations** or a max total charge to cap spend; the Actor stops cleanly at the limit.

| Actor | Coverage | Price per result |
|---|---|---|
| **This Actor** | Spain + France, official open data | **$0.0003** |
| GasBuddy scrapers on the Store | USA/Canada (crowd-sourced) | $0.001 – $0.00135 |

### FAQ

**Is this legal to use commercially?** Yes. Spain's data is published for reuse under the datos.gob.es general conditions ("reutilización … para fines comerciales y no comerciales") and France's flow is under Licence Ouverte v2.0 (Etalab). Both require attribution – keep the `attribution` field (or the source name) visible in your product.

**How fresh is the data?** Spain refreshes every 30 minutes (`dataTimestamp` is the ministry file time). French stations report each price change; `pricesUpdatedAt` shows when each price was last updated.

**Why is a radius search slower?** The radius mode downloads the full Spanish national file (~12 MB, 30–70 s). For speed, use provinces or postcodes, optionally combined with the radius.

**Italy, Portugal, Austria, Germany?** Not yet – only feeds whose reuse terms we have verified are included.

**How do I get alerts?** Turn on *Monitor price changes*, give the monitor a name, and schedule the Actor (e.g. hourly). Combine with Apify integrations (Slack, email, webhooks).

### Use with AI agents / Apify MCP

Add this Actor to Claude, ChatGPT or any MCP client through the [Apify MCP server](https://mcp.apify.com) (`gazidev/fuel-prices-europe`). Agents can ask for "the 10 cheapest diesel stations within 15 km of Valencia" by passing `latitude`, `longitude`, `radiusKm`, `fuelTypes: ["diesel"]` and `cheapestN: 10`. Small, typed JSON rows keep token use low.

***

Data sources: Ministerio para la Transición Ecológica y el Reto Demográfico (Spain); Ministère de l'Économie – prix-carburants.gouv.fr, Licence Ouverte v2.0 (France). This Actor is not affiliated with either government.

# Actor input Schema

## `countries` (type: `array`):

Which official feeds to read. ES = Spain (~11,400 stations, updated every 30 min), FR = France (~9,800 stations, near real time).

## `spainProvinces` (type: `array`):

Spanish province names or 2-digit INE codes, e.g. `Madrid`, `Barcelona`, `Valencia`, `28`. Leave all area filters empty for the whole country.

## `franceDepartments` (type: `array`):

French department numbers, e.g. `75` (Paris), `13`, `69`, `2A`, `974`.

## `postcodes` (type: `array`):

Postcodes or prefixes for either country, e.g. `28013`, `0800`, `75015`, `69`. A station is kept if it matches any province, department or postcode above.

## `latitude` (type: `string`):

Centre point latitude (WGS84), e.g. `40.4168`. Used together with longitude and radius. Can be combined with the area filters.

## `longitude` (type: `string`):

Centre point longitude, e.g. `-3.7038`.

## `radiusKm` (type: `integer`):

Keep stations within this many km of the centre point; results are sorted by distance. 0 = off.

## `fuelTypes` (type: `array`):

Only return these fuels (stations without any of them are dropped). Empty = all fuels the station sells. France publishes diesel, petrol95, e10, petrol98, e85 and lpg.

## `cheapestN` (type: `integer`):

If > 0, return only the N cheapest stations per country for the ranking fuel (with rank 1..N). 0 = all matching stations.

## `cheapestFuel` (type: `string`):

Fuel used for the cheapest-N ranking. Default: the first selected fuel type, or diesel.

## `monitorPriceChanges` (type: `boolean`):

Keeps a snapshot of prices between runs (named key-value store). First run = baseline (all matching stations). Later runs return only stations whose prices changed, with old price, new price and delta. Schedule the Actor (e.g. hourly) for alerts.

## `stateKey` (type: `string`):

Use a different name for each monitor (each keeps its own snapshot).

## `includeRestrictedStations` (type: `boolean`):

Spanish cooperatives / fleet stations that do not sell to the general public (Tipo Venta R).

## `maxStations` (type: `integer`):

Upper limit of stations saved per run (each saved station is one charged event). 0 = no limit.

## Actor input object example

```json
{
  "countries": [
    "ES",
    "FR"
  ],
  "spainProvinces": [
    "Madrid"
  ],
  "franceDepartments": [
    "75"
  ],
  "fuelTypes": [
    "diesel",
    "petrol95",
    "e10"
  ],
  "cheapestN": 25,
  "monitorPriceChanges": false,
  "stateKey": "default",
  "includeRestrictedStations": false,
  "maxStations": 200
}
```

# Actor output Schema

## `stations` (type: `string`):

No description

## `results` (type: `string`):

No description

## `summary` (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 = {
    "countries": [
        "ES",
        "FR"
    ],
    "spainProvinces": [
        "Madrid"
    ],
    "franceDepartments": [
        "75"
    ],
    "fuelTypes": [
        "diesel",
        "petrol95",
        "e10"
    ],
    "cheapestN": 25,
    "maxStations": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/fuel-prices-europe").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 = {
    "countries": [
        "ES",
        "FR",
    ],
    "spainProvinces": ["Madrid"],
    "franceDepartments": ["75"],
    "fuelTypes": [
        "diesel",
        "petrol95",
        "e10",
    ],
    "cheapestN": 25,
    "maxStations": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("gazidev/fuel-prices-europe").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 '{
  "countries": [
    "ES",
    "FR"
  ],
  "spainProvinces": [
    "Madrid"
  ],
  "franceDepartments": [
    "75"
  ],
  "fuelTypes": [
    "diesel",
    "petrol95",
    "e10"
  ],
  "cheapestN": 25,
  "maxStations": 200
}' |
apify call gazidev/fuel-prices-europe --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gazidev/fuel-prices-europe"
        }
    }
}
```

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/UiSsmpAbiZVMuwyJO/builds/UnkAuxXf7DEPCjYyR/openapi.json
