EU and Spain Fuel Prices Scraper (EU Weekly, ES Daily, History) avatar

EU and Spain Fuel Prices Scraper (EU Weekly, ES Daily, History)

Pricing

from $0.80 / 1,000 result delivereds

Go to Apify Store
EU and Spain Fuel Prices Scraper (EU Weekly, ES Daily, History)

EU and Spain Fuel Prices Scraper (EU Weekly, ES Daily, History)

Official EU-27 weekly fuel prices plus daily prices for ~12,000 Spanish petrol stations by brand and province. Query historical daily snapshots by date range. Petrol, diesel, LPG and taxes. No login, no browser.

Pricing

from $0.80 / 1,000 result delivereds

Rating

0.0

(0)

Developer

Steadfetch

Steadfetch

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Categories

Features

Limited permissions

Share

EU and Spain Fuel Prices Scraper (Weekly Bulletin + Daily Stations)

Two official fuel-price sources in one Actor:

  • bulletin (default): the European Commission Weekly Oil Bulletin for all EU-27 countries - Euro-super 95 petrol, automotive diesel, heating gas oil, low- and high-sulphur fuel oil and LPG motor fuel, plus the EU-27 weighted average, with taxes, without taxes or the published duties and taxes.
  • spain: every terrestrial petrol station in Spain (about 12,000) with its daily pump price for E95, E98, diesel, premium diesel, premium E95 and LPG, straight from the Ministry of Industry and Tourism API.

No browser, no login, no CAPTCHA.

What it does

Every week DG Energy publishes the Weekly Oil Bulletin as three public XLSX files linked from the bulletin page:

  • Prices with taxes - consumer prices in EUR per 1000 litres (or per tonne for fuel oils).
  • Prices without taxes - the same series with duties and taxes excluded.
  • Duties and taxes - three sheets: VAT (percent), Excise duties and Other Indirect Taxes (national currency per 1000 litres or per tonne).

The Actor reads the landing page, downloads only the workbook it needs and emits one validated record per country x fuel x series (and x tax type for duties).

  • Official source only: the files linked from energy.ec.europa.eu. No third-party copies or HTML tables.
  • Whole EU-27 in one query: 27 member states plus the EU-27 weighted average (country code EU). The "Euro Area 20" row is out of scope and never emitted.
  • Three series: with_taxes, without_taxes and duties_taxes.
  • Values as published, never converted: every record carries unit (1000 l, t or %) and currency (EUR for the weekly price series, the national currency for excise and other indirect taxes, null for VAT).
  • Derived per-litre value: pricePerLiter is price / 1000 when the published unit is 1000 l, rounded to 5 decimals and expressed in currency. It is null for per-tonne and percent values.
  • Week comes from inside the file: weekStart is read from the date cell declared in the workbook, not from the file name. The Commission sometimes leaves an older date in the link file name; the in-file date is the authoritative one.
  • Monitor deduplication: with monitorMode enabled, delivered keys are stored in a named key-value store and a repeated run for the same bulletin week emits zero records, so it is not charged per result.
  • Schema validation: every record is validated against .actor/dataset_schema.json before it reaches the dataset. An invalid record fails the run instead of pushing malformed data.
  • Scope guards: robots.txt is checked on every run. The download must stay on energy.ec.europa.eu under the document route, must return an XLSX content type and must fit the size cap; otherwise the run aborts.

Data and personal information

The source is official aggregated statistics published by the European Commission: country-level fuel prices and tax rates. No personal data is read, derived or added. Each run makes at most four requests: robots.txt, the bulletin page and two XLSX files.

Spain daily station prices (mode: "spain")

Set "mode": "spain" to switch from the weekly EU bulletin to the Spanish Ministry of Industry and Tourism (MICT) public API EstacionesTerrestres. It returns the whole country in one JSON document, refreshed every 30 minutes, and this Actor turns it into one validated row per station x fuel.

  • Universe and coverage: every terrestrial petrol station published by the Ministry - about 12,000 stations across all 52 Spanish provinces and the autonomous cities, updated daily. Nothing is sampled: one run reads the complete national list.
  • Fuels: e95, e95_premium, e98, diesel, diesel_premium and lpg (the slugs the source publishes with a price). A station only emits rows for fuels it actually sells, so missing prices are never invented.
  • Station identity and location: stationId (Ministry IDEESS), brand (the station's brand label), address, city, municipality, province, provinceCode, postalCode, latitude, longitude, schedule, pricingMargin, remision (whether the price is officially published or station-modified) and sale type.
  • Daily history in object storage: scheduled routine runs also save the full national snapshot to actors/eu-fuel-price-extractor/<YYYY-MM-DD>/spain.json in the Steadfetch bucket, so you get a real daily price history instead of a one-off scrape (only scheduled runs write; customer runs never touch the bucket).
  • Same schema as the bulletin mode: every station row uses the shared envelope (country, fuel, weekStart, price, pricePerLiter, unit, currency, scrapedAt) and adds the station fields, so weekly country series and daily station series can live in the same table.
  • Scope guards: robots.txt for sedeaplicaciones.minetur.gob.es is checked on every run, the response must be JSON and fit the 50 MB size cap, and ResultadoConsulta must be OK; otherwise the run aborts without pushing rows.

Daily station prices answer the question the weekly bulletin cannot: where fuel is cheapest today in Spain, brand by brand and province by province, and how each station's price moved from one day to the next.

Historical station prices (mode: "historical")

Set "mode": "historical" together with dateFrom and dateTo to read daily snapshots stored in the Steadfetch bucket. The Actor downloads every spain.json snapshot in the requested range, merges the results, deduplicates by station * fuel * date, and returns one validated row per station * fuel * date.

  • Read-only: this mode only reads from object storage - it never writes to the bucket.
  • Available range: snapshots started on 2026-11-01 and grow daily. Requesting a future dateTo returns 0 rows for that date; missing dates within the range are silently skipped.
  • Filters: countries, fuels, province, municipality and brand work the same as in spain mode, so you can narrow the historical query to a specific province or brand.
  • Deduplication: if the same station * fuel appears on multiple dates, each date produces one row. Within the same date, duplicates are resolved by keeping the latest scrapedAt.
  • Summary: the run summary includes datesRead (snapshots found), datesMissing (dates without a snapshot) and totalRaw (raw rows before dedup).

Historical mode turns the daily station series into a true time-series you can query by date range, province or brand - the same data a client would otherwise assemble manually across dozens of individual runs.

Example output

Prices with taxes (Spain, Euro-super 95, week of 2026-10-19):

{
"url": "https://energy.ec.europa.eu/data-and-analysis/weekly-oil-bulletin_en",
"sourceUrl": "https://energy.ec.europa.eu/data-and-analysis/weekly-oil-bulletin_en",
"country": "ES",
"countryName": "Spain",
"fuel": "e95",
"series": "with_taxes",
"weekStart": "2026-10-19",
"price": 1780.47,
"pricePerLiter": 1.78047,
"unit": "1000 l",
"currency": "EUR",
"sourceFile": "Weekly Oil Bulletin Weekly prices with Taxes - 2026-09-21.xlsx",
"scrapedAt": "2026-10-25T10:00:00.000Z"
}

EU-27 weighted average (same week):

{
"country": "EU",
"countryName": "European Union (EU-27 weighted average)",
"fuel": "e95",
"series": "with_taxes",
"weekStart": "2026-10-19",
"price": 1991.33,
"pricePerLiter": 1.99133,
"unit": "1000 l",
"currency": "EUR"
}

Duties and taxes (Spain, Euro-super 95 excise):

{
"country": "ES",
"countryName": "Spain",
"fuel": "e95",
"series": "duties_taxes",
"weekStart": "2026-10-19",
"price": 272.69,
"pricePerLiter": 0.27269,
"unit": "1000 l",
"currency": "EUR",
"taxType": "excise",
"effectiveSince": "2026-10-12"
}

Spain station row (mode: "spain", one row per station x fuel):

{
"url": "https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/EstacionesTerrestres/",
"sourceUrl": "https://sedeaplicaciones.minetur.gob.es/ServiciosRESTCarburantes/PreciosCarburantes/EstacionesTerrestres/",
"country": "ES",
"countryName": "Spain",
"fuel": "diesel",
"series": "with_taxes",
"weekStart": "2026-10-31",
"price": 1.944,
"pricePerLiter": 1.944,
"unit": "EUR/l",
"currency": "EUR",
"sourceFile": "spain-estaciones-terrestres",
"stationId": "1988",
"brand": "GALP",
"municipality": "Zaragoza",
"province": "ZARAGOZA",
"latitude": 41.666222,
"longitude": -0.876944
}

A full with_taxes run of the current workbook returns 115 records (28 country rows x the fuels each one publishes). A full duties_taxes run returns 390 records (27 countries x fuels x 3 tax sheets). Missing source values are skipped, never estimated.

Input

{
"mode": "bulletin",
"countries": ["ES", "DE"],
"fuels": ["e95", "diesel"],
"series": "with_taxes",
"week": "latest",
"monitorMode": false,
"maxResults": 100,
"strictSchema": true
}
FieldTypeDescription
modestringbulletin (default) reads the European Commission Weekly Oil Bulletin (country x fuel x series). spain reads the MICT daily station API (station x fuel, whole country).
countriesarrayISO 3166-1 alpha-2 codes to keep. The EU-27 weighted average is EU. Empty returns all 28 country rows. Ignored in spain mode.
fuelsarraye95, diesel, heating_gas_oil, fuel_oil, fuel_oil_high_sulphur, lpg. Empty returns every fuel in the workbook.
seriesstringwith_taxes (default), without_taxes or duties_taxes.
weekstringlatest (default) or a date (YYYY-MM-DD) inside the week you want. Only the bulletin currently published can be downloaded; any other week returns 0 records without a per-result charge.
monitorModebooleanWhen true, rows already delivered for the same bulletin week are skipped, so a monitor run without a new bulletin delivers 0 rows.
maxResultsintegerMaximum validated records to push. Default 100.
strictSchemabooleanFail the run if a record does not match the dataset schema. Keep enabled.

Fuel slugs map to the Commission columns: e95 = Euro-super 95, diesel = automotive gas oil, heating_gas_oil = gas oil de chauffage, fuel_oil = fuel oil with the lower sulphur column, fuel_oil_high_sulphur = the "> 1%" sulphur column, lpg = LPG motor fuel.

In spain mode the same e95, diesel and lpg slugs are reused, plus e95_premium, e98 and diesel_premium for the Spanish station columns. countries, series, week and monitorMode do not apply to the station API; maxResults still caps the number of validated station rows pushed.

Project structure

.actor/actor.json Actor definition (payPerEvent, dataset schema, output schema)
.actor/input_schema.json INPUT options (countries, fuels, series, week, monitor)
.actor/dataset_schema.json Item JSON Schema (fields) + table view for the Store
.actor/pay_per_event.json PPE pricing (two synthetic platform events)
src/bulletin-client.ts Landing page parsing, file classification, guarded download
src/robots.ts robots.txt parser and per-run allow check
src/workbook.ts exceljs XLSX reader (isolated from pure extraction)
src/countries.ts EU-27 ISO-2 and currency reference data
src/extract.ts Pure extraction: fuels, week, filters, units, dedupe keys
src/spain-client.ts Guarded client for the Spanish MICT station API
src/spain-extract.ts Pure Spain extraction: station x fuel rows, identity, location
src/s3-save.ts Bulletin-week and Spain daily snapshots to the Steadfetch bucket
src/dedupe.ts Pure cross-run dedupe state for the key-value store
src/validate-output.ts Ajv validator shared by the run and the tests
src/main.ts Entry point: robots, landing, download, parse, validate, push
test/ Offline Vitest suites and the real XLSX fixtures

Pay-per-event pricing

The Actor uses Apify pay-per-event pricing with the two synthetic platform events:

EventCharged whenPrice
apify-actor-starta run starts (synthetic, automatic)0.00005 USD per run (Apify-recommended default; includes 5 seconds of free compute)
apify-default-dataset-itema new, validated record is saved to the dataset (synthetic, automatic)0.001 USD per record = 1.00 USD per 1,000 results

There is no custom per-item event and no Actor.charge() call: the platform already charges apify-default-dataset-item per pushed item, so adding another event would bill users twice. Failed runs, rows outside the selected filters, missing source values and monitor duplicates are not charged per result. A monitor check that finds no new bulletin costs 0.00005 USD (the apify-actor-start event) and nothing per result.

The 1.00 USD per 1,000 price matches the leader of the fuelprices cluster (54 users in 30 days at 1.00 USD per 1,000) and stays inside Steadfetch's 1-10 USD band. There is no direct competitor for the official EU-wide series.

Works on the Apify free plan - about 4,999 results for the $5 monthly credit ((5.00 USD - 0.00005 USD run-start at the default 256 MB memory) / 0.001 USD per result).

Cost per 1,000 results

Measured locally on 2026-10-25 with the real Commission workbooks, without any platform run:

  • Files: 16,946 B (with taxes), 17,330 B (without taxes), 23,078 B (duties).
  • Parse all three workbooks: 95 ms (55.8 ms with taxes, 15.7 ms without, 23.4 ms duties).
  • Pure extraction of 115 + 115 + 390 records: 3.5 ms.
  • Peak resident memory: 114 MB, inside the 256 MB container limit.

A typical run downloads two small files and spends well under a second of compute. Even with a conservative bound of 10 seconds at 256 MB, the run-start event covers the first 5 seconds and the remaining compute is a fraction of a cent. Total cost is below 0.01 USD per 1,000 records, so the 1.00 USD per 1,000 price keeps a margin above 99%.

spain mode reads one ~3 MB JSON document and parses it in memory. The whole national list (about 12,000 stations, roughly 45,000-50,000 priced station-fuel rows) takes a few minutes of compute and no browser or proxy; per-row platform compute stays far below the 1.00 USD per 1,000 result price. Use maxResults (or the fuels filter) to keep a run to the rows you need.

Development

npm install
npm test # lint + typecheck + offline Vitest suites (no credit, no APIFY_TOKEN)
npm run publish:check # Steadfetch publish gate
npm run schemas:validate # apify-cli schema validation

The default test suite runs entirely offline against the committed 16-23 KB XLSX fixtures and never touches the Apify platform. It covers the spec example row (Spain 1780.47), the EU-27 average (1991.33), without-taxes and duties rows, VAT as a percentage, zero-valued taxes, national currencies, week normalisation, filters, maxResults, landing-page parsing, download guards, dedupe state, two-run monitor behaviour and output-schema validation.

FAQ

Does the Actor need a login or an API key? No. The bulletin page, the XLSX downloads and the Spanish station API are public and anonymous.

Which mode should I use? Use bulletin for EU-27 country-level weekly series and taxes. Use spain for today's price at every Spanish petrol station, brand and province comparisons, and a daily history per station.

How fresh are the Spanish station prices? The Ministry refreshes the national list every 30 minutes. Each run re-reads the live document, so the rows are as fresh as your run; scheduled runs also keep one daily snapshot per station for history.

Where is the Spanish daily history stored? Scheduled routine runs save the full snapshot to actors/eu-fuel-price-extractor/<YYYY-MM-DD>/spain.json in the Steadfetch bucket. Customer-triggered runs return the dataset only and never write to the bucket.

Does it need a browser? No. The source is a server-rendered page plus XLSX files, so plain HTTP plus an XLSX parser is far cheaper and faster than a browser.

Why is weekStart 2026-10-19 when the file name says 2026-09-21? The Commission keeps the old date in the link file name while the workbook content declares the current week in cell A2. The Actor reads the date inside the workbook, because that is the week the values belong to. sourceFile keeps the original file name so you can audit the link.

Why are duties in different currencies? The duties workbook states "in national currency per unit". The Actor reports the published value and its currency (for example CZK for Czechia) instead of converting it. Converting would require foreign-exchange rates the source does not publish. The weekly price series are always in EUR.

Why is pricePerLiter null for some rows? pricePerLiter only makes sense for volumes. Fuel oil is published per tonne and VAT is a percentage, so pricePerLiter is null there instead of an invented value.

Where is the Euro Area 20 average? Out of scope. The Commission also publishes a Euro Area 20 weighted average; this Actor covers EU-27 plus the EU-27 average, as declared in its scope.

How does monitor mode work? The Actor stores the (series, taxType, country, fuel, weekStart) key of every delivered record in the named key-value store eu-fuel-price-state, which persists between runs. A second run for the same week finds those keys and pushes nothing, so it is not charged per result. A new bulletin week starts with an empty set.

When am I charged? Once per run start (apify-actor-start) and once per new record saved to the dataset (apify-default-dataset-item). Failed runs, filtered-out rows, missing values and monitor duplicates are not charged per record.

Is the output schema stable? Yes. New fields are additive and the required fields in .actor/dataset_schema.json do not change.

Does it return personal data? No. It only returns country-level prices and tax rates.

Maintenance

This Actor is tested daily: automated runs check that the Commission bulletin page and workbooks are reachable and that the output still matches the published schema. Failures are reported as issues in the Steadfetch Actors repository. On every run the header, bulletin date, fuel columns and data rows are validated: if the layout cannot be found, the run fails loudly instead of returning an empty dataset.