v4

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

/route

Turn-by-turn route

post/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
alternatesinteger

Number of alternative routes to return. Forced to 0 for more than 2 waypoints.

directions_type'none' | 'maneuvers' | 'instructions'
shape_format'polyline6' | 'polyline5' | 'geojson' | 'no_shape'

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

linear_referencesboolean

Include base64-encoded OpenLR references per edge in the response..

admin_crossingsboolean

When true, the route summary includes admins (array of administrative regions the route passes through) and admin_crossings (array of objects with from_admin_index, to_admin_index, from_shape_index, and to_shape_index indicating where and along which edge an administrative boundary is crossed).

elevation_intervalnumber

Elevation sample interval in meters along the path. 0 = no elevation.

banner_instructionsboolean

Include OSRM-format banner instructions, if format = osrm.

voice_instructionsboolean

Include OSRM-format voice instructions, if format = osrm.

turn_lanesboolean

When true, each maneuver may include a lanes array describing lane-level guidance: possible directions and which lanes are valid or active for following the maneuver.

roundabout_exitsboolean

When true, exit instructions at roundabouts are added to the output.

prioritize_bidirectionalboolean

Prefer bidirectional A* even when date_time.type={depart_at,arrive_by,current} in /route, or prefer CostMatrix over TDMatrix when calling /sources_to_targets

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"
      }
    }
  ],
  "locations": [
    {
      "type": "break",
      "preferred_side": "opposite",
      "street_side_cutoff": "primary",
      "search_filter": {
        "min_road_class": "primary",
        "max_road_class": "primary"
      }
    }
  ],
  "shape_format": "polyline6"
}

Response

Route result