The route service guides you between points by car, bike, foot, and multimodal combinations involving walking and riding public transit. Your apps can use the results from the route service to plan multimodal journeys with narratives to guide users by text and by voice.
Array of objects >= 2 items | |
costing | string (CostingModel) Routing service uses dynamic, run-time costing to generate the route path. The route request must include the name of the costing model and can include optional parameters available for the chosen costing model.
|
object Costing methods can have several options that can be adjusted to develop the route path, as well as for estimating time along the path. Specify costing model options in your request using the format of
| |
units | string Default: "km" Distance units for output. Allowable unit types are |
directions_type | string Default: "instructions"
|
language | string Default: "en" The language of the narration instructions based on the IETF BCP 47 language tag string. If no language is specified or the specified language is unsupported, English
|
alternates | number Default: 1 A number denoting how many alternate routes should be provided. There may be no alternates or less alternates than the user specifies. Alternates are not yet supported on multipoint routes (that is, routes with more than 2 locations). They are also not supported on time dependent routes. |
Array of objects A set of locations to exclude or avoid within a route can be specified using a JSON array of | |
exclude_polygons | Array of numbers One or multiple exterior rings of polygons in the form of nested JSON arrays, e.g. [[[lon1, lat1], [lon2,lat2]],[[lon1,lat1],[lon2,lat2]]]. Roads intersecting these rings will be avoided during path finding. If you only need to avoid a few specific roads, it's much more efficient to use |
object This is the local date and time at the location. | |
linear_references | boolean When present and true, the successful route response will include a key |
roundabout_exits | boolean Default: true A boolean indicating whether exit instructions at roundabouts should be added to the output or not. |
Route result.
Incorrect request parameters.
API key is incorrect or not provided.
Subscription daily limit exceeded.
Subscription suspended.
{- "locations": [
- {
- "lat": -90,
- "lon": -180,
- "type": "break"
}, - {
- "lat": -90,
- "lon": -180,
- "type": "break"
}
], - "costing": "auto",
- "costing_options": {
- "auto": {
- "maneuver_penalty": 5,
- "gate_cost": 30,
- "gate_penalty": 300,
- "private_access_penalty": 450,
- "toll_booth_cost": 15,
- "toll_booth_penalty": 0,
- "ferry_cost": 300,
- "use_ferry": 0.5,
- "use_highways": 1,
- "use_tolls": 0.5,
- "use_living_streets": 1,
- "use_tracks": 1,
- "service_penalty": 0,
- "service_factor": 1,
- "country_crossing_cost": 600,
- "country_crossing_penalty": 1,
- "shortest": false,
- "disable_hierarchy_pruning": false,
- "top_speed": 140,
- "fixed_speed": 0,
- "ignore_closures": true,
- "closure_factor": 9,
- "height": 0,
- "width": 0,
- "exclude_unpaved": true,
- "exclude_cash_only_tolls": false,
- "include_hov2": false,
- "include_hov3": false,
- "include_hot": false
}, - "bus": {
- "maneuver_penalty": 5,
- "gate_cost": 30,
- "gate_penalty": 300,
- "private_access_penalty": 450,
- "toll_booth_cost": 15,
- "toll_booth_penalty": 0,
- "ferry_cost": 300,
- "use_ferry": 0.5,
- "use_highways": 1,
- "use_tolls": 0.5,
- "use_living_streets": 1,
- "use_tracks": 1,
- "service_penalty": 0,
- "service_factor": 1,
- "country_crossing_cost": 600,
- "country_crossing_penalty": 1,
- "shortest": false,
- "disable_hierarchy_pruning": false,
- "top_speed": 140,
- "fixed_speed": 0,
- "ignore_closures": true,
- "closure_factor": 9,
- "height": 0,
- "width": 0,
- "exclude_unpaved": true,
- "exclude_cash_only_tolls": false,
- "include_hov2": false,
- "include_hov3": false,
- "include_hot": false
}, - "truck": {
- "maneuver_penalty": 5,
- "gate_cost": 30,
- "gate_penalty": 300,
- "private_access_penalty": 450,
- "toll_booth_cost": 15,
- "toll_booth_penalty": 0,
- "ferry_cost": 300,
- "use_ferry": 0.5,
- "use_highways": 1,
- "use_tolls": 0.5,
- "use_living_streets": 1,
- "use_tracks": 1,
- "service_penalty": 0,
- "service_factor": 1,
- "country_crossing_cost": 600,
- "country_crossing_penalty": 1,
- "shortest": false,
- "disable_hierarchy_pruning": false,
- "top_speed": 140,
- "fixed_speed": 0,
- "ignore_closures": true,
- "closure_factor": 9,
- "height": 0,
- "width": 0,
- "exclude_unpaved": true,
- "exclude_cash_only_tolls": false,
- "include_hov2": false,
- "include_hov3": false,
- "include_hot": false,
- "length": 21.64,
- "weight": 21.77,
- "axle_load": 9.07,
- "axle_count": 5,
- "hazmat": false
}, - "taxi": {
- "height": 0,
- "width": 0,
- "exclude_unpaved": true,
- "exclude_cash_only_tolls": false,
- "include_hov2": false,
- "include_hov3": false,
- "include_hot": false
}, - "bicycle": {
- "bicycle_type": "Road",
- "cycling_speed": 18,
- "use_roads": 0.5,
- "use_hills": 0.5,
- "use_ferry": 0.5,
- "use_living_streets": 0.5,
- "avoid_bad_surfaces": 0.25,
- "bss_return_cost": 120,
- "shortest": false
}, - "bikeshare": {
- "walking_speed": 5.1,
- "walkway_factor": 1,
- "sidewalk_factor": 1,
- "alley_factor": 2,
- "driveway_factor": 5,
- "step_penalty": 0,
- "use_ferry": 0.5,
- "use_living_streets": 0.5,
- "use_tracks": 0.5,
- "use_hills": 0.5,
- "use_lit": 0,
- "service_penalty": 0,
- "service_factor": 1,
- "max_hiking_difficulty": 1,
- "bss_rent_cost": 120,
- "shortest": false,
- "transit_start_end_max_distance": 2145,
- "transit_transfer_max_distance": 800,
- "bicycle_type": "Road",
- "cycling_speed": 18,
- "use_roads": 0.5,
- "avoid_bad_surfaces": 0.25,
- "bss_return_cost": 120
}, - "motor_scooter": {
- "top_speed": 45,
- "use_primary": 0.5,
- "use_hills": 0.5,
- "shortest": false,
- "disable_hierarchy_pruning": false
}, - "motorcycle": {
- "use_highways": 1,
- "use_trails": 0,
- "shortest": false,
- "disable_hierarchy_pruning": false
}, - "pedestrian": {
- "walking_speed": 5.1,
- "walkway_factor": 1,
- "sidewalk_factor": 1,
- "alley_factor": 2,
- "driveway_factor": 5,
- "step_penalty": 0,
- "use_ferry": 0.5,
- "use_living_streets": 0.6,
- "use_tracks": 0.5,
- "use_hills": 0.5,
- "use_lit": 0,
- "service_penalty": 0,
- "service_factor": 1,
- "max_hiking_difficulty": 1,
- "bss_rent_cost": 120,
- "shortest": false,
- "transit_start_end_max_distance": 2145,
- "transit_transfer_max_distance": 800
}, - "transit": {
- "use_bus": 1,
- "use_rail": 1,
- "use_transfers": 1,
- "filters": {
- "routes": {
- "ids": [
- "NYC_AUR"
], - "action": "exclude"
}, - "operators": {
- "ids": [
- "paris_CFG"
], - "action": "exclude"
}
}
}, - "multimodal": {
- "use_bus": 1,
- "use_rail": 1,
- "use_transfers": 1,
- "filters": {
- "routes": {
- "ids": [
- "NYC_AUR"
], - "action": "exclude"
}, - "operators": {
- "ids": [
- "paris_CFG"
], - "action": "exclude"
}
}
}
}, - "units": "km",
- "directions_type": "none",
- "language": "bg",
- "alternates": 1,
- "exclude_locations": [
- {
- "lat": -90,
- "lon": -180
}
], - "exclude_polygons": [
- [
- 0
]
], - "date_time": {
- "type": 0,
- "value": "2023-07-08T08:06"
}, - "linear_references": true,
- "roundabout_exits": true
}
{- "trip": {
- "locations": [
- {
- "type": "string",
- "lat": 0,
- "lon": 0,
- "side_of_street": "left",
- "original_index": 0
}
], - "legs": {
- "maneuvers": [
- {
- "type": 38,
- "instruction": "string",
- "verbal_succinct_transition_instruction": "string",
- "verbal_pre_transition_instruction": "string",
- "verbal_post_transition_instruction": "string",
- "street_names": [
- "string"
], - "begin_street_names": [
- "string"
], - "time": 0,
- "length": 0,
- "cost": 0,
- "begin_shape_index": 0,
- "end_shape_index": 0,
- "toll": true,
- "highway": true,
- "rough": true,
- "gate": true,
- "ferry": true,
- "sign": {
- "text": "string",
- "consecutive_count": 0
}, - "roundabout_exit_count": 0,
- "depart_instruction": "string",
- "verbal_depart_instruction": "string",
- "arrive_instruction": "string",
- "verbal_arrive_instruction": "string",
- "transit_info": {
- "onestop_id": "string",
- "short_name": "string",
- "long_name": "string",
- "headsign": "string",
- "color": "string",
- "text_color": "string",
- "description": "string",
- "operator_onestop_id": "string",
- "operator_name": "string",
- "operator_url": "string",
- "transit_stops": [
- {
- "type": null,
- "name": null,
- "arrival_date_time": null,
- "departure_date_time": null,
- "is_parent_stop": null,
- "assumed_schedule": null,
- "lat": null,
- "lon": null,
- "verbal_multi_cue": null,
- "travel_mode": null,
- "travel_type": null,
- "bss_maneuver_type": null
}
]
}, - "verbal_multi_cue": true,
- "travel_mode": "string",
- "travel_type": "string"
}
], - "summary": {
- "has_time_restrictions": true,
- "has_toll": true,
- "has_highway": true,
- "has_ferry": true,
- "min_lat": 0,
- "min_lon": 0,
- "max_lat": 0,
- "max_lon": 0,
- "time": 0,
- "length": 0,
- "cost": 0
}, - "shape": [
- [
- 0
]
]
}, - "summary": {
- "has_time_restrictions": true,
- "has_toll": true,
- "has_highway": true,
- "has_ferry": true,
- "min_lat": 0,
- "min_lon": 0,
- "max_lat": 0,
- "max_lon": 0,
- "time": 0,
- "length": 0,
- "cost": 0
}, - "status_message": "string",
- "status": 0,
- "units": "string",
- "language": "string",
- "warnings": [ ]
}
}