Retrieving raw traffic data between two points

I have a simple web app that I’m building and need data to express the amount of traffic between two points on a major route. I’m looking at flow segment data in the Traffic API but it only lets you input one set of coordinates and then returns a bunch of coordinates around it I don’t care about. I don’t want any tiles/maps, only data

1 Like

Hmm… If you just run Routing API calculate route endpoint with param computeTravelTimeFor=all then you can get info if there is any delay due to traffic or not.
Is this sufficient for your case?

Hey, i am also interested in such a feature. But more than just the time difference is needed. As already described, trafic data of the entire route.

I figured out how to do it @simondev . You need to use the route api not traffic, you pick a start and endpoint for your route with lat/long coords. With that I can get the travel times in seconds and calculate if traffic is good (80% to 100% normal travel time), meh (40-80% of normal time) or bad (slower than 40 % of normal travel time).

Example api response:

“lengthInMeters”: 1909,
“travelTimeInSeconds”: 534,
“trafficDelayInSeconds”: 358,
“trafficLengthInMeters”: 1500,
“departureTime”: “2021-07-22T16:03:35-04:00”,
“arrivalTime”: “2021-07-22T16:12:28-04:00”,
“noTrafficTravelTimeInSeconds”: 169,
“historicTrafficTravelTimeInSeconds”: 191,
“liveTrafficIncidentsTravelTimeInSeconds”: 534

1 Like