• Optimization
  • Navigation
  • Tracking
  • Maps
  • Places

Isochrone API

Introduction

An isochrone represents a path that joins all the points with the same travel time or travel distance from a specific point of reference. NextBillion.ai’s Isochrone API calculates the regions that can be reached within a designated time frame from a given location. It returns these accessible areas as contours of polygons or lines, which can be conveniently displayed on a map. Additionally, this API also enables the creation of contours based on distance. With the Isochrone API users can easily define serviceable areas or delivery zones based on travel times from a starting location

The Isochrone API can be accessed through the HTTPS GET method. Let’s take a look at the features and properties of this service.


GET

https://api.nextbillion.io/isochrone/json?key={your_api_key}

Request Parameters

Loading..

Response Schema

Loading..

Sample Queries

GET Request Example 1

Let’s build a basic Isochrone API request to determine the area that a car can cover within a driving time of 20 minutes when a given coordinates is the starting point.

Request

1curl --location 'https://api.nextbillion.io/isochrone/json?key=<your_api_key>&coordinates=34.04715844,-118.24977187&mode=car&contours_minutes=5'

Response

1{
2 "features": [
3 {
4 "properties": {
5 "fill": "#bf4040",
6 "fillOpacity": 0.33,
7 "fillColor": "#bf4040",
8 "color": "#bf4040",
9 "contour": 5.0,
10 "opacity": 0.33,
11 "metric": "time"
12 },
13 "geometry": {
14 "coordinates": [
15 [
16 -118.243772,
17 34.051682
18 ],

Here is how the above response looks on a map. We can easily visualize the area reachable within 20 minutes. It is enclosed by a contour line or a polygon around the starting point provided in the coordinates parameter

isochrone example 1

GET Request Example 2

Taking the next step for the same coordinates point and same contour_minutes value, let’s expand the request to configure the following parameters:

  • set mode = truck to see what areas can a truck cover

  • set denoise to a low value to receive exact pockets of areas that can or cannot be covered within the given time

Request

1curl --location 'https://api.nextbillion.io/isochrone/json?key=<your_api_key>&coordinates=34.03849472,-118.24424250&mode=truck&contours_minutes=5&denoise=0.001'

Response

1{
2 "features": [
3 {
4 "properties": {
5 "fill": "#bf4040",
6 "fillOpacity": 0.33,
7 "fillColor": "#bf4040",
8 "color": "#bf4040",
9 "contour": 5.0,
10 "opacity": 0.33,
11 "metric": "time"
12 },
13 "geometry": {
14 "coordinates": [
15 [
16 -118.244772,
17 34.050702
18 ],

Here is how the above response looks. Notice a smaller polygon appears within the large one when we set denoise to a low value. This smaller polygon encloses the area that can not be reached by a truck within 20 minutes from the starting point.

isochrone example 1

API Query Limits

  • Only one of contours_meters or contours_minutes should be provided in the input request. A 400 error is returned if none of them are provided. We do not recommend using both contours_meters or contours_minutes together in a request.

  • Up to 4 isochrones can be requested using the contours_minutes parameter with a maximum allowed value of 40 minutes.

  • Up to 4 isochrones can be requested using the contours_meters parameter with a maximum allowed value of value of 60000 meters.

  • 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.
Such as missing parameter or parameter with invalid value type (for example value cannot be parsed into number).
401APIKEY not supplied or invalid.
This 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 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 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.