# Italy Fuel Prices – Real-time Petrol, Diesel, LPG & CNG (MIMIT) (`mikestart/italy-fuel-prices`) Actor

Live prices of 20,000+ Italian petrol stations from official MIMIT data. Search by region, town, GPS radius or station ID; rankings, averages, price monitoring. This is not personalized advice. Material created also with the use of AI tools.

- **URL**: https://apify.com/mikestart/italy-fuel-prices.md
- **Developed by:** [Mike](https://apify.com/mikestart) (community)
- **Categories:** Travel, Open source, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 price rows

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

## Italy Fuel Prices – Real-time Petrol, Diesel, LPG & CNG (MIMIT Osservaprezzi)

Get **live fuel prices from 20,000+ Italian petrol stations** straight from the official
**MIMIT "Osservaprezzi Carburanti"** service (Ministero delle Imprese e del Made in Italy).
Italian law obliges every station to report its prices, so this is the most complete public source
of fuel prices in Italy.

Unlike tools based on the daily CSV export (which contains prices **as of 8:00 of the previous day**),
this Actor reads the same live data shown on the official portal, so you get the price a station
reported **minutes or hours ago**, with its exact update timestamp.

### What you can do

- 🔎 **Search by area** – region, province (code `MI` or name `Milano`) or town.
- 📍 **Search nearby** – one or many GPS points with a 1–10 km radius (great for routes, depots, delivery zones).
- 🏷️ **Track specific stations** by their ID.
- ⛽ **Filter fuels** – petrol (benzina), diesel (gasolio), LPG (GPL), CNG (metano), L-GNC, LNG, premium products – and **self-service vs attended** prices.
- 📊 **Area statistics on every row** – rank, min / average / median price of the search, difference vs. average, cheapest flag. A per-search summary is saved in the `SUMMARY` record of the key-value store.
- 🔔 **Price-change monitoring** – give a `monitorKey` and every run is compared with the previous one: `previousPrice`, `priceChange`, `changeStatus` (`NEW`, `UP`, `DOWN`, `SAME`). With `onlyChanges` you get only what changed – ideal for scheduled runs, alerts, Slack/Make/Zapier integrations.
- 🕒 **Freshness** – `priceUpdatedAt`, `priceAgeHours`, `isStale` (> 72 h) and an optional `maxPriceAgeDays` filter.
- 🏪 **Optional station details** – address, services, opening hours, website.
- 🛟 **Automatic fallback to the official daily CSV** – if the live service is down or changes its format, the Actor
  switches to MIMIT's open-data files (`prezzo_alle_8.csv` + `anagrafica_impianti_attivi.csv`) instead of failing.
  Every row tells you where it came from in the `dataSource` field (`api-live` or `csv-daily`).

### Use cases

- Fleet, logistics and delivery companies: find where to refuel, measure fuel cost per area, alert on price changes.
- Petrol station owners: monitor competitors' prices within a few km every hour.
- Apps, dashboards, journalists and analysts: build price maps, compare regions, track trends over time.
- Travel/route planning: cheapest stations around several points along a route.

### Input

| Field | Type | Description |
|---|---|---|
| `mode` | `area` | `nearby` | `stations` | Search type (required). |
| `areas` | array | `[{"region":"Lombardia"}]`, `[{"province":"MI"}]`, `[{"province":"MI","town":"Milano"}]`, optional `label`. |
| `points` | array | `[{"lat":45.4642,"lng":9.19,"label":"Milano Duomo"}]` |
| `radiusKm` | integer 1–10 | Radius around each point (default 5). |
| `stationIds` | array of strings | MIMIT station IDs (field `stationId` of results). |
| `fuelTypes` | array | `benzina`, `gasolio`, `gpl`, `metano`, `l-gnc`, `gnl`, `benzina-premium`, `gasolio-premium`, `altro`, `all`. Default `["benzina","gasolio"]`. |
| `serviceType` | `any` | `self` | `servito` | Self-service or attended price. |
| `maxPriceAgeDays` | integer | Drop prices older than N days (0 = keep all). |
| `includeStationDetails` | boolean | One extra request per station: address (needed in `nearby` mode), services, opening hours, website. |
| `maxResults` | integer | Max rows (station × fuel × service). 0 = unlimited. Default 1000. |
| `monitorKey` | string | Enables price-change comparison with the previous run with the same key. |
| `onlyChanges` | boolean | With `monitorKey`, output only `NEW` / `UP` / `DOWN` rows. |
| `dataSource` | `auto` | `api` | `csv` | `auto` (default): live API, automatic fallback to the official daily CSV if the API fails or its format changes. `api`: live only (the run fails if the API is down). `csv`: always use the daily CSV. |

#### Example inputs

Cheapest self-service diesel and LPG within 2 km of two city centres:

```json
{
  "mode": "nearby",
  "points": [
    { "lat": 45.4642, "lng": 9.19, "label": "Milano Duomo" },
    { "lat": 41.9028, "lng": 12.4964, "label": "Roma Centro" }
  ],
  "radiusKm": 2,
  "fuelTypes": ["gasolio", "gpl"],
  "serviceType": "self"
}
```

Hourly competitor monitoring (schedule the Actor and keep the same `monitorKey`):

```json
{ "mode": "nearby", "points": [{ "lat": 43.0966, "lng": 12.5406, "label": "My station" }],
  "radiusKm": 5, "fuelTypes": ["benzina", "gasolio"], "monitorKey": "my-station-5km", "onlyChanges": true }
```

Whole town with station details:

```json
{ "mode": "area", "areas": [{ "province": "PG", "town": "Assisi" }], "serviceType": "self", "includeStationDetails": true }
```

### Output

One dataset item per **station × fuel × service type**. Real example (trimmed):

```json
{
  "stationId": 48812,
  "stationName": "ENERGIA PETROLI 2000 SRL - PETRIGNANO",
  "brand": "Esso",
  "address": "VIA FR.PETRIGNANO-S.P.248 KM 0,900 - ... 06081 - ASSISI PG",
  "postalCode": "06081",
  "town": "ASSISI",
  "province": "PG",
  "latitude": 43.09637244484077,
  "longitude": 12.540627588954942,
  "distanceKm": null,
  "fuelName": "Benzina",
  "fuelGroup": "benzina",
  "serviceType": "self",
  "price": 1.99,
  "currency": "EUR",
  "unit": "litre",
  "priceUpdatedAt": "2026-10-28T10:05:58+01:00",
  "priceAgeHours": 5.7,
  "isStale": false,
  "searchLabel": "Assisi, PG, Umbria",
  "dataSource": "api-live",
  "csvExtractionDate": null,
  "rankInSearch": 1,
  "stationsInSearch": 9,
  "searchMinPrice": 1.99,
  "searchAvgPrice": 2.005,
  "searchMedianPrice": 1.999,
  "diffFromSearchAvg": -0.015,
  "isCheapestInSearch": true,
  "changeStatus": "DOWN",
  "previousPrice": 2.04,
  "priceChange": -0.05,
  "mapsUrl": "https://www.google.com/maps/search/?api=1&query=43.0963,12.5406",
  "stationDataUrl": "https://carburanti.mise.gov.it/ospzApi/registry/servicearea/48812",
  "sourceName": "MIMIT – Osservaprezzi Carburanti",
  "license": "IODL 2.0 – Source: Ministero delle Imprese e del Made in Italy (MIMIT)",
  "scrapedAt": "2026-10-28T14:49:40.826Z"
}
```

`stationType` (`Stradale` / `Autostradale`) and `csvExtractionDate` are filled only for `csv-daily` rows.
`changeStatus` / `previousPrice` / `priceChange` appear only when `monitorKey` is set;
`services`, `openingHours`, `website` only with `includeStationDetails`.
Download results as JSON, CSV, Excel or via API, or connect them to Google Sheets, Make, Zapier, n8n.

### Data sources and fallback

| | `api-live` (default) | `csv-daily` (fallback or `dataSource: "csv"`) |
|---|---|---|
| Source | Live Osservaprezzi service | Official open-data CSV published daily by MIMIT |
| Freshness | Minutes/hours (exact timestamp per price) | Prices in force at **08:00 of the previous day** (each price keeps its own `priceUpdatedAt`) |
| Area / nearby / stations | ✅ / ✅ (official radius search) / ✅ | ✅ / ✅ (distance computed from coordinates) / ✅ |
| Station details (services, hours, website) | ✅ with `includeStationDetails` | ❌ (ignored with a warning) |
| `stationDataUrl` | ✅ | `null` |

With `dataSource: "auto"` the fallback is triggered when the API keeps failing after retries (timeouts, HTTP 5xx) or returns an
unexpected format (non-JSON, missing `results`, station objects without `fuels`/`price`). Input mistakes (e.g. an unknown province)
never trigger the fallback – you get a clear error instead. The reason of a fallback is saved in `SUMMARY.fallbackReason`.
Region/province names are resolved with a built-in table of the 107 Italian provinces, so the fallback works even if the
whole live service is offline. Monitoring (`monitorKey`) keeps working across sources (same key: station × fuel × service).

### Limits and notes

- Prices are **declared by station operators** to MIMIT; some stations update rarely – check `priceAgeHours` / `isStale`.
- Nearby search radius is limited to 10 km by the official service; use several points for larger zones or `area` mode.
- In `nearby` mode the address is not returned by the source: enable `includeStationDetails` if you need it.
- In `stations` mode coordinates are not available from the detail endpoint.
- Motorway (highway) search is not supported yet.
- The Actor is deliberately polite (sequential requests, ~3 per second max, retries with back-off). A whole region (hundreds of stations) takes a few seconds; details add ~0.4 s per station.
- The live data comes from the public, login-free service behind the official portal. If MIMIT changes it, the Actor automatically falls back to the daily CSV; please open an issue so we can update it.

### Legal & data protection

- Data: **MIMIT – Osservaprezzi Carburanti**, open data released under the
  **Italian Open Data License v2.0 (IODL 2.0)**, which allows commercial reuse **with attribution**.
  Every row carries the source and license; keep the attribution when you republish the data.
- No login, no paywall and no technical protection is bypassed.
- Data minimisation (GDPR): the Actor **does not output** the operator ("Gestore") name, phone numbers
  or e-mail addresses available in the source (the `Gestore` column of the CSV is discarded while parsing). Note that some stations are publicly listed under the
  name of a sole trader; use the data for price information purposes only.
- This Actor is not affiliated with or endorsed by MIMIT.

### Support

Found a bug or need a field / a new feature (e.g. motorway stations, CSV history export)? Open an issue on the Actor's Issues tab.

### Disclaimer

This is not personalized advice. Material created also with the use of AI tools.

# Actor input Schema

## `mode` (type: `string`):

<b>area</b> = by region / province / town; <b>nearby</b> = within a radius around coordinates; <b>stations</b> = specific station IDs (best for monitoring).

## `areas` (type: `array`):

List of objects: {"region": "Lombardia"} or {"province": "MI"} or {"province": "MI", "town": "Milano"}. Optional "label". Province accepts code (MI) or name (Milano).

## `points` (type: `array`):

List of {"lat": 45.4642, "lng": 9.19, "label": "Milano Duomo"}. Each point is searched separately.

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

Search radius around each point, 1–10 km (limit of the official service).

## `stationIds` (type: `array`):

MIMIT station IDs (the 'stationId' field of any previous result).

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

Which fuels to return. Use 'all' for every fuel incl. premium products.

## `serviceType` (type: `string`):

self = self-service price, servito = attended service price.

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

Skip prices not updated by the station in the last N days. 0 = keep all (rows still carry 'priceAgeHours' and 'isStale').

## `includeStationDetails` (type: `boolean`):

Fetch address (missing in nearby mode), services, opening hours and website. One extra request per station – slower. Phone, e-mail and operator name are never collected.

## `maxResults` (type: `integer`):

Maximum number of rows (station × fuel × service) to output. 0 = no limit.

## `monitorKey` (type: `string`):

Any name (e.g. 'my-fleet-milano'). When set, prices are compared with the previous run that used the same key and rows get previousPrice / priceChange / changeStatus (NEW, UP, DOWN, SAME).

## `onlyChanges` (type: `boolean`):

With a monitoring key, output only NEW/UP/DOWN rows (the first run returns everything as a baseline). Great for scheduled runs and alerts.

## `dataSource` (type: `string`):

Where prices come from. Every output row has a `dataSource` field: `api-live` or `csv-daily`. The CSV is the official MIMIT open-data file (prezzo_alle_8.csv + anagrafica_impianti_attivi.csv); it is updated once a day, so prices can be up to ~1 day older than the live API. Station details (services, opening hours) are only available from the live API.

## Actor input object example

```json
{
  "mode": "area",
  "areas": [
    {
      "province": "MI",
      "town": "Milano"
    }
  ],
  "points": [
    {
      "lat": 45.4642,
      "lng": 9.19,
      "label": "Milano Duomo"
    }
  ],
  "radiusKm": 5,
  "fuelTypes": [
    "benzina",
    "gasolio"
  ],
  "serviceType": "any",
  "maxPriceAgeDays": 0,
  "includeStationDetails": false,
  "maxResults": 1000,
  "onlyChanges": false,
  "dataSource": "auto"
}
```

# Actor output Schema

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

Fuel price rows (one per station, fuel and service type) with area rankings and change monitoring fields.

## `summary` (type: `string`):

Run summary: per-search statistics (min, average, median, cheapest station) and data source used.

# 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 = {
    "areas": [
        {
            "province": "MI",
            "town": "Milano"
        }
    ],
    "points": [
        {
            "lat": 45.4642,
            "lng": 9.19,
            "label": "Milano Duomo"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mikestart/italy-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 = {
    "areas": [{
            "province": "MI",
            "town": "Milano",
        }],
    "points": [{
            "lat": 45.4642,
            "lng": 9.19,
            "label": "Milano Duomo",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("mikestart/italy-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 '{
  "areas": [
    {
      "province": "MI",
      "town": "Milano"
    }
  ],
  "points": [
    {
      "lat": 45.4642,
      "lng": 9.19,
      "label": "Milano Duomo"
    }
  ]
}' |
apify call mikestart/italy-fuel-prices --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mikestart/italy-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/Vckshh7vXwxIsH3h4/builds/TUygPSp0yFu4q585z/openapi.json
