Road Segments API

Introduction

The Road Segments API from NextBillion.ai provides users with detailed information on all road segments within a specified geographic area. The service provides users with a list of all road segments, their shapes, midpoints, and associated driving attributes, including maximum speed and direction of travel. Users can define either a circular or bounding box area by providing simple inputs to receive this information.

POST

https://api.nextbillion.io/map/segments?key={your_api_key}


Request Parameters

Loading..

Request Body

Loading..

Response Schema

Loading..

Sample Request

1
curl --location 'https://sgpstg.nextbillion.io/map/segments?key=<your_api_key>' \
2
--header 'Content-Type: application/json' \
3
--data '{
4
"type": "circle",
5
"circle": {
6
"center": {
7
"lat": 1.3132272656379491,
8
"lon": 103.82278560368337
9
},
10
"radius": 100
11
}
12
}'

Sample Response

1
{
2
"code": "Ok",
3
"message": "",
4
"segments": "[...]"
5
}

API Query Limits

  1. The maximum value that can be specified for the radius is 50000m (50 km).
  2. The maximum diagonal length of the configured bounding box should be less than 100,000m (100km).
  3. 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.

API Error Codes

Response codeDescriptionAdditional notes
200Normal success case.Normal success case.
400Input validation failed.There is a missing or an invalid parameter or a parameter with an invalid value type is added to the request.
401APIKEY not supplied or invalidThis error occurs when the wrong API key is passed in the request or the key is missing altogether.
403APIKEY is valid but does not have access to requested resourcesYou 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 foundThis error occurs when a malformed hostname is used.
422Could not process the requestA feasible solution could not be generated for the given set of locations or parameter configuration.
429Too many requestsQPM reached or API request count quota reached.
500Internal Service error.There was an internal issue with NextBillion.ai services. You can reach out to [email protected] for an explanation.

© 2025 NextBillion.ai all rights reserved.