Multimodal bike + transit routing.
The Modemix API computes directions that combine biking and public transit. Give it an origin and destination, and get the optimal step-by-step multimodal directions.
Get an API keyhttps://api.modemix.ioAll requests require an API key via the x-api-key header.
curl -X POST https://api.modemix.io/route \
-H "x-api-key: mmx_your_key_here" \
-H "Content-Type: application/json" \
-d '{ ... }'Calculate optimal bike + transit routes between two points.
{
"origin": { "latitude": 37.7749, "longitude": -122.4194 },
"destination": { "latitude": 37.8044, "longitude": -122.2712 },
"leave_after": 1700000000,
"arrive_by": null,
"bike_speed_mps": 5.0,
"walk_speed_mps": 1.4,
"region_id": "bay_area"
}| Field | Type | Default |
|---|---|---|
origin | { latitude, longitude } | required |
destination | { latitude, longitude } | required |
leave_after | unix timestamp | now |
arrive_by | unix timestamp | null |
bike_speed_mps | float | 5.0 |
walk_speed_mps | float | 1.4 |
region_id | string | bay_area |
{
"routes": [
[
{ "mode": "bike", "duration_seconds": 180, "distance_meters": 900, ... },
{ "mode": "platform_access", "duration_seconds": 120, ... },
{ "mode": "train", "route_id": "...", "train_info": { ... }, ... },
{ "mode": "platform_access", "duration_seconds": 60, ... },
{ "mode": "bike", "duration_seconds": 240, "distance_meters": 1200, ... }
]
],
"total_routes": 3,
"shortest_route_index": 0
}Each route is an array of segments. Segment modes: bike, train, platform_access, walk. Every segment includes start, end, start_time, end_time, and duration_seconds.
| region_id | Coverage |
|---|---|
bay_area | SF Bay Area — BART, Caltrain, VTA |
socal | Southern California — LA Metro, Metrolink |
hawaii | Honolulu — Skyline |
pacific_northwest | Seattle / Portland — Sound Transit, TriMet |
washington_baltimore | DC / Baltimore — WMATA, MTA |
API keys may have a per-client request rate limit. If you exceed your limit, the API returns 429 Too Many Requests. Back off and retry after a short delay.
| Status | Meaning |
|---|---|
400 | Invalid request parameters |
401 | Missing or invalid API key |
429 | Rate limit exceeded |
500 | Server error |
503 | Cache loading — retry in 30-60s |
No route found returns 200 with an empty routes array.
Fill this out and we'll get you set up.