v1
latestOpenAPI 3.1.02026-08-0420183200.9 KBRouting
Match a recorded route to the road network.
The map matching API transforms a recorded route into navigation instructions like you would get from the route endpoint. The input can be in the form of either an encoded polyline, or (optionally) timestamped coordinates.
post/map_match/v1
Request body
Example request
{
"costing": "pedestrian",
"encoded_polyline": "_grbgAh~{nhF?lBAzBFvBHxBEtBKdB?fB@dBZdBb@hBh@jBb@x@\\|@x@pB\\x@v@hBl@nBPbCXtBn@|@z@ZbAEbAa@~@q@z@QhA]pAUpAVhAPlAWtASpAAdA[dASdAQhAIlARjANnAZhAf@n@`A?lB^nCRbA\\xB`@vBf@tBTbCFbARzBZvBThBRnBNrBP`CHbCF`CNdCb@vBX`ARlAJfADhA@dAFdAP`AR`Ah@hBd@bBl@rBV|B?vB]tBCvBBhAF`CFnBXtAVxAVpAVtAb@|AZ`Bd@~BJfA@fAHdADhADhABjAGzAInAAjAB|BNbCR|BTjBZtB`@lBh@lB\\|Bl@rBXtBN`Al@g@t@?nAA~AKvACvAAlAMdAU`Ac@hAShAI`AJ`AIdAi@bAu@|@k@p@]p@a@bAc@z@g@~@Ot@Bz@f@X`BFtBXdCLbAf@zBh@fBb@xAb@nATjAKjAW`BI|AEpAHjAPdAAfAGdAFjAv@p@XlAVnA?~A?jAInAPtAVxAXnAf@tBDpBJpBXhBJfBDpAZ|Ax@pAz@h@~@lA|@bAnAd@hAj@tAR~AKxAc@xAShA]hAIdAAjA]~A[v@BhB?dBSv@Ct@CvAI~@Oz@Pv@dAz@lAj@~A^`B^|AXvAVpAXdBh@~Ap@fCh@hB\\zBN`Aj@xBFdA@jALbAPbAJdAHdAJbAHbAHfAJhALbA\\lBTvBAdC@bC@jCKjASbC?`CM`CDpB\\xAj@tB\\fA\\bAVfAJdAJbAXz@L|BO`AOdCDdA@~B\\z@l@v@l@v@l@r@j@t@b@x@b@r@z@jBVfCJdAJdANbCPfCF|BRhBS~BS`AYbAe@~BQdA",
"linear_references": true,
"shape_match": "map_snap",
"units": "miles"
}Response
The matched route(s), which looks more or less like a normal route response, optionally with a linear_references key.
Example response
{
"trip": {
"language": "en-US",
"legs": [
{
"maneuvers": [
{
"begin_shape_index": 0,
"cost": 44.733,
"end_shape_index": 1,
"instruction": "Walk west on the walkway.",
"length": 0.039,
"time": 44.733,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 1,
"verbal_post_transition_instruction": "Continue for 200 feet.",
"verbal_pre_transition_instruction": "Walk west on the walkway."
},
{
"begin_shape_index": 1,
"cost": 4.941,
"end_shape_index": 2,
"instruction": "Turn left.",
"length": 0.004,
"time": 4.941,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 15,
"verbal_multi_cue": true,
"verbal_post_transition_instruction": "Continue for 20 feet.",
"verbal_pre_transition_instruction": "Turn left. Then Turn right onto Jefferson Street.",
"verbal_transition_alert_instruction": "Turn left."
},
{
"begin_shape_index": 2,
"cost": 21.941,
"end_shape_index": 3,
"instruction": "Turn right onto Jefferson Street.",
"length": 0.014,
"street_names": [
"Jefferson Street"
],
"time": 16.941,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 10,
"verbal_post_transition_instruction": "Continue for 80 feet.",
"verbal_pre_transition_instruction": "Turn right onto Jefferson Street.",
"verbal_transition_alert_instruction": "Turn right onto Jefferson Street."
},
{
"begin_shape_index": 3,
"cost": 9.941,
"end_shape_index": 4,
"instruction": "Turn left onto the walkway.",
"length": 0.004,
"time": 4.941,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 15,
"verbal_multi_cue": true,
"verbal_post_transition_instruction": "Continue for 20 feet.",
"verbal_pre_transition_instruction": "Turn left onto the walkway. Then Turn right onto the walkway.",
"verbal_transition_alert_instruction": "Turn left onto the walkway."
},
{
"begin_shape_index": 4,
"cost": 6.352,
"end_shape_index": 5,
"instruction": "Turn right onto the walkway.",
"length": 0.005,
"time": 6.352,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 10,
"verbal_multi_cue": true,
"verbal_post_transition_instruction": "Continue for 30 feet.",
"verbal_pre_transition_instruction": "Turn right onto the walkway. Then Turn left onto Hyde Street.",
"verbal_transition_alert_instruction": "Turn right onto the walkway."
},
{
"begin_shape_index": 5,
"cost": 63.588,
"end_shape_index": 10,
"instruction": "Turn left onto Hyde Street.",
"length": 0.051,
"street_names": [
"Hyde Street"
],
"time": 58.588,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 15,
"verbal_post_transition_instruction": "Continue for 300 feet.",
"verbal_pre_transition_instruction": "Turn left onto Hyde Street.",
"verbal_transition_alert_instruction": "Turn left onto Hyde Street."
},
{
"begin_shape_index": 10,
"cost": 11.352,
"end_shape_index": 11,
"instruction": "Turn right onto the walkway.",
"length": 0.005,
"rough": true,
"time": 6.352,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 10,
"verbal_multi_cue": true,
"verbal_post_transition_instruction": "Continue for 30 feet.",
"verbal_pre_transition_instruction": "Turn right onto the walkway. Then Turn left onto the walkway.",
"verbal_transition_alert_instruction": "Turn right onto the walkway."
},
{
"begin_shape_index": 11,
"cost": 93.176,
"end_shape_index": 17,
"instruction": "Turn left onto the walkway.",
"length": 0.082,
"rough": true,
"time": 93.176,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 15,
"verbal_post_transition_instruction": "Continue for 400 feet.",
"verbal_pre_transition_instruction": "Turn left onto the walkway.",
"verbal_transition_alert_instruction": "Turn left onto the walkway."
},
{
"begin_shape_index": 17,
"cost": 7.764,
"end_shape_index": 18,
"instruction": "Turn left onto the walkway.",
"length": 0.006,
"rough": true,
"time": 7.764,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 15,
"verbal_multi_cue": true,
"verbal_post_transition_instruction": "Continue for 40 feet.",
"verbal_pre_transition_instruction": "Turn left onto the walkway. Then Turn right onto Beach Street.",
"verbal_transition_alert_instruction": "Turn left onto the walkway."
},
{
"begin_shape_index": 18,
"cost": 115.705,
"end_shape_index": 24,
"instruction": "Turn right onto Beach Street.",
"length": 0.095,
"street_names": [
"Beach Street"
],
"time": 110.705,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 10,
"verbal_post_transition_instruction": "Continue for 500 feet.",
"verbal_pre_transition_instruction": "Turn right onto Beach Street.",
"verbal_transition_alert_instruction": "Turn right onto Beach Street."
},
{
"begin_shape_index": 24,
"cost": 73.058,
"end_shape_index": 27,
"instruction": "Turn left onto Polk Street.",
"length": 0.059,
"street_names": [
"Polk Street"
],
"time": 68.058,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 15,
"verbal_post_transition_instruction": "Continue for 300 feet.",
"verbal_pre_transition_instruction": "Turn left onto Polk Street.",
"verbal_transition_alert_instruction": "Turn left onto Polk Street."
},
{
"begin_shape_index": 27,
"cost": 103,
"end_shape_index": 32,
"instruction": "Turn right onto the walkway.",
"length": 0.084,
"rough": true,
"time": 98,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 10,
"verbal_post_transition_instruction": "Continue for 400 feet.",
"verbal_pre_transition_instruction": "Turn right onto the walkway.",
"verbal_transition_alert_instruction": "Turn right onto the walkway."
},
{
"begin_shape_index": 32,
"cost": 98.294,
"end_shape_index": 38,
"instruction": "Turn left onto Van Ness Avenue.",
"length": 0.073,
"street_names": [
"Van Ness Avenue"
],
"time": 83.294,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 15,
"verbal_post_transition_instruction": "Continue for 400 feet.",
"verbal_pre_transition_instruction": "Turn left onto Van Ness Avenue.",
"verbal_transition_alert_instruction": "Turn left onto Van Ness Avenue."
},
{
"begin_shape_index": 38,
"cost": 12.058,
"end_shape_index": 39,
"instruction": "Turn right onto the walkway.",
"length": 0.006,
"rough": true,
"time": 7.058,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 10,
"verbal_multi_cue": true,
"verbal_post_transition_instruction": "Continue for 30 feet.",
"verbal_pre_transition_instruction": "Turn right onto the walkway. Then Turn left onto the walkway.",
"verbal_transition_alert_instruction": "Turn right onto the walkway."
},
{
"begin_shape_index": 39,
"cost": 9.882,
"end_shape_index": 40,
"instruction": "Turn left onto the walkway.",
"length": 0.008,
"rough": true,
"time": 9.882,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 15,
"verbal_multi_cue": true,
"verbal_post_transition_instruction": "Continue for 50 feet.",
"verbal_pre_transition_instruction": "Turn left onto the walkway. Then Turn right onto Bay Street.",
"verbal_transition_alert_instruction": "Turn left onto the walkway."
},
{
"begin_shape_index": 40,
"cost": 199.823,
"end_shape_index": 45,
"instruction": "Turn right onto Bay Street.",
"length": 0.171,
"street_names": [
"Bay Street"
],
"time": 194.823,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 10,
"verbal_post_transition_instruction": "Continue for 900 feet.",
"verbal_pre_transition_instruction": "Turn right onto Bay Street.",
"verbal_transition_alert_instruction": "Turn right onto Bay Street."
},
{
"begin_shape_index": 45,
"cost": 8.302,
"end_shape_index": 46,
"instruction": "Turn left onto Gough Street.",
"length": 0.002,
"street_names": [
"Gough Street"
],
"time": 3.302,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 15,
"verbal_multi_cue": true,
"verbal_post_transition_instruction": "Continue for 20 feet.",
"verbal_pre_transition_instruction": "Turn left onto Gough Street. Then You will arrive at your destination.",
"verbal_transition_alert_instruction": "Turn left onto Gough Street."
},
{
"begin_shape_index": 46,
"cost": 0,
"end_shape_index": 46,
"instruction": "You have arrived at your destination.",
"length": 0,
"time": 0,
"travel_mode": "pedestrian",
"travel_type": "foot",
"type": 4,
"verbal_pre_transition_instruction": "You have arrived at your destination.",
"verbal_transition_alert_instruction": "You will arrive at your destination."
}
],
"shape": "uhrbgAt~{nhFrDhk@rBWfAbPvBWXfElAQhAi@dA]d[oDvIaAs@~Dp@n@r@r@^\\jAnQfDdh@lBtY`Eg@VzDXxDxAdPrD~j@zBf]TpD|C_@`\\uD|QaCZtE`Cp\\|A|UdCz^N`ClDJj@dJdDo@vGw@dKmAzWcDRdFpFq@d@dHpH`kAVbEXhEdKj_BpAO",
"summary": {
"cost": 883.918,
"has_time_restrictions": false,
"length": 0.716,
"max_lat": 37.807771,
"max_lon": -122.419706,
"min_lat": 37.803694,
"min_lon": -122.428418,
"time": 818.918
}
}
],
"linear_references": [
"C6jyLBrisjr3Af+4//g6BA==",
"C6jyCxrirjr3AAAA//s6Bw==",
"C6jyDBriqyKUAP/j//0iAg==",
"C6jx/xriqTr3AAAA//w6Ag==",
"C6jx/xripjr0AP/2AAE6Hg==",
"C6jx+xripiKUAQAM/8kiHw==",
"C6jyARrijCKPAAAC/+8iBg==",
"C6jyAxrihDrvAP/0AAM6BQ==",
"C6jx/hrihTrzAP/5//o6Bw==",
"C6jx+xrigjr1AP/h//06Bw==",
"C6jx7RrigDr3Af++//k6Bw==",
"C6jxzxrifDr3AP/T//w6Ag==",
"C6jxuxrieTr3AAAA//g6Bw==",
"C6jxvBridTLSAP/1AAAyBw==",
"C6jxtxridDLSAP/2AAEyBg==",
"C6jxsxridDLWAf+d//MyBw==",
"C6jxhRribjLXAP/P//oyAg==",
"C6jxbxriazLXAP/1//8yHw==",
"C6jxaxriajLXAP////kyHw==",
"C6jxaxriZjLTAAAJ/9MyHw==",
"C6jxbxriUTLPAAAG/+IyBw==",
"C6jxcxriQzrvAP/z//86Bw==",
"C6jxbhriQjryAP/P//s6Bw==",
"C6jxVxriPzr3AP/b//w6Bw==",
"C6jxRhriPTr3AP/N//o6Aw==",
"C6jxLxriOjr3AP/4AAA6Aw==",
"C6jxLBriOTLXAP/9//kyBQ==",
"C6jxKxriNSKTAP/u//8iHw==",
"C6jxIxriNCKWAAAE/+siHw==",
"C6jxJRriKiKPAAAE/+0iHw==",
"C6jxJxriISKPAAAI/9kiAw==",
"C6jxKxriDjrvAP/0AAA6AQ==",
"C6jxJhriDjrzAAAB//Q6Bw==",
"C6jxJxriCBpxAv9s/+8aBw==",
"C6jw4xrh/xp3Av9a/+0aBQ==",
"C6jwlhrh9jLXAAAA//0yBQ=="
],
"locations": [
{
"lat": 37.807744,
"lon": -122.4197,
"type": "break"
},
{
"lat": 37.803694,
"lon": -122.428416,
"type": "break"
}
],
"status": 0,
"status_message": "Found route between points",
"summary": {
"cost": 883.918,
"has_time_restrictions": false,
"length": 0.716,
"max_lat": 37.807771,
"max_lon": -122.419706,
"min_lat": 37.803694,
"min_lon": -122.428418,
"time": 818.918
},
"units": "miles"
}
}