I am trying to retrieve some historical data regarding incidents from Tomtom's api using requests module in python.
I tried this code:
#defining the retrieved properties of the incident
query = '{incidents{geometry{type,coordinates},properties{iconCategory,startTime,endTime,length}}}'
url = "https://api.tomtom.com/traffic/services/1/history/incidentDetails"
params = {
"key": "I entered my key",
"bbox": "-73.9345 40.71481 -73.95557 40.70115",
"date": "2023-05-25",
"time": "14:00:00",
"fields": "{incidents{geometry{type,coordinates},properties{iconCategory,startTime,endTime,length}}}"
}
# Send the POST request to the incident endpoint
response = requests.get(url, params = params)
print(response)
the output response was:
<Response [596]>
instead of:
<Response [200]>