v4

latestOpenAPI 3.1.0MITraw.githubusercontent.com2026-08-03123883.7 KB

/trace_route

Map-matched turn-by-turn route

post/trace_route

Request body

idstring

Arbitrary request identifier echoed in the response.

format'json' | 'gpx' | 'osrm' | 'pbf' | 'geotiff' | 'mvt'

Not all formats are supported by all endpoints, e.g. geotiff is isochrone-only.

units'km' | 'miles' | 'mi'
languagestring

BCP47 locale for narrative output. See locales/ for supported values.

costing'auto' | 'bicycle' | 'pedestrian' | 'truck' | 'bus' | 'taxi' | 'motor_scooter' | 'motorcycle' | 'multimodal' | 'bikeshare' | 'auto_pedestrian' required
encoded_polylinestring

Polyline6-encoded trace shape. Mutually exclusive with shape.

shape_match'map_snap' | 'edge_walk' | 'walk_or_snap'
shape_format'polyline6' | 'polyline5' | 'geojson' | 'no_shape'

Not all formats are supported by all endpoints, e.g. no_shape is not valid for isochrone.

elevation_intervalnumber

Elevation sample interval in meters along the matched path. 0 = disabled.

begin_timeinteger

Epoch start timestamp (seconds) for the trace. Used with durations to assign timestamps to encoded_polyline input.

durationsnumber[]

Elapsed seconds between each successive pair of trace points. Used with begin_time to derive per-point timestamps from an encoded_polyline input.

use_timestampsboolean

When true, use per-point time values (or derived timestamps) for elapsed time calculation instead of internal costing.

directions_type'none' | 'maneuvers' | 'instructions'
alternatesinteger

Number of alternative matched routes to return.

linear_referencesboolean

Include base64-encoded OpenLR location references for each matched graph edge.

Example request

{
  "format": "json",
  "costing": "auto",
  "costing_options": {
    "multimodal": {
      "filters": {
        "operators": {
          "action": "exclude",
          "ids": [
            "NYC_AUR"
          ]
        },
        "routes": {
          "action": "exclude",
          "ids": [
            "NYC_AUR"
          ]
        }
      }
    },
    "transit": {
      "filters": {
        "operators": {
          "action": "exclude",
          "ids": [
            "NYC_AUR"
          ]
        },
        "routes": {
          "action": "exclude",
          "ids": [
            "NYC_AUR"
          ]
        }
      }
    }
  },
  "exclude_locations": [
    {
      "type": "break",
      "preferred_side": "opposite",
      "street_side_cutoff": "primary",
      "search_filter": {
        "min_road_class": "primary",
        "max_road_class": "primary"
      }
    }
  ],
  "shape": [
    {
      "type": "break",
      "preferred_side": "opposite",
      "street_side_cutoff": "primary",
      "search_filter": {
        "min_road_class": "primary",
        "max_road_class": "primary"
      }
    }
  ],
  "shape_match": "walk_or_snap",
  "shape_format": "polyline6"
}

Response

Map-matched route result