Live map example
Loading the Mapsource map…
Request / Response
Calculate a bicycle route
Send two waypoints and receive a summary, turn instructions and renderable GeoJSON.
API call
curl --fail-with-body "https://api.mapsource.io/route" \
-H "Authorization: Bearer $MAPSOURCE_API_KEY" -H "Content-Type: application/json" \
--data '{"locations":[{"lat":47.6062,"lon":-122.3321},{"lat":47.6205,"lon":-122.3493}],"costing":"bicycle"}'Example response
{"schema":"mapsource-route.v1","profile":"bicycle","units":{"distance":"kilometers","duration":"seconds"},"summary":{"distanceKm":2.49,"durationSeconds":418},"geometryAvailable":"inline","geometry":{"type":"LineString","coordinates":[[-122.3321,47.6062],[-122.3493,47.6205]]},"maneuvers":[{"instruction":"Head northwest.","distanceKm":0.6,"durationSeconds":102}]}Route for the way people travel
Choose auto, bicycle, pedestrian, truck, motor scooter or bus costing. Responses identify their units, graph version, geometry availability and provenance.
Use the line beyond the map
Display route geometry, present maneuvers, calculate an arrival estimate or request an elevation profile without maintaining a routing graph.
Service details
Built around a published contract
Inputs, outputs and limits remain inspectable in the generated API reference.
- Endpoint
- POST /api/route
- Waypoints
- 2–10 coordinates
- Output
- GeoJSON, summary and maneuvers
- Optional
- Sampled elevation profile