Citymapper APIcitymapper.com ↗
Access real-time transit arrivals, service status, line details, and nearby stops for major cities worldwide via the Citymapper API.
What is the Citymapper API?
This API provides real-time transit data from Citymapper across 7 endpoints covering supported cities worldwide. Use get_stop_arrivals to fetch live departure ETAs grouped by line and direction, get_city_service_status to retrieve disruption details across all transit modes in a region, and get_nearby_transit to find stops within walking distance of any coordinate pair.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/75a88626-7f26-4a10-ac53-922ad6ca5740/get_supported_cities' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace citymapper-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""
Citymapper Transit API - Real-time disruption monitoring
Discover supported cities, check service status, search transit lines,
and get real-time arrivals using the typed SDK.
Get your API key from: https://parse.bot/settings
"""
from parse_apis.citymapper_api import Citymapper, City, LineMatch, TransitStop, RegionId
client = Citymapper()
# List all supported cities
for city in client.cities.list():
print(city.name, city.region_id, city.country)
# Construct a city by its region_id and check service status
london = client.city(region_id="uk-london")
status = london.service_status()
print(status.last_updated_time)
for grouping in status.groupings:
print(grouping.name)
for route in grouping.routes:
print(route.name, route.status.summary, route.status.level)
# Search for a line within a city
for match in london.search_lines(query="Central"):
print(match.name, match.route_id, match.brand, match.mode, match.status)
# Get detailed line info including all stops and patterns
details = match.details(region_id=RegionId.UK_LONDON)
for detailed_route in details.routes:
print(detailed_route.name, detailed_route.brand)
for pattern in detailed_route.patterns:
print(pattern.name, pattern.id)
# Check alerts for this line
line_alerts = match.alerts(region_id=RegionId.UK_LONDON)
for alert in line_alerts.alerts:
print(alert.summary, alert.level, alert.description)
# Find nearby transit stops by coordinates
for stop in london.nearby_transit(lat=51.5072, lon=-0.1276):
print(stop.name, stop.id, stop.walk_time_seconds, stop.route_names)
# Get real-time arrivals at this stop
arrivals = stop.arrivals(region_id=RegionId.UK_LONDON)
print(arrivals.last_updated_time)
for station_dep in arrivals.stations:
print(station_dep.station.name, station_dep.station.coords)
for section in station_dep.sections:
for grouping in section.departure_groupings:
print(grouping.direction_name)
for dep in grouping.departures:
print(dep.destination_name, dep.time_seconds, dep.route_id)
Get the list of major cities supported by Citymapper. Each city includes a region_id used as a required parameter for all other endpoints, a slug, name, and country. The list is curated to major metro areas with active transit coverage.
No input parameters required.
{
"type": "object",
"fields": {
"cities": "array of city objects with name, slug, region_id, and country"
},
"sample": {
"data": {
"cities": [
{
"name": "London",
"slug": "london",
"country": "UK",
"region_id": "uk-london"
},
{
"name": "New York",
"slug": "nyc",
"country": "US",
"region_id": "us-nyc"
}
]
},
"status": "success"
}
}About the Citymapper API
City and Line Discovery
Start with get_supported_cities to retrieve the full list of covered cities, each returning a name, slug, region_id, and country. The region_id (e.g. uk-london, us-nyc) is the key input parameter for every other endpoint. From there, search_lines accepts a free-text query and a region_id to return matching route objects including name, route_id, brand, mode, and current status — useful for resolving a line name to its canonical ID before querying deeper endpoints.
Service Status and Alerts
get_city_service_status returns a groupings array organized by transit mode, where each group contains routes with status metadata and a last_updated_time ISO 8601 timestamp. When you need per-line disruption detail, get_line_service_alerts returns an alerts array with level, summary, description, and optionally affected_stops for a specific route_id. When no disruptions are active, the alerts array is empty.
Stop-Level and Route-Level Data
get_line_details takes a route_id and region_id and returns a stops object mapping stop IDs to coordinates and route connections, plus a routes array containing patterns and stop sequences. Stop IDs follow a CamelCase format (e.g. OxfordCircus, KingsCross) and feed directly into get_stop_arrivals, which returns a stations array with departures grouped by line and direction alongside a last_updated_time timestamp.
Proximity Queries
get_nearby_transit accepts lat, lon, and region_id coordinates and returns an elements array of nearby stops, each with name, coordinates, route information, and a walk_time_seconds value — suitable for location-aware transit tooling without requiring a known stop ID in advance.
The Citymapper API is a managed, monitored endpoint for citymapper.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when citymapper.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official citymapper.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Display real-time departure boards for a specific station using get_stop_arrivals grouped by line and direction.
- Build a city transit health dashboard using get_city_service_status groupings to surface active disruptions across all modes.
- Power a map layer of nearby transit stops with walk times using get_nearby_transit elements coordinates and walk_time_seconds.
- Send push alerts for a user's commute line by polling get_line_service_alerts for a specific route_id.
- Resolve user-entered line names to route IDs programmatically using search_lines before querying line-level endpoints.
- Render a full route map with stop coordinates and interchange connections using get_line_details stops and routes.
- List all supported cities and their region IDs to populate a city picker UI using get_supported_cities.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Citymapper have an official developer API?+
What does get_stop_arrivals return, and how are departures organized?+
stations array where each station object contains departures grouped by transit line and direction, along with a last_updated_time ISO 8601 timestamp. Stop IDs must be in CamelCase format (e.g. KingsCross, OxfordCircus) and can be obtained from the stops keys returned by get_line_details.