Define sales territory

Product Used: Isochrone API

NextBillion.ai’s Isochrone API helps in identifying all the areas that an agent can reach within a given amount of time once he starts from a given starting point. The Isochrone service takes into account the driving mode and the usual traffic conditions at the time of making the request to return a polygon boundary covering the area which can be reached within the given constraints. Hence, Isochrone API can be used to identify the orders that an agent can fulfill in a given time, based on his current location.

In this example we will find out the areas that an agent can service within 15 minutes if he is currently located in the Boyle Heights area of Los Angeles. In the input request we provide:

  • “coordinates” set to the current location of the agent
  • “mode” option set to “car”
  • A travel duration constraint of 15 mins
  • A “departure_time”

Isochrone API request

1
curl --location 'https://api.nextbillion.io/isochrone/json?key=<your_api_key>&coordinates=34.04568931,-118.20730790&mode=car&contours_minutes=15&departure_time=1716197400'

Isochrone API response

The response returns an area, in geojson format, which can be serviced by the agent within 15 mins with the given traffic conditions at the given departure time.

1
{
2
"features": "[...]",
3
"type": "FeatureCollection",
4
"status": "Ok"
5
}

Visit Isochrone API documentation to know more about the available features

© 2024 NextBillion.ai all rights reserved.