Live Traffic incident api

How to get bounding box values from start location and end location of my journey? my start location lat,long respectively 10.00938666701447,76.363287632939, end location lat,long respectively 9.98573996319036,76.35235659778118. Without bounding box values i am not able to get response in live traffic api. I am getting only tm id as response. . What it means? I am able to hit calculate route api with this data. I am sitting with this issue for past one week. here i am giving my api call for reference https://api.tomtom.com/traffic/services/4/incidentDetails/s3/10.00938666701447,76.363287632939,9.98573996319036,76.35235659778118/11/1335294634919/xml?key=my_api_key. This location is in india. hoping someone will help in this.

You can use for example Turf.js to calculate bounding box of your route.
Use points from Routing API response as an input for bbox() function.
Example: https://turfjs.org/docs/#bbox

1 Like