# EU Fuel Prices: station level, one schema (France, Spain) (`saksham1341/eu-fuel-prices`) Actor

Station-level fuel prices from official open data for France and Spain in one schema: brand, address, coordinates, fuel type, price per litre, update time. Search by radius, city or postcode, get the cheapest N, or only prices that changed since the last run.

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

## Pricing

$0.50 / 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

## EU Fuel Prices: station level, one schema (France, Spain)

Pump prices for **every filling station in France and Spain**, from each government's official open data, in **one schema**: brand, address, coordinates, normalised fuel type, price, and when the price was last updated. Search by radius, city or postcode, keep only the **N cheapest** per fuel, or run on a schedule in **changes mode** to get only the prices that moved since the last run, with the previous price and the delta.

Built for fleet operators (where to fill up along a depot's area), mobility and navigation apps (a price layer without maintaining two national feeds), and price analysts (daily change feeds per brand, region and fuel).

### Sources

| Country | Source | Refresh | Stations |
|---|---|---|---|
| FR | prix-carburants.gouv.fr instant feed (Ministère de l'Économie) | about every 10 min | ~9,800 |
| ES | Ministerio para la Transición Ecológica, geoportalgasolineras.es REST service | every 30 min | ~12,000 |

No API keys, no logins. The Actor reads the official files the ministries publish for reuse.

**Not included, and why:** Austria (E-Control's Spritpreisrechner FAQ says its data may not be used by third-party apps, websites or analyses), Italy (the MIMIT open-data CSVs did not answer when this Actor was built), Germany (Tankerkönig needs a personal API key; may come later as a bring-your-own-key option).

### Output

One item per station and fuel:

```json
{
  "country": "ES",
  "stationId": "10943",
  "brand": "CEPSA",
  "name": null,
  "address": "PASEO MORET, 7",
  "city": "MADRID",
  "postcode": "28008",
  "lat": 40.432861,
  "lon": -3.724194,
  "fuelType": "diesel",
  "fuelLabel": "Gasoleo A",
  "priceEur": 1.969,
  "unit": "l",
  "priceUpdatedAt": "2026-11-09T16:31:08Z",
  "source": "Ministerio para la Transición Ecológica y el Reto Demográfico, geoportalgasolineras.es",
  "sourceUrl": "https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/EstacionesTerrestres/",
  "distanceKm": 2.484,
  "changeType": null,
  "previousPrice": null,
  "delta": null
}
```

| Field | Meaning |
|---|---|
| `fuelType` | normalised: `diesel`, `diesel-premium`, `hvo` (renewable diesel), `e5` (95 octane E5, French SP95), `e5-premium`, `e10`, `98`, `e85`, `lpg`, `cng`, `lng`, `hydrogen`, `other` (e.g. AdBlue, renewable petrol) |
| `fuelLabel` | the source's own label (`Gazole`, `SP98`, `Gasoleo A`, `Gasolina 95 E5` ...) |
| `priceEur`, `unit` | euros per litre (`l`), or per kilogram (`kg`) for CNG, LNG, hydrogen and biogas |
| `priceUpdatedAt` | UTC. France: when the station last changed that price. Spain: when the ministry published the snapshot (Spain gives no per-price time) |
| `distanceKm` | distance from your search point, when you search by radius |
| `changeType`, `previousPrice`, `delta` | changes mode only: `changed` (with the old price and the difference) or `new` (a price not seen in the last run) |

### Input

```json
{
  "countries": ["FR", "ES"],
  "fuelTypes": ["diesel", "e10"],
  "latitude": 48.8566,
  "longitude": 2.3522,
  "radiusKm": 5,
  "cities": [],
  "postcodes": [],
  "cheapestN": 10,
  "maxPriceAgeDays": 3,
  "changesOnly": false,
  "stateKey": "eu-fuel-prices-state"
}
```

- **Area**: `latitude` + `longitude` + `radiusKm` (default 5 km), and/or `cities` (case and accents ignored; `Paris` also matches `PARIS 15E`), and/or `postcodes` (prefixes: `75` is all of Paris, `28` all of Madrid province). All filters combine with AND.
- **`cheapestN`**: the N cheapest prices per country and fuel type inside the area.
- **`maxPriceAgeDays`**: drop prices not updated for that long. Useful with `cheapestN`, since a station that stopped reporting can keep an old low price.
- **Changes mode**: set `changesOnly: true` and schedule the Actor. The first run saves a baseline of the countries' prices in a key-value store named `stateKey` **in your account** and returns nothing; every later run returns only prices that changed or appeared since. Use separate `stateKey`s for separate watch lists.

### Pricing

**$0.0005 per station price returned** (event "Station price returned"), $0.50 per 1,000. Examples: all diesel and E10 prices within 5 km of central Paris, about 50 items, $0.025; the 10 cheapest diesel prices around Madrid, $0.005; a daily changes feed for Paris and Madrid, typically a few hundred items. Every price in both countries is about 73,000 items ($37). Countries whose source fails are not charged. A maximum charge per run is respected.

### Limits and honest caveats

- **France has no station names or brands** in the official open data; `brand` and `name` are `null` there. Spain gives the brand (`Rótulo`) but no separate name.
- **Spain's update time is the snapshot time**, not the moment the station changed its price.
- A radius or city query in Spain downloads the national file (about 12 MB, around 30 s). A postcode-only query downloads just the provinces it needs.
- Changes mode reports changed and new prices, not stations that disappeared. A price is "new" when the station or fuel was not in the last run's file.
- Prices are what stations report to the ministries; a station that reports late shows its last reported price (use `maxPriceAgeDays`).
- The Actor identifies itself honestly, obeys robots.txt, and reports a source that is down instead of retrying around it.

### Attribution

Required by the sources' licences; keep it when you republish the data:

- France: "Source: Ministère de l'Économie, des Finances et de la Souveraineté industrielle et numérique, prix-carburants.gouv.fr", Licence Ouverte / Open Licence 2.0 (Etalab), with the date of the data (`priceUpdatedAt`).
- Spain: "Fuente: Ministerio para la Transición Ecológica y el Reto Demográfico (geoportalgasolineras.es)", with the date of the last update (`priceUpdatedAt`). Reuse under Ley 37/2007: do not alter the data or distort its meaning. This Actor only re-labels fields and adds a normalised fuel type next to the original label.

# Actor input Schema

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

ISO country codes to read: FR (France) and ES (Spain). Empty = both.

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

Normalised fuel types to keep: diesel, diesel-premium, hvo, e5 (95 octane E5 / SP95), e5-premium, e10, 98, e85, lpg, cng, lng, hydrogen, other. Empty = all. The source's own label is always in `fuelLabel`.

## `latitude` (type: `number`):

Centre of a radius search (WGS84 degrees). Set together with longitude.

## `longitude` (type: `number`):

Centre of a radius search (WGS84 degrees).

## `radiusKm` (type: `number`):

Radius around latitude/longitude. Default 5 km. Each item then carries `distanceKm`.

## `cities` (type: `array`):

Keep stations whose city is one of these (case and accents ignored; 'Paris' also matches 'Paris 15e'). Empty = any.

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

Keep stations whose postcode starts with one of these: '75015' or '75' (all of Paris), '28' (Madrid province). A Spain-only postcode query downloads just those provinces.

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

Return only the N cheapest prices per country and fuel type within the selected area. Empty = all.

## `maxPriceAgeDays` (type: `number`):

Drop prices last updated more than this many days ago (stale prices otherwise top cheapest-N lists). Empty = keep all.

## `changesOnly` (type: `boolean`):

Return only prices that are new or changed since the last run with the same state key, with `previousPrice` and `delta`. The first run saves a baseline and returns nothing.

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

Name of the key-value store in your account that holds the last run's prices (changes mode). Use different names for separate watch lists.

## Actor input object example

```json
{
  "countries": [
    "FR"
  ],
  "fuelTypes": [
    "diesel",
    "e10"
  ],
  "latitude": 48.8566,
  "longitude": 2.3522,
  "radiusKm": 5,
  "changesOnly": false,
  "stateKey": "eu-fuel-prices-state"
}
```

# Actor output Schema

## `results` (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": [
        "FR"
    ],
    "fuelTypes": [
        "diesel",
        "e10"
    ],
    "latitude": 48.8566,
    "longitude": 2.3522,
    "radiusKm": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("saksham1341/eu-fuel-prices").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": ["FR"],
    "fuelTypes": [
        "diesel",
        "e10",
    ],
    "latitude": 48.8566,
    "longitude": 2.3522,
    "radiusKm": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("saksham1341/eu-fuel-prices").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": [
    "FR"
  ],
  "fuelTypes": [
    "diesel",
    "e10"
  ],
  "latitude": 48.8566,
  "longitude": 2.3522,
  "radiusKm": 5
}' |
apify call saksham1341/eu-fuel-prices --silent --output-dataset

```

## MCP server setup

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

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/0vabQzaNt11dCCTeM/builds/lnCfC8IltvPhcu0bO/openapi.json
