# 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, 0 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Spain Fuel Prices ⛽ - Live Gas Station Prices",
        "description": "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.",
        "version": "0.4",
        "x-build-id": "1aiIcF6Vs7rSWUr7M"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tikitakaclaw~fuel-prices-es/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tikitakaclaw-fuel-prices-es",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/tikitakaclaw~fuel-prices-es/runs": {
            "post": {
                "operationId": "runs-sync-tikitakaclaw-fuel-prices-es",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/tikitakaclaw~fuel-prices-es/run-sync": {
            "post": {
                "operationId": "run-sync-tikitakaclaw-fuel-prices-es",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "provinces": {
                        "title": "Provinces (filter)",
                        "type": "string",
                        "description": "Comma-separated list of provinces to include (e.g. 'Madrid,Barcelona'). Empty = all Spain.",
                        "default": ""
                    },
                    "fuelTypes": {
                        "title": "Fuel types to include",
                        "type": "string",
                        "description": "Comma-separated list of fuels. Available: gasolina_95, gasolina_98, gasoleo_a, gasoleo_b, gasoleo_premium, glp, gnc, hidrogeno. Empty = all.",
                        "default": "gasolina_95,gasoleo_a"
                    },
                    "minPriceGasolina95": {
                        "title": "Min price Gasolina 95 (€)",
                        "minimum": 0,
                        "maximum": 5,
                        "type": "number",
                        "description": "Only stations with Gasolina 95 price >= this (in €/liter). 0 = no filter.",
                        "default": 0
                    },
                    "maxPriceGasolina95": {
                        "title": "Max price Gasolina 95 (€)",
                        "minimum": 0,
                        "maximum": 5,
                        "type": "number",
                        "description": "Only stations with Gasolina 95 price <= this (in €/liter). 0 = no filter.",
                        "default": 0
                    },
                    "includeCoords": {
                        "title": "Include GPS coordinates",
                        "type": "boolean",
                        "description": "Add latitude/longitude to each station (useful for maps, route planning).",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration (optional)",
                        "type": "object",
                        "description": "If the Spanish government API blocks your region, enable Apify's datacenter proxy.",
                        "default": {
                            "useApifyProxy": false,
                            "apifyProxyGroups": [
                                "DATACENTER"
                            ]
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
