Apimetro (Mexico City) API
Free Mexico City transport API with no key: stations, lines and interchanges across Metro, Metrobús, Tren Ligero and Cablebús with GTFS stop ids. Tested example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the Apimetro (Mexico City) API?
Apimetro is a free, key-free API covering Mexico City's public transport systems — Metro, Metrobús, Tren Ligero, Trolebús and Cablebús. It returns stations by name or line, with the borough they sit in, the line they belong to and the GTFS stop identifier that links them to the published feed.
Mexico City runs one of the busiest metro networks in the world alongside several parallel systems, and Apimetro brings them into one query surface: the `sistema` field on every record says which system a station belongs to, so a search for a name returns matches across Metro, Metrobús and Cablebús together rather than requiring separate lookups.
The example searching for Pantitlán makes the interchange model clear — four records come back, one per line serving it, each with its own `estacion_id`, `linea_id` and position in the line's sequence. That is the correct representation for a station where the platforms are genuinely separate, but it means deduplication is your job when listing stations by name. One honest caveat: the `latitud` and `longitud` fields on this table are zero. Station geometry lives in the API's separate GeoJSON endpoints, not here.
Quick facts
- Base URL
https://apimetro.dev/movilidad- Authentication
- No API key or account. Community project built on Mexico City open mobility data.
- Rate limit
- No published quota. The dataset is static reference data, so cache it rather than querying repeatedly.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the Apimetro (Mexico City) API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Search Mexico City stations by name across every system
GET https://apimetro.dev/movilidad/METRO/estacion?nombre=Pantitl%C3%A1n
curl 'https://apimetro.dev/movilidad/METRO/estacion?nombre=Pantitl%C3%A1n'const res = await fetch("https://apimetro.dev/movilidad/METRO/estacion?nombre=Pantitl%C3%A1n");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://apimetro.dev/movilidad/METRO/estacion?nombre=Pantitl%C3%A1n", timeout=20)
res.raise_for_status()
print(res.json())[
{
"estacion_id": 12115,
"nombre": "Pantitlán",
"cve_est": "0.0",
"tipo": "Superficie",
"alcaldia_municipio": "Iztacalco",
"anio": "0.0",
"estado_ciudad": "Ciudad de México",
"longitud": 0,
"latitud": 0,
"linea_id": 85,
"num_estacion": 1,
"estacion_id_oficial": 0,
"sistema": "METRO",
"existe": true,
"stop_gtfs": "B_0200LA-PANTITLAN",
"es_cetram": false
},
{
"estacion_id": 12058,
"nombre": "Pantitlán",
"cve_est": "0.0",
"tipo": "Superficie",
"alcaldia_municipio": "Venustiano Carranza",
"anio": "0.0",
"estado_ciudad": "Ciudad de México",
"longitud": 0,
"latitud": 0,
"linea_id": 90,
"num_estacion": 13,
"estacion_id_oficial": 0,
"sistema": "METRO",
"existe": true,
"stop_gtfs": "B_0200L5-PANTITLAN",
"es_cetram": false
},
{
"estacion_id": 11990,
"nombre": "Pantitlán",
"cve_est": "0.0",
"tipo": "Superficie",
"alcaldia_municipio": "Venustiano Carranza",
"anio": "0.0",
"estado_ciudad": "Ciudad de México",
"longitud": 0,
"latitud": 0,
"linea_id": 191,
"num_estacion": 20,
"estacion_id_oficial": 0,
"sistema": "METRO",
"existe": true,
"stop_gtfs": "B_0200L1-PANTITLAN",
"es_cetram": false
},
{
"estacion_id": 12103,
"nombre": "Pantitlán",
"cve_est": "0.0",
"tipo": "Superficie",
"alcaldia_municipio": "Iztacalco",
"anio": "0.0",
"estado_ciudad": "Ciudad de México",
"longitud": 0,
"latitud": 0,
"linea_id": 86,
"num_estacion": 1,
"estacion_idParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sistema | path | Required | Transport system: `METRO`, `METROBUS`, `TRENLIGERO`, `TROLEBUS` or `CABLEBUS`. METRO |
nombre | query | Optional | Station name to search for. Accents must be URL-encoded. Pantitlán |
(estacion) | path | Optional | `/{sistema}/estacion` is the station search endpoint. estacion |
(linea) | path | Optional | Line endpoints return the stations of a line in order. |
(geojson) | path | Optional | Separate GeoJSON endpoints carry station and line geometry, which the station table does not. |
Response fields
estacion_idinteger- Identifier for this station on this line. An interchange has one per line, not one overall.
nombrestring- Station name with correct accents.
sistemastring- Which system the record belongs to — METRO, METROBUS, CABLEBUS and so on.
linea_idinteger- Internal line identifier. Join to the line endpoints for the public line name.
num_estacioninteger- Position of the station in that line's sequence.
alcaldia_municipiostring- Borough or municipality the station sits in.
estado_ciudadstring- State or city — most stations are "Ciudad de México", but the network reaches Estado de México.
tipostring- Station construction type: `Superficie` (surface), `Subterránea` (underground) or `Elevada`.
stop_gtfsstring- GTFS stop identifier, which is what links this record to the published timetable feed.
es_cetramboolean- Whether the station is a CETRAM multi-modal interchange hub.
latitud / longitudfloat- Present but zero on this table. Use the GeoJSON endpoints for real geometry.
What you can build with the Apimetro (Mexico City) API
- Build a Mexico City station finder spanning every transport system
- Identify interchanges by grouping records that share a name
- Filter stations by borough for local guides or delivery zones
- Join to the GTFS feed using the stop identifier
- Flag CETRAM hubs where multi-modal transfers are possible
Common errors and how to fix them
Coordinates are 0, 0
The station table does not carry geometry.
Fix: Use the API's separate GeoJSON endpoints for station and line positions. Do not plot the zeros — they land in the Gulf of Guinea.
The same station appears several times
Interchanges have one record per line.
Fix: Deduplicate on `nombre` when listing stations, and keep the per-line records when you need the network graph.
Accented names return nothing
The query string must be URL-encoded.
Fix: Encode the parameter — Pantitlán becomes `Pantitl%C3%A1n`. Sending raw accented characters fails in some clients.
Some fields hold "0.0" as text
`cve_est` and `anio` are placeholder strings in parts of the dataset.
Fix: Treat them as absent. The populated fields — name, line, borough, GTFS id — are the reliable ones.
Apimetro (Mexico City) API — frequently asked questions
Is Apimetro free?
Yes, free with no key or account. It is a community project built on Mexico City's open mobility data.
Which systems does it cover?
Metro, Metrobús, Tren Ligero, Trolebús and Cablebús. The `sistema` field on every record identifies which, so one search spans the whole city network.
Why does an interchange return several records?
Because each line serving it gets its own record, with its own station id and sequence position. That is accurate for a station where the platforms are physically separate, but it means you must deduplicate by name when presenting a station list.
Where are the station coordinates?
Not on this table — `latitud` and `longitud` are zero here. The API exposes station and line geometry through separate GeoJSON endpoints, which is where mapping data belongs.
Tools that pair with this API
URL Encoder
Percent-encode text for URLs instantly. Switch between encodeURIComponent and encodeURI modes, see live output and copy the result. Free URL encoder.
JSON to CSV Converter
Convert a JSON array of objects to CSV online. Automatic column headers from the union of all keys, delimiter choice and proper quoting — all in-browser.
GeoJSON Validator
Validate GeoJSON against RFC 7946 and get the exact JSON path of every problem: unclosed rings, swapped coordinates, missing properties and more.
Apimetro (Mexico City) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.