Post Trip Route API

Introduction

With NextBillion.ai’s Post Trip Route API:

You can accurately map the actual route taken during a trip and return an accurate distance of the whole route. The API will return the total distance and complete route geometry based on the input locations along the route.

You can also get a list of geospatial objects like Tolls, or Traffic Lights along the route. The API uses the POST method to pass waypoints and other information.

Parameters

Request Parameters

Loading...

POST Body Schema

Loading...

Response Schema

Loading...

Query Limits

Generic Limits

Nextbillion.ai allows a maximum rate limit of 6000 queries per minute or 100 queries/second for continuous requests.

Note: We can increase the quota if needed on request. Contact [email protected] for more details.

Examples

Sample API Request

curl -XPOST -H "Content-type: Application/json" "https://api.nextbillion.io/postTripRoute?mode=4w&key=YOUR_API_KEY" -d '{"waypoints":"13.00463577,77.53160027|12.98690572,77.54619149|12.99591162,77.53102053|12.99883846,77.53346593"}'

Sample API Response

1{
2  "status": "Ok",
3  "route": {
4    "geometry": "s|jnAq}exMzOuRZiL`@[email protected]@[email protected]@[email protected]|GiPhDsLTyGdGPrJjBbR}@zHhAfK`@[email protected]@[email protected]@[email protected]",
5    "distance": 5973.9,
6    "special_objects": null
7  }
8}

Sample Image

API Error Codes

Response CodeDescriptionAdditional Notes
200Normal success case.Normal success case.
400Input validation failed.Such as missing parameter or parameter with invalid value type (for example value cannot be parsed into number).
401APIKEY not supplied or invalid.-
403APIKEY is valid but does not have access to requested resources.You might be querying for a geographical region which is not valid for your account, or requesting a service which is not enabled for you.
404Requested host/path not found.This error occurs when there is a malformed host name used.
422Could not process the request.There is an underlying map issue which prevents the processing of the request.
429Too many requests.QPM reached or something like distance matrix size quota reached.
500Internal Service error.There was an internal issue with Nextbillion.ai services. You can reach out to [email protected] for an explanation.
Isochrone
DIDN'T FIND WHAT YOU LOOKING FOR?