curl --request POST \
--url https://api.footstep.ai/v1/routing/snap \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"shape": [
{
"lat": 51.5322,
"lon": -0.124
},
{
"lat": 51.5013,
"lon": -0.1228
},
{
"lat": 51.5019,
"lon": -0.1209
},
{
"lat": 51.5025,
"lon": -0.119
}
]
}
'{
"snapped_shape": "<string>",
"confidence": 0.5,
"match_quality": "low",
"match_quality_reason": "<string>",
"route": {
"legs": [
{
"distance_meters": 123,
"duration_seconds": 123,
"shape": "<string>",
"steps": [
{
"type": "none",
"instruction": "<string>",
"street_names": [
"<string>"
],
"distance_meters": 123,
"duration_seconds": 123,
"begin_shape_index": 123,
"end_shape_index": 123,
"travel_mode": "<string>",
"flags": {
"toll": true,
"ferry": true,
"rough": true,
"gate": true,
"highway": true
},
"verbal_alert": "<string>",
"verbal_instruction": "<string>",
"bearing_before": 123,
"bearing_after": 123,
"roundabout_exit_count": 123,
"exit_sign": {
"exit_number": "<string>",
"exit_branch": "<string>",
"exit_toward": "<string>",
"exit_name": "<string>"
},
"lanes": [
{
"indications": [
"<string>"
],
"valid": true,
"active": true
}
]
}
],
"terrain": {
"total_ascent_meters": 123,
"total_descent_meters": 123,
"max_elevation_meters": 123,
"min_elevation_meters": 123,
"avg_grade_percent": 123,
"max_grade_percent": 123,
"elevation_profile": [
{
"distance_meters": 123,
"elevation_meters": 123
}
],
"difficulty": "flat"
},
"flags": {
"has_toll": true,
"has_highway": true,
"has_ferry": true
},
"bounds": {
"min_lat": 123,
"min_lon": 123,
"max_lat": 123,
"max_lon": 123
}
}
],
"distance_meters": 123,
"duration_seconds": 123,
"terrain": {
"total_ascent_meters": 123,
"total_descent_meters": 123,
"max_elevation_meters": 123,
"min_elevation_meters": 123,
"avg_grade_percent": 123,
"max_grade_percent": 123,
"elevation_profile": [
{
"distance_meters": 123,
"elevation_meters": 123
}
],
"difficulty": "flat"
}
},
"edges": [
{
"names": [
"<string>"
],
"length_meters": 123,
"speed_kph": 123,
"road_class": "motorway",
"surface": "paved_smooth",
"grade_percent": 123
}
],
"matched_points": [
{
"lat": 123,
"lon": 123,
"type": "matched",
"distance_from_trace_meters": 123,
"edge_index": 123
}
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Routing
Snap GPS Trace
Map-match a GPS trace to the road network. Returns a snapped polyline with confidence score. Optionally includes directions with terrain analytics, road attributes (surface, grade, road class), and per-point match quality.
POST
/
v1
/
routing
/
snap
curl --request POST \
--url https://api.footstep.ai/v1/routing/snap \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"shape": [
{
"lat": 51.5322,
"lon": -0.124
},
{
"lat": 51.5013,
"lon": -0.1228
},
{
"lat": 51.5019,
"lon": -0.1209
},
{
"lat": 51.5025,
"lon": -0.119
}
]
}
'{
"snapped_shape": "<string>",
"confidence": 0.5,
"match_quality": "low",
"match_quality_reason": "<string>",
"route": {
"legs": [
{
"distance_meters": 123,
"duration_seconds": 123,
"shape": "<string>",
"steps": [
{
"type": "none",
"instruction": "<string>",
"street_names": [
"<string>"
],
"distance_meters": 123,
"duration_seconds": 123,
"begin_shape_index": 123,
"end_shape_index": 123,
"travel_mode": "<string>",
"flags": {
"toll": true,
"ferry": true,
"rough": true,
"gate": true,
"highway": true
},
"verbal_alert": "<string>",
"verbal_instruction": "<string>",
"bearing_before": 123,
"bearing_after": 123,
"roundabout_exit_count": 123,
"exit_sign": {
"exit_number": "<string>",
"exit_branch": "<string>",
"exit_toward": "<string>",
"exit_name": "<string>"
},
"lanes": [
{
"indications": [
"<string>"
],
"valid": true,
"active": true
}
]
}
],
"terrain": {
"total_ascent_meters": 123,
"total_descent_meters": 123,
"max_elevation_meters": 123,
"min_elevation_meters": 123,
"avg_grade_percent": 123,
"max_grade_percent": 123,
"elevation_profile": [
{
"distance_meters": 123,
"elevation_meters": 123
}
],
"difficulty": "flat"
},
"flags": {
"has_toll": true,
"has_highway": true,
"has_ferry": true
},
"bounds": {
"min_lat": 123,
"min_lon": 123,
"max_lat": 123,
"max_lon": 123
}
}
],
"distance_meters": 123,
"duration_seconds": 123,
"terrain": {
"total_ascent_meters": 123,
"total_descent_meters": 123,
"max_elevation_meters": 123,
"min_elevation_meters": 123,
"avg_grade_percent": 123,
"max_grade_percent": 123,
"elevation_profile": [
{
"distance_meters": 123,
"elevation_meters": 123
}
],
"difficulty": "flat"
}
},
"edges": [
{
"names": [
"<string>"
],
"length_meters": 123,
"speed_kph": 123,
"road_class": "motorway",
"surface": "paved_smooth",
"grade_percent": 123
}
],
"matched_points": [
{
"lat": 123,
"lon": 123,
"type": "matched",
"distance_from_trace_meters": 123,
"edge_index": 123
}
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Body
application/json
Provide either shape or encoded_polyline
Matching strategy. edge_walk requires the trace to follow exact road edges (high-quality data only). map_snap is strict per-point snapping. walk_or_snap (default) is forgiving — falls back to walking the closest edges when an exact snap fails, which matches typical phone-GPS behaviour.
Available options:
edge_walk, map_snap, walk_or_snap Response
Snapped trace with optional route and attributes