Mexico Gas Prices by Station: Gasoline, Diesel (CNE, daily)
Pricing
from $2.00 / 1,000 station price rows
Mexico Gas Prices by Station: Gasoline, Diesel (CNE, daily)
Daily retail gasoline (regular, premium) and diesel prices for every gas station in Mexico reported to the CNE, in MXN, USD and EUR, with station location, state and municipality. Daily archive since 2026-10-25, updated weekly. API and AI-agent (MCP) ready.
Pricing
from $2.00 / 1,000 station price rows
Rating
0.0
(0)
Developer
Lucas Huber Pissaia
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
7 hours ago
Last modified
Categories
Share
What does it do?
Returns daily retail fuel prices per gas station in Mexico, from the price file that every fuel permit holder reports to the national energy commission (CNE): regular gasoline, premium gasoline and diesel, one row per station, product and day (about 37,000 station prices a day from about 13,800 stations in all 32 states), in one clean schema with prices in MXN, USD and EUR, the station's coordinates and its official state and municipality (INEGI). The CNE feed shows only the current day and keeps no history, so this archive starts on the first day it was captured, 25 October 2026, and grows every day. Use it as an API, schedule it, or call it as an MCP tool from an AI agent (see "Use with AI agents (MCP)").
Data last updated: 30 October 2026 (latest prices in the data: day 29 October 2026; CNE feed captured up to 30 Oct 2026; the RUN_SUMMARY of every run carries data_build_date and data_until). Refreshed weekly, daily granularity.
Palabras clave: precios de gasolina por estación y municipio, precios de gasolina regular, premium y diésel en México, CNE, Comisión Nacional de Energía.
Try before you pay: the municipality-level prices (median, quartiles, minimum and maximum by municipality, product and day) and the daily coverage table, with the rejected-row counts, are a free dataset on Hugging Face: https://huggingface.co/datasets/pracadata/mexico-fuel-prices. Check the schema, the coverage notes and the quality there, then come back for the per-station rows and the API. The Brazilian equivalent (weekly, ANP) is pracadata/brazil-fuel-prices.
Read this first: coverage and limitations
- Short history. The archive starts on 25 October 2026, the first day this project captured the CNE feed. There is no earlier history and none can be reconstructed. A few days of data show no trend: do not read one into them.
- Prices are reported by the permit holders and are not audited. The CNE publishes what each station reports. Typing errors and stale prices exist. Do not use the data as an official price reference.
- Rejected rows. Every day about 19 price rows are dropped for being outside 5 to 60 MXN per litre (so far all filler values such as
0.01or1), and about 20 rows from stations that report two different prices for the same product on the same day (none of the two is kept, because there is no way to know which is right). About 111 exact duplicates a day are collapsed into one row (the price stays). The counts per day are in the free Hugging Face dataset (fuel_coverage_daily_mx). - About 0.6% of the stations in the CNE registry have no municipality (wrong coordinates at the source:
0, 0, empty or far from any municipality). Almost all of them report no price. Among the stations with a price, about 4 a day (0.03%) havegeo_flagno_municipalityand null state and municipality; their rows are still returned. A state or municipality filter leaves those rows out. - The state and municipality of a station are derived by us from the station's coordinates (point in polygon on the INEGI municipal boundaries, December 2025), not reported by the CNE. A station with wrong coordinates can land in the wrong municipality. Ciudad de México is split by INEGI into 16 alcaldías, each one a municipality here.
- Sale price to the public only (price at the pump, MXN per litre). No purchase price and no other fuels (no LPG, no CNG).
- The day of a price (
reference_date). The CNE updates the feed once a day at 18:00 Mexico City time (UTC-6). A price file captured between 18:00 on day D and 17:59 on day D+1 is day D (reference_date = date(capture time in UTC-6 − 18 hours)); if several versions were captured in that window, the last one wins. - Nominal pesos. USD and EUR are indicative conversions at the ECB reference rate of the previous business day.
Why use it?
- Prices at the pump, by station, with a history that does not exist anywhere else. The CNE shows today's prices and forgets yesterday's; this archive keeps every day it captures, with the duplicates and filler values of the feed resolved by explicit rules.
- Location and administrative codes ready to join. Latitude, longitude, state and municipality (INEGI codes) on every row.
- USD and EUR next to MXN at the ECB reference rate of the previous business day. The rates themselves are never returned.
- Follow the same station over time with
station_id(the CNE permit id), or compare municipalities and states by day.
What data can it return?
One dataset, one row per gas station × product × day:
| Field | Meaning |
|---|---|
reference_date | Day of the price (YYYY-MM-DD), the CNE feed day (see above) |
station_id | CNE permit id of the station, for example CNE/PL/138/EXP/ES/2025 |
lat, lon | Station coordinates as reported to the CNE (WGS84) |
state, state_code | Official INEGI state name and 2-digit code |
municipality, municipality_code | Official INEGI municipality name and 5-digit code |
product | gasoline (regular), gasoline_premium or diesel |
price_mxn, price_usd, price_eur | Price per litre in each currency, always present |
price, price_currency | The price in the currency chosen with currency (default USD), and which one |
geo_flag | ok, invalid_coords or no_municipality (the price is kept in all cases) |
source | The literal citation on every row: Fuente: Comisión Nacional de Energía (CNE), precios reportados por los permisionarios (Acuerdo A/041/2018), with the link to the CNE page |
No station name, no permit holder's name, no address and no exchange rate in the output. All prices are MXN per litre.
How to use it
- Add filters:
state,municipality,product,station_id, dates. All are optional. - Without dates you get the latest 7 days of the data.
date_fromanddate_totake any day (inclusive). - Set Maximum rows (default 10,000, ceiling 1,000,000). Rows are charged one by one, so this is also your cost cap.
- Run it and download the dataset as JSON, CSV or Excel, or read it through the API.
state takes the official INEGI name, ignoring case and accents (Nuevo Leon), the abbreviation (CDMX, NL, BC, Jal.), a common short name (Coahuila, Veracruz, Michoacán, Edomex) or the 2-digit code (09). Note that México is the state around the capital; the capital is Ciudad de México or CDMX. municipality takes the official INEGI name (ignoring case, accents and punctuation) or the 5-digit code (14039 = Guadalajara). A state or municipality that does not exist is refused. Several municipalities share a name (there are 7 Benito Juárez): add state, or the run covers all of them (RUN_SUMMARY.matched_municipalities says how many).
Input examples
Each example below was run against the current data (days 25 to 29 October 2026). Row counts and cost (US$ 2 per 1,000 rows) are noted; the Pricing tab is authoritative.
Regular gasoline at every station in Ciudad de México, the last 3 days (1,160 rows, about US$ 2.32):
{ "state": ["CDMX"], "product": ["gasoline"], "date_from": "2026-10-27", "max_rows": 2000 }
Diesel in Guadalajara, Jalisco, the latest 7 days (350 rows, about US$ 0.70):
{ "municipality": ["Guadalajara"], "state": ["Jalisco"], "product": ["diesel"], "max_rows": 1000 }
Premium gasoline in Nuevo León, the latest day only (711 rows, about US$ 1.42):
{ "state": ["NL"], "product": ["gasoline_premium"], "date_from": "2026-10-29", "max_rows": 1000 }
Gasoline in Tijuana since the start of the archive, with the price column in euros (1,220 rows, about US$ 2.44):
{ "municipality": ["Tijuana"], "state": ["Baja California"], "product": ["gasoline"], "date_from": "2026-10-25", "currency": "EUR", "max_rows": 2000 }
Every station in the country, one day (37,276 rows, about US$ 74.55):
{ "date_from": "2026-10-29", "date_to": "2026-10-29", "max_rows": 40000 }
Follow one station over time by its permit id (10 rows, about US$ 0.02):
{ "station_id": ["CNE/PL/138/EXP/ES/2025"], "date_from": "2026-10-25", "max_rows": 100 }
Output example
{ "reference_date": "2026-10-27", "station_id": "CNE/PL/633/EXP/ES/2026", "lat": 19.36326, "lon": -99.19012, "state": "Ciudad de México", "state_code": "09","municipality": "Benito Juárez", "municipality_code": "09014", "product": "gasoline", "price_mxn": 23.97, "price_usd": 1.2862, "price_eur": 1.1535, "price": 1.2862,"price_currency": "USD", "geo_flag": "ok","source": "Fuente: Comisión Nacional de Energía (CNE), precios reportados por los permisionarios (Acuerdo A/041/2018), https://www.cne.gob.mx/ConsultaPrecios/GasolinasyDiesel/GasolinasyDiesel.html" }
Use with AI agents (MCP)
The Apify MCP server lets an AI agent find this Actor in the Store, read its input schema and call it as a tool. The agent discovers it with search-actors and fetch-actor-details, runs it with call-actor (the run's maxTotalChargeUsd goes in callOptions, not in the Actor input) and reads the rows with get-dataset-items. Running Actors needs an Apify account; searching and reading details does not.
Connect. The hosted server is https://mcp.apify.com (sign-in through the browser, OAuth). To give the agent this Actor as its own tool, add it to the tools parameter:
https://mcp.apify.com?tools=pracadata/mexico-fuel-prices
- Claude (Desktop or web): Settings → Connectors → Add custom connector, paste the URL above, sign in to Apify.
- Cursor, VS Code and other clients with an
mcpServersfile:
{"mcpServers": {"apify": { "url": "https://mcp.apify.com?tools=pracadata/mexico-fuel-prices" }}}
Without a browser (servers, CI), use a token instead: add "headers": { "Authorization": "Bearer <APIFY_TOKEN>" } next to url. The Apify docs also describe a configurator at https://mcp.apify.com and the CLI command apify mcp install <client>.
What an agent should know. Always set max_rows (it caps the cost) and a small maximum charge per run: one day for the whole country is 37,000 rows (US$ 74). Use state by name, abbreviation or code, municipality by name or 5-digit code, and station_id to follow a station. The data is updated weekly with daily granularity; read RUN_SUMMARY.data_until for how recent it is, and note that the history is short (it starts on 2026-10-25). For municipality-level statistics, the free Hugging Face dataset is smaller and cheaper (see "Try before you pay").
| Question | Input (fields) | Rows | Cost | Suggested max charge |
|---|---|---|---|---|
| "What does regular gasoline cost in Ciudad de México over the last 3 days, in dollars?" | state CDMX, product gasoline, date_from 2026-10-27. Read price_usd | 1,160 | US$ 2.32 | US$ 3 |
| "Diesel prices in Guadalajara over the last 7 days" | municipality Guadalajara, state Jalisco, product diesel | 350 | US$ 0.70 | US$ 1 |
| "Where is premium gasoline cheapest in Nuevo León today?" | state NL, product gasoline_premium, date_from the latest day. Sort by price_mxn | 711 | US$ 1.42 | US$ 2 |
| "Did this station change its price?" | station_id, date_from 2026-10-25 | (varies) | US$ 2 per 1,000 rows | US$ 1 (cap with max_rows) |
The first question as the exact input an agent sends:
{ "state": ["CDMX"], "product": ["gasoline"], "date_from": "2026-10-27", "currency": "USD", "max_rows": 1500 }
Pricing
Pay per event. There is one event, and rows are charged before they are delivered.
| Event | When | Price |
|---|---|---|
station-price-row | each row returned | US$ 2 per 1,000 rows |
Rows are charged in batches, and the Actor stops when your maximum charge per run is reached: you never get a row you were not charged for, and you are never charged for a row you did not get. RUN_SUMMARY says so (stopped_by_spending_limit, and charged, the events actually charged). The default is the latest 7 days with data, about 186,000 rows (US$ 373), so set max_rows and your maximum charge on purpose.
Privacy
Each row carries the CNE permit id (station_id) and the coordinates (lat, lon) of a gas station, as the CNE publishes them in its price file. These identify a business establishment; some stations are run by a sole trader, so the establishment can point to a person. The rows contain no names (neither the station's nor the permit holder's), no addresses, no tax ids and no data about customers. Treat the data as public business records and do not use it to identify, locate or contact individuals. Removal requests and data-protection questions go to lucashpissaia@gmail.com.
Source and attribution
- Fuente: Comisión Nacional de Energía (CNE), precios reportados por los permisionarios (Acuerdo A/041/2018). The price file that the permit holders must report under agreement A/041/2018 of the Comisión Reguladora de Energía, published by the CNE: https://www.cne.gob.mx/ConsultaPrecios/GasolinasyDiesel/GasolinasyDiesel.html. Every row carries this citation in
source. - Fuente: INEGI, Marco Geoestadístico, diciembre de 2025. Municipal boundaries, names and codes, used under the INEGI "Términos de Libre Uso de la Información" (commercial use allowed with credit to INEGI as author): https://www.inegi.org.mx/inegi/terminos.html. The assignment of each station to a municipality is our own derived work, not an INEGI product, and INEGI has not endorsed it.
- Fuente: Banco Central Europeo, euro reference exchange rates (used for
price_usdandprice_eur). The rates are never returned.
Licence and terms
- Source terms. This is official public data of the Mexican government, redistributed with attribution. The CNE page publishes no licence or terms of use for the price file. Check the source terms for your use, and cite the sources above if you publish.
- Unofficial. This Actor is a derived, unofficial work and is not affiliated with, endorsed by or approved by the CNE or INEGI. Do not use it as a regulated price reference without checking the CNE.
- Use: internal use (your own analysis, models, reports and products built on top of the data). Do not resell or redistribute the raw rows in volume or as a substantially similar dataset or API.
- No warranty: the data is provided as is, from public sources, with the limitations above. It is not an appraisal and not official.
- Withdrawal: if the CNE or INEGI restrict the reuse of their data, the Actor may be withdrawn. Takedown requests:
lucashpissaia@gmail.com.
Known limitations
- Short history, from 2026-10-25 on. Earlier dates return no rows.
- Reported, not audited prices (see "Read this first"); obvious filler values and conflicting reports are rejected, other errors may remain.
- Municipality is derived from the coordinates, and about 0.03% of the stations with a price have none (
geo_flagno_municipality); a geographic filter leaves them out. - Currencies.
price_usdandprice_euruse the ECB reference rate of the previous business day, or the latest one in the 7 days before it (USD/MXN is a cross rate), and are null when no such rate exists. They are indicative conversions of the pump price; the rate is not returned. - Prices are nominal. No inflation adjustment.
- One price per station and product per day: the last version of the CNE file captured in the day window.
- A day without a new capture has no rows. The capture stores a version only when the CNE file changes; the feed has changed every day so far.
FAQ and support
How fresh is the data? The CNE updates its file daily at 18:00 Mexico City time; the data here is refreshed weekly, with daily granularity. RUN_SUMMARY.data_until is the last day with data and data_build_date is when this build was made.
Can I get everything? Yes: set max_rows to 1,000,000 and page by date range. One day is about 37,000 rows.
Is there a free sample? Yes, the municipality-level prices on Hugging Face (see "Try before you pay").
Can I use it from an AI agent? Yes. Pay-per-event Actors are available as MCP tools on Apify; the input fields above are the tool arguments. See "Use with AI agents (MCP)".
Found a problem or need another field? Use the Issues tab.