Snap To Roads API

Introduction

Nextbillion.ai Snap To Roads API takes a series of locations along a route, and returns the new locations on this route that are snapped to the best matched roads where the trip took place. You can set various parameters, such as timestamps or radiuses, to optimize the result.

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/snapToRoads/json?key={{api_key}}&path=41.375371501680604,2.1358108520507812|41.3753352 7276556,2.1364009380340576|41.375246713110485,2.1372538805007935|41.37543188316085,2.137919068336487|41. 37525878943418,2.138814926147461|41.375343323637296,2.1397966146469116|41.37491260059898,2.140027284622 1924|41.xxxxxxxxxxxxxxx,2.1400755643844604&interpolate=true&timestamps={{cur-time}}|{{cur-time2}}|{{cur-time3}}|{{cu r-time4}}|{{cur-time5}}|{{cur-time6}}|{{cur-time7}}|{{cur-time8}}&radiuses=25|25|25|25|25|25|25|25

Sample API Response

1{
2  "status": "Ok",
3  "snappedPoints": [
4    {
5      "location": {
6        "latitude": 37.786766,
7        "longitude": -122.412333
8      },
9      "originalIndex": 0,
10      "distance": 4,
11      "name": "Shannon St",
12      "bearing": 0
13    },
14    {
15      "location": {
16        "latitude": 37.786766,
17        "longitude": -122.412333
18      },
19      "originalIndex": 1,
20      "distance": 4,
21      "name": "Shannon St",
22      "bearing": 0
23    },
24    {
25      "location": {
26        "latitude": 37.786766,
27        "longitude": -122.412333
28      },
29      "originalIndex": 4,
30      "distance": 4,
31      "name": "Shannon St",
32      "bearing": 0
33    },
34    {
35      "location": {
36        "latitude": 37.786766,
37        "longitude": -122.412333
38      },
39      "originalIndex": 5,
40      "distance": 4,
41      "name": "Shannon St",
42      "bearing": 0
43    },
44    {
45      "location": {
46        "latitude": 37.786766,
47        "longitude": -122.412333
48      },
49      "originalIndex": 6,
50      "distance": 4,
51      "name": "Shannon St",
52      "bearing": 0
53    },
54    {
55      "location": {
56        "latitude": 37.786766,
57        "longitude": -122.412333
58      },
59      "originalIndex": 7,
60      "distance": 4,
61      "name": "Shannon St",
62      "bearing": 0
63    }
64  ],
65  "distance": 0,
66  "geometry": ["ifseF`tcjV??????????"]
67}

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