Trace the route taken

Product Used: Post Trip Route API


Using NextBillion.ai’s Post Trip Route API you can trace the actual route taken by your vehicles. The Post Trip API will take into account a list of tracked locations while the vehicle was on trip and returns the total distance along with the geometry of the route taken. Use the information returned in the response to fulfill business functions like disbursing fuel allowances, logging miles covered, quality assessments for the services provided by the vehicles in your fleet.

Following is a sample request with

  • list of tracked location coordinates provided as input for “waypoints”.
  • “mode” option set to “truck”
  • “geometry” parameter is set to “polyline6” to indicate the format in which the path geometry is needed.

Request

1
2
3
4
5
6
7
curl --location 'https://api.nextbillion.io/postTripRoute?key=<your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"waypoints":"34.04932289,-118.25573833|34.04711381,-118.24976846|34.04153727,-118.2310818|34.03881998,-118.20756901",
 "mode":"truck",
 "geometry": "polyline6"
}'

Response

On successfully submitting the above request the service responds with total distance covered by the truck along with the geometry of the route.

1
2
3
4
5
6
7
{
   "status": "Ok",
   "route": {
       "geometry": "wyd}_A~_vp`FnKrIbV_b@rSc`@jCgEzO{YfEkHzJwQvBgEzTc`@~H_NnKcQrIoPrIgOvGwLbLsSjHkMnKkR~CoFnAkCnKwQ_NsN_IsI{EgEwVcV{E{EcGoFsIrNvLfJ~CjCjHbGz@nAf@z@?nASbB{@bBg@f@oA?oAg@kRwQgE{E??{@oARoAjCgErIsN{O{Og^_]_XkWcLgJsSoPvB_DbBwBbQ{TvG_IvG_I~C_DzEwGnAcBnAwBnAwBf@oAz@oAvBoFvBgEvQce@nAkCbG_NvB{EvBwG~CcLbBsIjM{h@vBoKnFoPbGwL~Rw`@j\\sl@j\\wo@r]on@fJkRrD_Iz@kCnA_DvLkp@z@_InAwGR_DR_DRgE?gESoAg@{Jg@kHwB{^ScBSwBg@gJg@wL_Dgh@SwBg@wL?sDRcG?cBR_Df@sDRwBvB_IzE{JbLsSzJ_S~R_b@~a@{w@nPs]bBsDbBgEz@wBf@kCz@kCf@sDz@gEz@gERsDRoFRwG?{@g@cwAS_XSgY?wB?kC?_D?g@SsX?wBSgYS{Jg@sDg@gEoA{JoA{Eg@sDoUchAgE{TcLkk@cGk\\sIka@cGoZg@kCg@oAoAwGSwBSkCScGg@g^g@g^g@sNSkHSoK?kHSsN?gOSkC?_DSgES{TSgOg@wLSwQ{@we@S_S?cGSwB?oA?_NRgE?kCz@oFRoAnAoFR{@f@cBR{@f@cBnAgEbBoFrD{JjCsIjHsS~Rwj@jCsIjCkH~CgJvBcGfOod@nPwe@~HcVzE_NzE_NjCsIf@oAjC_IrDgJjCgJbGwQzE_Nz@wBbGoPnAsDrDoKfE_NbGcQv[c~@jH{TnUsq@",
       "distance": 5277.3
   }
}

Visit Post Trip Route API documentation to know more about the available features.

Have Questions ?