# Fuel Prices Scraper: Gas Station Prices from Official Data (`steadyscrape/fuel-prices-scraper`) Actor

Official fuel prices per gas station from government open data: France, Spain, Italy, Germany, UK and Mexico. Diesel, petrol, E10, LPG and CNG prices with brand, address, opening hours and update time. Export to JSON, CSV or Excel, or via API.

- **URL**: https://apify.com/steadyscrape/fuel-prices-scraper.md
- **Developed by:** [Steady Scrape](https://apify.com/steadyscrape) (community)
- **Categories:** Travel, Business, Automation
- **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 stations

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 Scraper: gas station prices from official open data

**Fuel Prices Scraper** gets the **fuel prices of every gas station** from the official open data that governments and retailers publish: **France, Spain, Italy, Germany, the United Kingdom and Mexico**. Search a city, a postcode, a province or a point with a radius, pick diesel, petrol (gasoline), E10, LPG, CNG or AdBlue, filter by brand, and get the cheapest stations first: one row per station with its brand, address, postcode, coordinates, opening hours and **every fuel price with the time the station reported it**. Schedule it with "only stations whose price changed" to follow petrol prices day by day. Export to JSON, CSV or Excel, or use it via API.

No login and no proxy: every price comes from the public source each country runs, and each row names that source, its licence and the attribution it asks for. Germany needs your own free Tankerkönig key. This Actor is an independent tool, not affiliated with or endorsed by any of the authorities or retailers below.

### What can this fuel price scraper do?

- **Compare gas station prices in a city**: the 20 cheapest diesel stations in Paris, Lyon, Madrid, Milano or Coventry.
- **Find the cheapest fuel near a point**: give a latitude, a longitude and a radius, and get each station with its distance, cheapest or nearest first.
- **Track fuel prices over time**: run it daily on a schedule and get only the stations whose prices changed since the last run, marked `new` or `changed`.
- **Build a dataset of petrol prices for a whole country**: France (about 9,800 stations), Spain (11,500), Italy (22,000), Mexico and the UK feeds, for price analysis, maps, fleet cards or route planning.
- **Filter by fuel and brand**: diesel, premium diesel, petrol 95, E10, premium petrol, E85, LPG (autogas), CNG, LNG, hydrogen, AdBlue; brands such as Total, Repsol, Esso, Eni or Shell.

### Fuel price sources by country

| Country | Source | Search by | What a row has |
|---|---|---|---|
| 🇫🇷 France | prix-carburants.gouv.fr, flux instantané v2 (Ministère de l'Économie), the whole file once per run | city, postcode, department code (`69`, `2A`), point, whole country | address, postcode, city, department, coordinates, opening hours, each price with its time. **No brand or station name**: the official feed has none. |
| 🇪🇸 Spain | Geoportal de Gasolineras (MITECO) | municipality, province, postcode, point, whole country | brand, address, postcode, municipality, province, coordinates, opening hours as the ministry writes them (`L-D: 24H`), the file's update time. |
| 🇮🇹 Italy | Osservaprezzi carburanti (MIMIT) | town, point, whole country | name, brand, operating company, street, postcode, province, coordinates, opening hours when the station reported them, **self-service and attended prices**, each with its time. |
| 🇩🇪 Germany | Tankerkönig (MTS-K data), **with your own free key** | point (up to 25 km) | name, brand, street and number, postcode, city, coordinates, diesel, E5 and E10 prices. |
| 🇬🇧 United Kingdom | the retailers' open fuel price feeds (CMA scheme): Asda, Esso, SGN Retail, JET, Moto, Rontec, Applegreen, Morrisons | town, full or outward postcode (`SW1A 1AA`, `CV3`), point, whole country | brand, address, postcode, coordinates, E10, E5, diesel and super diesel in pounds, dated at the feed's update. |
| 🇲🇽 Mexico | Comisión Nacional de Energía (formerly CRE), places and prices feeds | point, whole country | permit holder's name, coordinates, regular, premium and diesel prices in pesos. No address and no report time. |

A place is searched in every country you pick, and a country that does not have it is skipped. If no country has it, one free row says so.

### How to search fuel prices

**By city or postcode.** Put each place in **Cities or postcodes**: `Lyon`, `Madrid`, `Las Rozas de Madrid`, `Milano`, `Coventry`. A place with a digit is a postcode: `75015`, `08001`, `CV3`, `SW1A 1AA`, or a French department code (`2A`, `69`). Accents, hyphens and Spanish articles do not matter: `Saint Etienne` finds Saint-Étienne, `Las Rozas de Madrid` finds the register's "Rozas de Madrid (Las)", and a Spanish province name (`Asturias`) reads the whole province.

**Around a point.** Give a **Latitude**, a **Longitude** and a **Radius (km)**: each station comes with its `distanceKm`. This is the only way to search Mexico and Germany.

**A whole country.** Leave places and point empty. **Max stations per search** still applies, so raise it for a full export.

**Cheapest first.** With **Sort by: Cheapest first**, each search is sorted by the first fuel you picked (diesel when you pick none), and stations without that fuel come last.

**Only stations whose price changed.** Turn on **Only stations whose price changed since the last run** and schedule the run: the first run delivers every station and saves its prices; each later run with the same search, countries and filters delivers only the stations whose prices moved or that appeared, and you pay only for those.

### Input example

```json
{
    "countries": ["FR", "ES"],
    "places": ["Paris", "Madrid"],
    "fuelTypes": ["diesel", "gasoline"],
    "sortBy": "cheapest",
    "maxStations": 20,
    "maxPriceAgeDays": 90
}
```

A point search in Germany with your Tankerkönig key:

```json
{
    "countries": ["DE"],
    "latitude": 52.52,
    "longitude": 13.405,
    "radiusKm": 5,
    "tankerkoenigApiKey": "your-free-key"
}
```

### Output example

One row per station, with each fuel's price in `fuels` and the lowest price per fuel in `prices`:

```json
{
    "rowType": "station",
    "status": "ok",
    "country": "ES",
    "stationId": "ES:3085",
    "sourceStationId": "3085",
    "name": null,
    "brand": "CARREFOUR",
    "operator": null,
    "address": "CARRETERA MADRID-LA CORUÑA KM. 22",
    "postcode": "28230",
    "city": "Rozas de Madrid (Las)",
    "region": "MADRID",
    "latitude": 40.521389,
    "longitude": -3.884917,
    "openingHours": "L-D: 24H",
    "fuels": [
        { "fuel": "diesel", "name": "Gasoleo A", "price": 1.849, "currency": "EUR", "unit": "litre", "service": null, "updatedAt": "2026-11-19T02:07:19.000Z" },
        { "fuel": "gasoline", "name": "Gasolina 95 E5", "price": 1.599, "currency": "EUR", "unit": "litre", "service": null, "updatedAt": "2026-11-19T02:07:19.000Z" },
        { "fuel": "gasoline_premium", "name": "Gasolina 98 E5", "price": 1.807, "currency": "EUR", "unit": "litre", "service": null, "updatedAt": "2026-11-19T02:07:19.000Z" }
    ],
    "prices": { "diesel": 1.849, "gasoline": 1.599, "gasoline_premium": 1.807 },
    "currency": "EUR",
    "pricesUpdatedAt": "2026-11-19T02:07:19.000Z",
    "source": "Geoportal de Gasolineras, servicio REST de precios de carburantes",
    "licence": "Reuse of public sector information, Ley 37/2007 (commercial reuse allowed with attribution)",
    "attribution": "Fuente de los datos: Ministerio para la Transición Ecológica y el Reto Demográfico",
    "unreadFields": [],
    "search": "Las Rozas de Madrid",
    "distanceKm": null,
    "sortFuel": "diesel",
    "sortFuelPrice": 1.849,
    "change": null,
    "scrapedAt": "2026-11-19T02:07:14.405Z"
}
```

The dataset's **Every price** view gives one line per station and fuel, ready for a spreadsheet.

### Output fields

| Field | What it is |
|---|---|
| `rowType`, `status` | `station` and `ok` on a station (charged); `status` and its reason code on a free row (below). |
| `country` | `FR`, `ES`, `IT`, `DE`, `GB` or `MX`. |
| `stationId`, `sourceStationId` | The country and the source's own station id (`FR:75013025`), stable across runs, and the source's id alone (`75013025`). |
| `name`, `brand`, `operator` | The station's name, its brand and the company that runs it, where the source gives them. |
| `address`, `postcode`, `city`, `region` | The station's address; `region` is the department (France) or province (Spain, Italy). |
| `latitude`, `longitude` | The station's coordinates. |
| `openingHours` | The opening hours, per weekday (`Mon-Fri 06:00-22:00, Sat-Sun 07:00-22:00`), as the source gives them. |
| `fuels` | Every fuel price: `fuel` (the shared code below), `name` (as the source calls it), `price`, `currency`, `unit` (`litre` or `kg`), `service` (`self` or `attended`, Italy), `updatedAt` (when the station reported it, UTC). |
| `prices` | The lowest price of each fuel, by fuel code. |
| `pricesUpdatedAt` | The latest report time of the station's prices. |
| `source`, `licence`, `attribution` | Where the data comes from, its licence and the credit it asks for. |
| `unreadFields` | Fields the source stopped sending for this station (normally empty); a `null` without it means the source has none. |
| `search`, `distanceKm` | The place or point this station was found for, and its distance from the point. |
| `sortFuel`, `sortFuelPrice` | The fuel the run sorted by and this station's lowest price for it. |
| `change` | With "only stations whose price changed": `new` or `changed`. |
| `scrapedAt` | When the run read the row, UTC. |
| `reason` | On a free row: why the search, place or source gave no station. |

**Fuel codes**: `diesel`, `diesel_premium`, `gasoline` (petrol 95 / regular), `gasoline_e10`, `gasoline_premium` (98, super plus, premium), `e85`, `lpg`, `cng`, `lng`, `hydrogen`, `biodiesel`, `renewable_diesel` (HVO), `adblue`, `other`.

**Free rows.** When a search has no station, a row with `rowType: "status"` says why: `not_found` (no country has that place), `place_not_supported` (that country cannot be searched that way), `no_results`, `no_changes`, `source_unavailable`, `source_changed`, `key_missing`, `key_rejected`, `spending_limit`. These rows are free.

### How much does it cost?

**US$0.50 per 1,000 stations** (US$0.0005 per station row). Status rows are free. A station is charged once per run even when two of your searches find it. The 20 cheapest stations of a city cost US$0.01; a daily "only changed" run pays only for the stations whose prices moved.

### Limits

- **France** publishes no brand or station name, so a brand filter leaves French stations out.
- **France** writes each town as the station reported it (`PARIS` or `Paris`); a city search matches either, accents and hyphens aside.
- **Germany** needs your own free Tankerkönig API key ([onboarding.tankerkoenig.de](https://onboarding.tankerkoenig.de)) and is searched around a point, up to 25 km.
- **Mexico** is searched around a point or as a whole country: its feeds carry coordinates but no address.
- **Italy** cannot be searched by postcode (search the town or a point). A station page that fails to load leaves that station with the search's fields, its missing ones named in `unreadFields`.
- A station that stopped reporting keeps its last price in the feed: prices older than 90 days are left out by default (**Leave out prices older than**; 0 keeps them all).
- **United Kingdom**: only the retailers whose feeds answer are covered (Asda, Esso, SGN Retail, JET, Moto, Rontec, Applegreen, Morrisons). A feed that is down is left out of that run and the others are still delivered.
- A source that refuses or is down gives a free `source_unavailable` row and the run goes on with the other countries.

### Is it legal to use this fuel price data?

Every source is open data or published for reuse:

- France: **Licence Ouverte 2.0** (Etalab).
- Spain: reuse of public sector information under **Ley 37/2007**, commercial reuse allowed with attribution.
- Italy: **Italian Open Data License 2.0**.
- Germany: **CC BY 4.0** (Tankerkönig, MTS-K data), through your own key.
- Mexico: **Libre Uso MX**.
- United Kingdom: published by each retailer for reuse under the CMA's open fuel price scheme.

These licences ask you to credit the source and not to suggest that it endorses your use: each row carries `source`, `licence` and `attribution` for that. The data is about businesses, not people. Check that your use fits the licence of each country you publish.

# Actor input Schema

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

The official fuel price sources to search. Each place below is searched in every country picked; a place a country does not have is skipped, and a free row says so only when no country has it.

## `places` (type: `array`):

Each one is its own search: a city, town or municipality (<code>Lyon</code>, <code>Madrid</code>, <code>Milano</code>, <code>Coventry</code>), a province or region name (<code>Asturias</code>, <code>Córdoba</code>), or a postcode (<code>75011</code>, <code>28001</code>, <code>SW1A 1AA</code> or just <code>CV3</code>). In France a 2-digit department code (<code>69</code>, <code>2A</code>) reads the whole department. Leave empty, with no point below, to read whole countries. Italy is searched by town, Mexico and Germany only around a point.

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

Search around a point as well, within the radius below: <code>48.8566</code>. It needs a longitude. The only way to search Mexico and Germany.

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

<code>2.3522</code>.

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

Stations within this distance of the point, each with its distance. Germany's source answers up to 25 km.

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

Only stations that sell one of these, and only these fuels' prices in each row. Empty: every fuel. The first one is also the fuel <b>Sort by</b> compares (diesel when empty).

## `brands` (type: `array`):

Only stations whose brand or name contains one of these words: <code>Total</code>, <code>Repsol</code>, <code>Shell</code>, <code>Esso</code>. France's official feed names no brand, so a brand filter leaves out every French station.

## `sortBy` (type: `string`):

Cheapest first compares the first fuel picked above (stations without it come last); nearest first works for a point search. Each search is sorted on its own.

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

The most stations each place, point or country gives, after sorting: the 20 cheapest in Paris, say. Whole France is about 9,800 stations, Spain 11,500, Italy 22,000.

## `maxPriceAgeDays` (type: `integer`):

A price the station last reported more than this many days ago is left out, and a station with no price left is skipped: a station that stopped reporting keeps its last price in the feed. 0 keeps every price. Spain dates every price at the file's time, and Mexico and Germany date none, so it does not filter them.

## `onlyChanged` (type: `boolean`):

For a scheduled run: the first run delivers every station and saves its prices; each later run with the same search delivers only stations whose prices changed (or that are new), each marked <code>changed</code> or <code>new</code>, and a free row when none did.

## `tankerkoenigApiKey` (type: `string`):

Germany's prices come from Tankerkönig (MTS-K data, CC BY 4.0), which asks every user for their own free key: register at <a href="https://onboarding.tankerkoenig.de">onboarding.tankerkoenig.de</a>. Without it Germany gives a free row.

## Actor input object example

```json
{
  "countries": [
    "FR"
  ],
  "places": [
    "Paris"
  ],
  "radiusKm": 5,
  "fuelTypes": [
    "diesel"
  ],
  "brands": [],
  "sortBy": "cheapest",
  "maxStations": 20,
  "maxPriceAgeDays": 90,
  "onlyChanged": false
}
```

# Actor output Schema

## `stations` (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": [
        "FR"
    ],
    "places": [
        "Paris"
    ],
    "fuelTypes": [
        "diesel"
    ],
    "maxStations": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadyscrape/fuel-prices-scraper").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"],
    "places": ["Paris"],
    "fuelTypes": ["diesel"],
    "maxStations": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("steadyscrape/fuel-prices-scraper").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"
  ],
  "places": [
    "Paris"
  ],
  "fuelTypes": [
    "diesel"
  ],
  "maxStations": 20
}' |
apify call steadyscrape/fuel-prices-scraper --silent --output-dataset

```

## MCP server setup

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

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/HikvKzu2ovD427ISH/builds/qEVO1eybOgY8VLgUn/openapi.json
