Directions API

Introduction

Nextbillion.ai's Directions API is a service that computes a route between 2 places. With the Directions API you can:

  1. Find the most optimal route between the origin and the destination.

  2. Set various travelling modes for a more accurate route result. [4w, pedestrian etc]

  3. You can also add waypoints, which are coordinates along the route.

  4. Produce segment wise information like distance, speed and speed profile.

  5. Produce turn-by-turn instructions.

A full list of parameters is documented in the next section.

Parameters

Loading...

Response Schema

Loading...

Query 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

https://api.nextbillion.io/directions/json?origin=12.98740754,77.58327035&destination=12.95545688,77.61554269&session=R5mvdi&alternatives=false&altcount=1&annotations=false&approaches=unrestricted;unrestricted&avoid=&mode=4w&waypoints=12.973691,77.58824853&departure_time=1649144593&key=<insert your key here>

Sample API Response

1{
2  "status": "Ok",
3  "mode": "4w",
4  "routes": [
5    {
6      "geometry": "mognA{}[email protected]@[email protected]@`[email protected]`[email protected]@[email protected]@[email protected]^]^][email protected]@\\[email protected]]@[email protected]@[email protected]@KDYBKFWH][email protected]@DMJ]F]@[email protected]}@[email protected]}@[email protected]@Q{@EUG[G[[email protected]@[email protected]][email protected]@[email protected]@[email protected]@[email protected]@Z^[email protected]@VHDDBTL`@[email protected]^[email protected]@`@[email protected]@[email protected]@@[email protected]@[email protected][email protected][email protected][email protected]?][email protected]@[email protected][email protected]?ADwAD{[email protected]@[email protected][email protected][email protected]@[email protected]@IP][email protected]@[email protected][[email protected]@[email protected][[email protected][email protected]@[email protected]@[email protected][[email protected]@[email protected][email protected][email protected]@[email protected]?KDK?O?G?KBY?G^[email protected]@FWDSH[[email protected]@\\[email protected]@[email protected]@[email protected]\\D`ANTD\\[email protected]@[email protected]{@[email protected]][email protected]?AQWOQIK}@[email protected]@[email protected]@M`@[email protected]@[email protected]@[email protected][email protected]{[email protected]@@[email protected]@[email protected]@IDMFMBEDIBGBKF[@[email protected]@IO?EQAG?EQ{[email protected][email protected]@[[email protected]@[email protected]@[email protected][email protected]@^[email protected]@@[email protected][email protected]}@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected][email protected][email protected]@DB?J?`@[email protected]?BtAB",
7      "distance": 7680.200000000001,
8      "duration": 1632.6999999999998,
9      "legs": [
10        {
11          "distance": {
12            "value": 2510
13          },
14          "duration": {
15            "value": 533
16          },
17          "steps": []
18        },
19        {
20          "distance": {
21            "value": 5169
22          },
23          "duration": {
24            "value": 1098
25          },
26          "steps": []
27        }
28      ]
29    }
30  ]
31}

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.
Distance Matrix
DIDN'T FIND WHAT YOU LOOKING FOR?