# Spain Fuel Prices ⛽ - Live Gas Station Prices (`tikitakaclaw/fuel-prices-es`) Actor

Real-time fuel prices from 11,500+ Spanish gas stations. Official government data updated every 30 minutes. 15+ fuel types. Perfect for logistics, comparators, route optimization.

- **URL**: https://apify.com/tikitakaclaw/fuel-prices-es.md
- **Developed by:** [TikitakaClaw Pikipiki](https://apify.com/tikitakaclaw) (community)
- **Categories:** Automation, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.20 / 1,000 station extracteds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Spain Fuel Prices ⛽

**Real-time fuel prices from 11,500+ Spanish gas stations** — official government data updated every 30 minutes. Filter by province, fuel type, and price range. Perfect for price comparators, logistics apps, route optimization, and consumer apps.

***

### What you get

For each gas station:

#### 📍 Location

- Full address, locality, municipality, province
- GPS coordinates (lat/lng, WGS84)
- Postal code, region ID

#### ⛽ Prices (15+ fuel types)

- **Gasoline 95** E5 (regular)
- **Gasoline 98** E5 (premium)
- **Gasoline 95 Premium**
- **Diesel A** (regular diesel)
- **Diesel B** (agricultural/heating)
- **Diesel Premium**
- **LPG** (autogas)
- **CNG** (compressed natural gas)
- **LNG** (liquefied natural gas)
- **AdBlue**
- **Biodiesel**, **Bioethanol**
- **Renewable diesel**
- **Hydrogen**, **Ammonia**, **Methanol**

#### 🕐 Schedule & Type

- Daily opening hours
- Public (P) vs Restricted (R) sales
- Roadside margin (D/I/N)

#### 🧪 Bio-content

- Bioethanol %
- Methyl ester %

***

### Input

```json
{
  "provinces": "Madrid,Barcelona,Valencia",
  "fuelTypes": "gasolina_95,gasoleo_a",
  "minPriceGasolina95": 1.40,
  "maxPriceGasolina95": 1.55,
  "includeCoords": true
}
```

#### Field reference

| Field | Type | Default | Description |
|---|---|---|---|
| `provinces` | string | `""` (all) | Comma-separated provinces. Case-insensitive. |
| `fuelTypes` | string | `gasolina_95,gasoleo_a` | Fuels to filter. Empty = all. |
| `minPriceGasolina95` | number | `0` | Min price €/L (0 = no filter) |
| `maxPriceGasolina95` | number | `0` | Max price €/L (0 = no filter) |
| `includeCoords` | boolean | `true` | Include GPS coordinates |

***

### Output examples

#### Station

```json
{
  "type": "station",
  "stationId": "4375",
  "brand": "Nº 10.935",
  "address": "AVENIDA CASTILLA LA MANCHA, 26",
  "locality": "ABENGIBRE",
  "municipality": "Abengibre",
  "province": "ALBACETE",
  "region": "07",
  "postalCode": "02250",
  "schedule": "L-D: 07:00-22:00",
  "salesType": "P",
  "margin": "D",
  "bioEthanolPercent": 0.0,
  "methylEsterPercent": 0.0,
  "prices": {
    "gasolina_95": 1.439,
    "gasoleo_a": 1.449
  },
  "coordinates": {
    "lat": 39.211417,
    "lng": -1.539167
  }
}
```

#### Metadata

```json
{
  "type": "metadata",
  "fetchedAt": "05/07/2026 22:59:41",
  "totalStations": 11523,
  "note": "Archivo de todos los productos en todas las estaciones...",
  "filter": {
    "provinces": ["ALBACETE"],
    "fuels": ["gasolina_95", "gasoleo_a"],
    "minPriceGasolina95": 0,
    "maxPriceGasolina95": 0
  }
}
```

***

### Pricing

**Pay per event:**

| Event | Cost |
|---|---|
| Station | $0.0002 |
| Metadata | Free (one per run) |

> ℹ️ Apify's platform usage (CU) is **passed through** — no markup.

**Example:** Tracking all 11,500 stations = $2.30 per run. Daily scheduler = **$69/month per user**. With province filter (Madrid only = ~600 stations) = **$3.60/month**.

***

### Use cases

1. **📊 Price comparator apps** — show cheapest stations in user's area
2. **🚛 Logistics & fleet management** — find cheapest fuel along routes
3. **📈 Market research** — analyze price variations by region/brand
4. **💰 Personal finance apps** — track cheapest fuel for users
5. **🤖 Telegram/Discord bots** — "find me cheap diesel near Madrid"
6. **📰 News/journalism** — daily fuel price reports for media
7. **🤖 LLM training data** — Spanish fuel market analysis
8. **🚗 Route planners** — integrate fuel stops into trip planning

***

### Data source

**Official Spanish government API** (Ministerio para la Transición Ecológica y el Reto Demográfico):

- Updated every 30 minutes
- Covers 11,500+ stations across 52 provinces, 19 autonomous communities
- 15+ fuel types tracked
- Free and public (no authentication required)

***

### Technical notes

- **API:** `sedeaplicaciones.minetur.gob.es`
- **No authentication required**
- **Response size:** ~12 MB JSON
- **Build time:** ~30s
- **Memory:** 256 MB typical (large dataset)
- **Runtime:** 5-10 seconds per run

***

### Changelog

- **0.1.0** (2026-07-05) — Initial release. All 11,500+ stations, 15+ fuel types, filters.

***

### Support

- 🐛 Report issues: Apify Console → this Actor → Issues tab
- 💬 Questions: [Apify Discord](https://discord.com/invite/jyEM2PRvMU)
- 📧 Author: [@tikitakaclaw](https://apify.com/tikitakaclaw) on Apify

***

### License

MIT License. Data from Spanish government open data portal (datos.gob.es). Free to use.

# Actor input Schema

## `provinces` (type: `string`):

Comma-separated list of provinces to include (e.g. 'Madrid,Barcelona'). Empty = all Spain.

## `fuelTypes` (type: `string`):

Comma-separated list of fuels. Available: gasolina\_95, gasolina\_98, gasoleo\_a, gasoleo\_b, gasoleo\_premium, glp, gnc, hidrogeno. Empty = all.

## `minPriceGasolina95` (type: `number`):

Only stations with Gasolina 95 price >= this (in €/liter). 0 = no filter.

## `maxPriceGasolina95` (type: `number`):

Only stations with Gasolina 95 price <= this (in €/liter). 0 = no filter.

## `includeCoords` (type: `boolean`):

Add latitude/longitude to each station (useful for maps, route planning).

## `proxyConfiguration` (type: `object`):

If the Spanish government API blocks your region, enable Apify's datacenter proxy.

## Actor input object example

```json
{
  "provinces": "",
  "fuelTypes": "gasolina_95,gasoleo_a",
  "minPriceGasolina95": 0,
  "maxPriceGasolina95": 0,
  "includeCoords": true,
  "proxyConfiguration": {
    "useApifyProxy": false,
    "apifyProxyGroups": [
      "DATACENTER"
    ]
  }
}
```

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": false,
        "apifyProxyGroups": [
            "DATACENTER"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tikitakaclaw/fuel-prices-es").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 = { "proxyConfiguration": {
        "useApifyProxy": False,
        "apifyProxyGroups": ["DATACENTER"],
    } }

# Run the Actor and wait for it to finish
run = client.actor("tikitakaclaw/fuel-prices-es").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "proxyConfiguration": {
    "useApifyProxy": false,
    "apifyProxyGroups": [
      "DATACENTER"
    ]
  }
}' |
apify call tikitakaclaw/fuel-prices-es --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=tikitakaclaw/fuel-prices-es",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/15VLM8AWpehEwsTfO/builds/GasMk233nNhwy2lHB/openapi.json
