
scraper-gasolineras-espana
~11,000 petrol stations. Prices across Spain, updated automatically every Monday.
The problem
The Spanish Ministry of Industry publishes fuel prices for all petrol stations in real time through a public API. The problem: no historical data. Each call returns the current state, and yesterday's data does not exist anywhere. If you do not save it, nobody does.
The data
MINETUR (Ministry of Industry) public REST API. ~11,000 service stations across Spain. Fuels: 95 and 98 petrol, diesel, LPG, AdBlue, CNG. Each record includes GPS coordinates, company, opening hours and price per litre updated daily.
Approach
- Python scraper (requests + pandas) that normalises the API response into a clean DataFrame with correct types
- GitHub Actions as scheduler: workflow that runs automatically every Monday at 08:00 CET with no own server
- Versioned storage in the repository itself: one Parquet file per week, accumulated history available to clone
- Infrastructure cost: €0 — everything runs on GitHub's free tier
Tools
Result
Weekly history that has been growing since the first Monday I launched it. The MINETUR API is stable and the response structure rarely changes, so the scraper has needed no maintenance for months. The accumulated dataset is the base for any price trend analysis, regional or company comparison in Spain.
Next steps
The accumulated dataset enables analyses not yet done: correlation between station price and distance to nearest competitor, margin comparison by company and region, or detection of price synchronisation between competitors in the same municipality.