HERE traffic api - Getting historical traffic data

2.7k views Asked by At

I would like to get a traffic data map tile for a specific time. To do this, https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-traffic-flowbasetile.html as written in the documentation, I passed the "time" parameter. however, it looks like it does not work properly.

Requested example URL: https://1.traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day/13/4358/2842/512/png?apiKey=apikey&ppi=500&time=2021-08-03T16:00:00Z

enter image description here

The response of real time traffic data on 2021-09-21T16:31:00z. I got this result without passing time parameter at exactly this time 2021-09-21T16:31:00z.

https://1.traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day/13/4358/2842/512/png?apiKey={apikey}&ppi=500

enter image description here

The response of data when I passed the time parameter.

https://1.traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day/13/4358/2842/512/png?apiKey={apikey}&ppi=500&time=2021-09-21T16:31:00z

As I tested the historical data response with my already saved response(when i requested to realtime traffic data) they are not same. Historical traffic data always returns similar response with little changes but they are not right. It even returns result for future dates like 2022. Is the API broken? It works for realtime traffic data but has problems when i specify the time.

2

There are 2 answers

0
Shambhu On

In Here Map Tile V2, you need to pass a timestamp after 2009, as a time before the year 2009 is not supported. For rest, the historical traffic data tile works well.

1
AudioBubble On

To achieve your request you should not use a time before year 2009 as this is not supported.

Response with Time parameter --

https://1.traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day/13/4358/2842/512/png?apiKey={YOUR_API_KEY}&ppi=500&time=2021-09-13T16:00:00z

enter image description here

Also please check the documentation for your reference.

https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-traffic-traffictile.html