Mexico Gas Prices API - CNE (Regular, Premium, Diesel)
Pricing
from $2.00 / 1,000 station prices
Mexico Gas Prices API - CNE (Regular, Premium, Diesel)
Current gasoline and diesel prices for ~13,800 gas stations in Mexico from the official CNE (ex-CRE) feed. Radius search, cheapest-first sort, GPS.
Pricing
from $2.00 / 1,000 station prices
Rating
0.0
(0)
Developer
TimeKast
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Mexico Gas Prices API - Official CNE Feed (Regular, Premium, Diesel)
Current gasoline and diesel prices for ~13,800 gas stations in Mexico, straight from the energy regulator's official open-data feed (CNE - Comisión Nacional de Energía, formerly CRE). Search around any point, sort by the cheapest fuel, export to JSON/CSV/Excel or use it from the API. No login, no browser: US$2.00 per 1,000 stations, and you pay only for stations delivered.
What data do you get?
One row per gas station:
- Prices in MXN per litre for regular (Magna), premium and diesel, as currently reported by the permit holder
- Regulator permit number (
PL/…/EXP/ES/…) and permit-holder name - Latitude / longitude, plus distance in km to your point
suspectPrices: obvious feed typos (e.g.0.01MXN) are moved out of the price fields and flagged, so they never pollute your averages- Source attribution and fetch timestamp
Use cases
- Fleets & logistics - cheapest diesel near depots or along routes.
- Fuel retailers - competitor price monitoring within X km of your stations.
- Analysts & media - national or regional price distributions and daily snapshots.
- Apps & AI agents - "cheapest premium near me" via the Apify API or MCP server.
- Scheduled monitoring - run daily with Apify Schedules and push to Google Sheets, a webhook or your database.
How to use it
- Set a point (latitude, longitude) and a radius in km - or remove the point to get the whole country.
- Choose fuels (regular, premium, diesel) and optionally filter by permit-holder name (e.g.
OXXO GAS,G500,PETRO 7). - Sort by distance or by the cheapest fuel, set Max stations, and run.
Input example
{"near": { "latitude": 19.4326, "longitude": -99.1332, "radiusKm": 5 },"fuelTypes": ["regular", "diesel"],"sortBy": "distance","maxItems": 500}
| Field | Description |
|---|---|
near | { latitude, longitude, radiusKm }. Omit for all stations in Mexico. |
fuelTypes | Any of regular, premium, diesel (default: all three). |
requireAllFuels | Only stations that report every selected fuel. |
nameContains | Permit-holder name contains this text. |
sortBy | distance (needs near), regular, premium or diesel (cheapest first). |
maxItems | Stop after N stations (0 = no limit). Default 500. |
Output sample
{"placeId": "13129","name": "OPERADORA DE MINIESTACIONES COMBUSERV SA DE CV","permitId": "PL/10909/EXP/ES/2015","latitude": 19.42713,"longitude": -99.1392,"regular": 23.99,"premium": 28.99,"diesel": null,"distanceKm": 0.875,"suspectPrices": [],"source": "Comisión Nacional de Energía (CNE/CRE) - precios vigentes reportados por permisionarios","fetchedAt": "2026-10-19T12:43:26.010Z"}
How much does it cost?
Pay per event - you pay only for station rows delivered (plus Apify's tiny standard start fee of US$0.00005 per run).
| Event | Price |
|---|---|
| Station price (one station row) | US$0.002 → US$2.00 per 1,000 stations |
Real runs (Oct 2026): 5 km around the Zócalo in Mexico City = 97 stations ≈ US$0.19 in ~4 s. The whole country (~13,800 stations with prices) ≈ US$27.70 in under 10 s. Use Max stations or Max cost per run to cap spending; the Actor stops cleanly at your budget.
Data quality
- The run fails loudly if the regulator feed is empty or changes format - you never pay for a broken "success".
- Prices outside a plausible range (below 10 or above 60 MXN/L) are flagged in
suspectPricesinstead of being returned as prices. RUN_STATSandQUALITY_REPORTare saved in the run's key-value store.
FAQ
How current are the prices? The feed contains the prices currently in force as reported by each permit holder to the regulator; run it whenever you need a fresh snapshot.
Why does a station have no diesel/premium? Not every station sells or reports every fuel; missing values are null. Use requireAllFuels to skip them.
Why is the name a company, not a brand? The regulator publishes the permit holder (legal entity). Brand names often appear in it (e.g. OXXO GAS), so nameContains works for most chains.
Is this legal? Yes - it uses the regulator's public open-data feed without login. The only names are those of businesses holding public permits. Not affiliated with CNE.
Can I call it from code or an AI agent? Yes - via the Apify API, JavaScript/Python clients, Make/Zapier/n8n or the Apify MCP server.
Found a problem? Open an issue in the Issues tab; we usually reply within 2 business days.
🇲🇽 Español
API de precios de gasolina en México - feed oficial CNE (regular, premium, diésel)
Precios vigentes de gasolina regular (Magna), premium y diésel de ~13,800 estaciones en México, desde el feed público oficial del regulador (CNE, antes CRE). Búsqueda por radio alrededor de cualquier punto, orden por el combustible más barato y exportación a JSON/CSV/Excel. Sin login: US$2.00 por cada 1,000 estaciones, y solo pagas lo que recibes.
¿Qué datos obtienes?
Una fila por estación: precios en MXN por litro (regular, premium, diésel), número de permiso y nombre del permisionario, latitud/longitud, distancia a tu punto y suspectPrices (errores evidentes del feed, como 0.01, se marcan y se quitan de los precios).
Casos de uso
- Flotillas y logística: diésel más barato cerca de bases o rutas.
- Gasolineros: monitoreo de precios de la competencia en un radio.
- Analistas y medios: distribución de precios nacional o regional, fotos diarias.
- Apps y agentes de IA: "la premium más barata cerca de mí".
Cómo usarlo
{ "near": { "latitude": 19.4326, "longitude": -99.1332, "radiusKm": 5 }, "fuelTypes": ["regular", "diesel"], "sortBy": "distance", "maxItems": 500 }
Quita near para todo el país. nameContains filtra por nombre del permisionario (p. ej. OXXO GAS).
Campos de salida
placeId, name, permitId, latitude, longitude, regular, premium, diesel, distanceKm, suspectPrices, source, fetchedAt.
Precio
Pago por evento: US$0.002 por estación (US$2.00 por 1,000) más la tarifa estándar de inicio de Apify (US$0.00005). Ejemplo real: 5 km alrededor del Zócalo = 97 estaciones ≈ US$0.19; todo el país ≈ US$27.70.
Preguntas frecuentes
¿Calidad? Si el feed viene vacío o cambia de formato, la ejecución falla con mensaje claro. ¿Es legal? Sí: usa el feed de datos abiertos del regulador, sin login; los únicos nombres son de empresas con permisos públicos. Sin afiliación con la CNE.