# Italy & Spain Fuel Prices Scraper — MIMIT / MITECO (`promptica/europe-fuel-prices-italy-spain`) Actor

Official station-level fuel prices, location and brand filters, radius search and persistent price-change monitoring for Italy and Spain.

- **URL**: https://apify.com/promptica/europe-fuel-prices-italy-spain.md
- **Developed by:** [Lorenzo Talamucci](https://apify.com/promptica) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.00 / 1,000 results

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 & Spain Fuel Prices Scraper — MIMIT / MITECO

Get official station-level fuel prices from Italy and Spain, with addresses, brands, coordinates, source dates and persistent price-change monitoring. Built for fleet fuel planning, price comparison apps, market research and recurring alerts.

One result is **one station × fuel × service mode**, not a complete station. Petrol, diesel, LPG, CNG, LNG and other fuels retain their original source labels; `fuelCategory` supplies a common category. No login is required at either source.

### Quick start

```json
{"countries":["IT","ES"],"maxResults":20}
```

The prefill is deliberately small. Countries run in stable ES → IT order, then station ID, fuel and service mode. A low limit can be filled entirely by Spain; choose `countries: ["IT"]` to obtain Italy.

Find Italian diesel around Milan:

```json
{"countries":["IT"],"fuel":"diesel","latitude":45.4642,"longitude":9.1900,"radiusKm":15,"maxPrice":2,"maxResults":100}
```

Monitor a Spanish municipality daily:

```json
{"countries":["ES"],"municipality":"Abengibre","maxResults":100,"soloNuove":true,"monitorNome":"abengibre-fuel-daily"}
```

### Filters

| Input | Meaning |
|---|---|
| `countries` | `IT`, `ES`, or both. Default both. |
| `region` | Region name, e.g. Toscana, Lombardia, Madrid. |
| `province` | Italian code (MI, PO, etc.) or Spanish province name. |
| `municipality`, `brand` | Municipality or station brand. |
| `fuel` | Native label or category: petrol, diesel, lpg, cng, lng, ethanol, hydrogen. |
| `latitude`, `longitude`, `radiusKm` | All three required for a radius search. |
| `maxPrice` | Maximum price in the row's unit. Filter by fuel when comparing. |
| `maxResults` | 1–200,000 delivered observations; default 20. |
| `soloNuove` | Emit only unseen or price-changed observations. Default false. |
| `monitorNome` | Named persistent Apify key-value store, 2–63 letters/digits/hyphens. |

Text filters use accent/case-insensitive substring matching and combine with AND. Italian regions are derived from province codes; unknown codes yield null. Missing coordinates are excluded from radius searches. Prices are EUR/l for liquid fuels and EUR/kg for CNG, LNG and hydrogen. Original fuel labels distinguish premium variants. AdBlue and ammonia are excluded from the Spanish feed.

### Monitoring semantics

The first run emits matching observations up to `maxResults`. Later runs compare numeric prices, currency and unit for each country/station/fuel/service combination. Timestamp-only and address-only changes do not trigger alerts. Unchanged observations do **not** consume `maxResults`, so later changes remain discoverable. When a first run is capped, later runs drain the unseen backlog. Increase the limit to cover the complete filtered population in one run.

The store is persistent and scoped by the full filter configuration, including `maxResults`. Changing filters or the limit starts a new baseline. State is saved only after a dataset batch has been delivered: a crash between delivery and persistence may replay a batch, but must not silently mark undelivered prices as seen. Do not run the same monitor/filter configuration concurrently. Separate schedules should have separate names. Removed prices do not generate deletion records; this is not a historical-price archive.

### Output

`country`, `stationId`, `stationName`, `brand`, `address`, `municipality`, `province`, `region`, `latitude`, `longitude`, `fuel`, `fuelCategory`, `price`, `currency`, `unit`, `selfService`, `communicatedAt`, `communicatedAtTimezone`, `sourceUpdatedAt`, `sourceTimestampKind`, `observedAt`, `monitorStatus`, `sourceUrl`, `license`, `licenseUrl`, `attribution`.

`communicatedAt` preserves the Italian source's local `DD/MM/YYYY HH:mm:ss` string with `Europe/Rome` in its timezone field. Spain does **not** expose the per-price communication date in this endpoint; this field and `selfService` are null. Spain's `sourceUpdatedAt` is the feed's local timestamp, with Europe/Madrid identified by `sourceTimestampKind`. Italy's source update is a daily snapshot date. `observedAt` is the UTC retrieval/processing time. These timestamps are not interchangeable.

`OUTPUT` in the default key-value store contains errors, recovery hints, delivered counts, source counts and malformed-row counts. `SUMMARY` contains run statistics. Bad input, an unavailable source or the internal deadline produce a controlled completion with diagnostics and any available partial results. An external platform kill, startup failure or infrastructure outage cannot be guaranteed to end SUCCEEDED.

### Sources and reuse

- Italy: MIMIT official dataset (www.mimit.gov.it), daily current snapshot, published since March 2015. IODL 2.0 (www.dati.gov.it) permits commercial reuse with attribution. Preserve source, provider and license links.
- Spain: MITECO official feed (sedeaplicaciones.minetur.gob.es), under the ministry's public-sector information reuse conditions (sede.serviciosmin.gob.es), with commercial reuse covered by its RISP plan (sede.serviciosmin.gob.es). This actor does **not** label these data CC-BY-4.0. Preserve source and update date, avoid distortion and do not imply official endorsement.

Data is joined/normalized by Promptica; no affiliation with either ministry. Operator (`Gestore`) information is not exported. MIMIT CSV can contain malformed rows: those rows are skipped and counted, never guessed or shifted into incorrect columns. Observations whose station cannot be joined are skipped and counted separately. Different snapshot dates cause the Italian source to stop cleanly. Source data can be stale or inaccurate; a download date is not a promise that every station updated its prices recently.

### Pricing — pending configuration by the publisher

| Event | Proposed price |
|---|---|
| Platform actor start, 1 GB default | $0.05 |
| `result`, one delivered price observation | $0.002 (publisher decision pending) |

The Store pricing shown at run time is authoritative. This repository does not activate prices. Only one result mechanism should be configured: custom `result` or the platform's default dataset-item event. The implementation prefers the default dataset event if both exist, avoiding double charges. Undefined events are tolerated; uncertain charge failures stop without retry. No premium event applies.

### Runtime and local verification

Node 22, default memory 1 GB. Each source response is capped at 40 MiB. Requests retry at most four times with backoff, respecting only the platform deadline minus 30 seconds (default platform timeout: 3,600 seconds). Local runs without a platform deadline have no fixed extraction cap. Cloud requests use Apify proxy sessions; local tests use direct public HTTP requests. No CAPTCHA bypass.

```bash
npm ci
npm test
apify run --input-file test/prefill.json
apify run --input-file test/monitor.json
apify run --input-file test/monitor.json
```

Inspect `OUTPUT.error`, not just the exit code. Monitor state is stored in a named store; do not erase that store between the two runs. The cloud acceptance battery is `test/collaudo.json`; cloud runs/deploy/publication require the publisher's approval.

### Italiano

Prezzi ufficiali per impianto di Italia e Spagna, con filtri geografici e monitor delle variazioni. Ogni riga rappresenta un carburante e una modalità di servizio. `soloNuove` conserva lo storico dei prezzi già consegnati in uno store nominato. Le righe italiane malformate vengono scartate e conteggiate nel riepilogo, come concordato il 28 settembre 2026. Conservare sempre attribuzione e licenza nei riusi.

### Altri dati pubblici italiani / More Italian public data

Italy Public Data by Promptica — altri dataset / other datasets:

- [Italy Public Procurement — ANAC CIG](https://apify.com/promptica/anac-appalti-italia) — Estrae i bandi di gara pubblici italiani (CIG) dagli open data ufficiali ANAC, inclusi gli affidamenti sotto soglia UE che TED non copre. Filtra per CPV, provincia, importo, stazione appaltante, oggetto e settore. Dati 100% pubblici.
- [Estrai aste giudiziarie PVP — Perizie e monitor](https://apify.com/promptica/aste-giudiziarie-pvp) — Aste giudiziarie PVP: estrai immobili, prezzi, date, tribunali e link alle perizie dal portale ufficiale. Filtri e monitor delle aste nuove o cambiate.
- [EPREL — EU Energy Label Database (etichette energetiche UE)](https://apify.com/promptica/eprel-etichette-energetiche) — Estrae dati pubblici dal registro EPREL della Commissione Europea sulle etichette energetiche: classe, consumi, parametri tecnici, produttore. Utile per e-commerce compliance (Reg. UE 2017/1369).
- [Gazzetta Ufficiale RAG — Leggi, Decreti e Concorsi (Italia)](https://apify.com/promptica/gazzetta-ufficiale-rag) — Estrae atti normativi e concorsi pubblici dalla Gazzetta Ufficiale italiana (gazzettaufficiale.it) come record Markdown strutturati, pronti per pipeline RAG. Filtra per serie, tipo atto, data, e parola chiave. Dati 100% pubblici, nessuna chiave API.
- [inPA Concorsi Pubblici — Portale del reclutamento](https://apify.com/promptica/inpa-concorsi-pubblici) — Estrae i concorsi pubblici e gli avvisi di selezione della PA italiana dal portale ufficiale inPA. Filtra per ente, parola chiave, numero minimo di posti e data. Dati 100% pubblici.
- [Italy Administrative Court Rulings Scraper — OpenGA](https://apify.com/promptica/italy-administrative-court-rulings-openga) — Official Italian administrative court CSV metadata: Consiglio di Stato, CGARS and TAR, licensed CC BY 4.0, filters and persistent monitoring.
- [Estrai fornitori MePA e Consip — Elenco ufficiale imprese PA](https://apify.com/promptica/italy-consip-suppliers) — Fornitori MePA e Consip: imprese abilitate e aggiudicatarie della PA con partita IVA, sede, aggiudicazioni e contratti attivi. Open data ufficiali.
- [Italy Constitutional Court Decisions — Official Open Data](https://apify.com/promptica/italy-constitutional-court-decisions) — Italian Constitutional Court decisions and official summaries since 1956, with full text, filters and persistent monitoring. CC BY-SA 3.0 attribution included.
- [Estrai PEC enti pubblici — Indice IPA: comuni ed enti (AgID)](https://apify.com/promptica/italy-ipa-public-bodies) — PEC degli enti pubblici italiani dall'Indice IPA di AgID: comuni, enti e stazioni appaltanti con codice fiscale, indirizzo, sito e email istituzionali.
- [Scarica elenco farmacie italiane — Anagrafe Ministero Salute](https://apify.com/promptica/italy-pharmacies) — Elenco farmacie italiane dall'anagrafe ufficiale del Ministero della Salute: nome, partita IVA, indirizzo, comune e provincia. Filtri, storico e monitor.
- [Estrai aste immobili Demanio — Immobili dello Stato in vendita](https://apify.com/promptica/italy-state-property-sales) — Aste immobili dell'Agenzia del Demanio: immobili dello Stato in vendita con prezzo base, scadenza offerte, luogo, superficie e bandi. Filtri e monitor.
- [TED Gare d'Appalto EU](https://apify.com/promptica/ted-gare-eu) — Estrae bandi di gara pubblici europei dal portale ufficiale TED (Tenders Electronic Daily, Gazzetta Ufficiale UE). Dati 100% pubblici via API ufficiale TED. Filtra per codice CPV, paese, parole chiave e data.

# Actor input Schema

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

Official feeds to read. ES is processed before IT; use country-specific monitors for full coverage.

## `region` (type: `string`):

Region name: e.g. Toscana or Madrid. Accent-insensitive substring.

## `province` (type: `string`):

Italian province code (e.g. MI), Spanish province name. Substring.

## `municipality` (type: `string`):

Municipality name, case/accent-insensitive substring.

## `fuel` (type: `string`):

Native fuel label or normalized category: petrol, diesel, lpg, cng, lng, ethanol, hydrogen.

## `brand` (type: `string`):

Station brand, case/accent-insensitive substring.

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

Center latitude; requires longitude and radiusKm.

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

Center longitude; requires latitude and radiusKm.

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

Maximum distance from center in km.

## `maxPrice` (type: `number`):

Maximum EUR/l or EUR/kg as specified by each row unit. Filter fuel when comparing prices.

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

Maximum delivered price observations, not stations. Unchanged monitor records do not consume the limit.

## `soloNuove` (type: `boolean`):

First run emits matching observations up to maxResults; later runs emit unseen or price-changed observations. Timestamp-only changes are ignored.

## `monitorNome` (type: `string`):

2–63 letters, digits and hyphens. Use one schedule per monitor and input configuration; do not overlap runs.

## Actor input object example

```json
{
  "countries": [
    "IT",
    "ES"
  ],
  "region": "",
  "province": "",
  "municipality": "",
  "fuel": "",
  "brand": "",
  "maxResults": 20,
  "soloNuove": false,
  "monitorNome": "fuel-price-monitor"
}
```

# Actor output Schema

## `prices` (type: `string`):

No description

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

No description

## `diagnostics` (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": [
        "IT",
        "ES"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("promptica/europe-fuel-prices-italy-spain").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": [
        "IT",
        "ES",
    ],
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("promptica/europe-fuel-prices-italy-spain").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": [
    "IT",
    "ES"
  ],
  "maxResults": 20
}' |
apify call promptica/europe-fuel-prices-italy-spain --silent --output-dataset

```

## MCP server setup

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

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/llFaycdWVSkpJ1Ge1/builds/TeNjBhidVufJAq1oj/openapi.json
