Optimization
Changed onNextbillion.ai Optimization API computes and returns an optimized route between an origin and destination which have multiple stop points in between. With NextBillion.ai's Route Optimization API you get.
Optimized routing between way points
Highly accurate ETAs with customized routes
Roundtrip optimization with customized destinations
A list of all parameters is specified in the next section.
Request
- Base URLhttps://api.nextbillion.io
- AuthAPI key in query parameter key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
This is a pipe-separated list of coordinates.
Minimum 3 pairs of coordinates and Maximum 12 pairs of coordinates are allowed.
Specify the destination coordinate of the returned route. If the input is last, the last coordinate will be the destination.
Sets the output format of the route geometry in the response.
On providing polyline and polyline6 as input, respective encoded geometry is returned. However, when geojson is provided as the input value, polyline encoded geometry is returned in the response along with a geojson details of the route.
A key is a unique identifier that is required to authenticate a request to the API.
Set which driving mode the service should use to determine a route. For example, if you use "car", the API will return a route that a car can take. Using "truck" will return a route a truck can use, taking into account appropriate truck routing restrictions.
When "mode=truck", following are the default dimensions that are used:
- truck_height = 214 centimeters
- truck_width = 183 centimeters
- truck_length = 519 centimeters
- truck_weight = 5000 kg
Please use the Directions Flexible version if you want to use custom truck dimensions.
Note: Only the "car" profile is enabled by default. Please note that customized profiles (including "truck") might not be available for all regions. Please contact your NextBillion.ai account manager, sales representative or reach out at support@nextbillion.ai in case you need additional profiles.
Indicates whether the returned route is a roundtrip.
The coordinate at which to start the returned route. If this is not configured, the return route’s destination will be the first coordinate.
Indicates whether the return geometry should be computed or not.
A semicolon-separated list indicating the side of the road from which to approach waypoints in a requested route. If provided, the number of approaches must be the same as the number of coordinates. However, you can skip a coordinate and show its position in the list with the ; separator.
Response
Changes
- breaking
for the
queryrequest parameterapproaches, default value was changed fromunrestrictedtounrestricted - breaking
for the
queryrequest parameterdestination, default value was changed fromlasttolast - breaking
for the
queryrequest parametergeometries, default value was changed frompolyline6topolyline6 - breaking
for the
queryrequest parametermode, default value was changed fromcartocar - breaking
for the
queryrequest parametersource, default value was changed fromfirsttofirst - breaking
removed the enum value
anyfrom thequeryrequest parameterdestination - breaking
removed the enum value
anyfrom thequeryrequest parametersource - breaking
removed the enum value
carfrom thequeryrequest parametermode - breaking
removed the enum value
curbfrom thequeryrequest parameterapproaches - breaking
removed the enum value
firstfrom thequeryrequest parametersource - breaking
removed the enum value
geojsonfrom thequeryrequest parametergeometries - breaking
removed the enum value
lastfrom thequeryrequest parameterdestination - breaking
removed the enum value
polyline6from thequeryrequest parametergeometries - breaking
removed the enum value
polylinefrom thequeryrequest parametergeometries - breaking
removed the enum value
truckfrom thequeryrequest parametermode - breaking
removed the enum value
unrestrictedfrom thequeryrequest parameterapproaches - info
added the new enum value
anyto thequeryrequest parameterdestination - info
added the new enum value
anyto thequeryrequest parametersource - info
added the new enum value
carto thequeryrequest parametermode - info
added the new enum value
curbto thequeryrequest parameterapproaches - info
added the new enum value
firstto thequeryrequest parametersource - info
added the new enum value
geojsonto thequeryrequest parametergeometries - info
added the new enum value
lastto thequeryrequest parameterdestination - info
added the new enum value
polylineto thequeryrequest parametergeometries - info
added the new enum value
polyline6to thequeryrequest parametergeometries - info
added the new enum value
truckto thequeryrequest parametermode - info
added the new enum value
unrestrictedto thequeryrequest parameterapproaches
- breaking
- breaking
for the
queryrequest parameterapproaches, default value was changed fromunrestrictedtounrestricted - breaking
for the
queryrequest parameterdestination, default value was changed fromlasttolast - breaking
for the
queryrequest parametergeometries, default value was changed frompolyline6topolyline6 - breaking
for the
queryrequest parametermode, default value was changed fromcartocar - breaking
for the
queryrequest parametersource, default value was changed fromfirsttofirst - breaking
removed the enum value
anyfrom thequeryrequest parameterdestination - breaking
removed the enum value
anyfrom thequeryrequest parametersource - breaking
removed the enum value
carfrom thequeryrequest parametermode - breaking
removed the enum value
curbfrom thequeryrequest parameterapproaches - breaking
removed the enum value
firstfrom thequeryrequest parametersource - breaking
removed the enum value
geojsonfrom thequeryrequest parametergeometries - breaking
removed the enum value
lastfrom thequeryrequest parameterdestination - breaking
removed the enum value
polylinefrom thequeryrequest parametergeometries - breaking
removed the enum value
polyline6from thequeryrequest parametergeometries - breaking
removed the enum value
truckfrom thequeryrequest parametermode - breaking
removed the enum value
unrestrictedfrom thequeryrequest parameterapproaches - info
added the new enum value
anyto thequeryrequest parameterdestination - info
added the new enum value
anyto thequeryrequest parametersource - info
added the new enum value
carto thequeryrequest parametermode - info
added the new enum value
curbto thequeryrequest parameterapproaches - info
added the new enum value
firstto thequeryrequest parametersource - info
added the new enum value
geojsonto thequeryrequest parametergeometries - info
added the new enum value
lastto thequeryrequest parameterdestination - info
added the new enum value
polyline6to thequeryrequest parametergeometries - info
added the new enum value
polylineto thequeryrequest parametergeometries - info
added the new enum value
truckto thequeryrequest parametermode - info
added the new enum value
unrestrictedto thequeryrequest parameterapproaches
- breaking