Result aggregation
Purpose
Get aggregated report results for a specific feature by sending a GET request.
Request data
HTTPS method: GET
For ease of viewing and identification:
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- See the Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
Format
https://{baseURL}/areaanalytics/reports/{id}/results/{featureId}/aggregated?key={Your_API_Key}&aggregation={aggregation}&daysOfWeek={daysOfWeek}&hours={hours}&excludeDates={excludeDates}&excludeAnomalies={excludeAnomalies}
Example
https://api.tomtom.com/areaanalytics/reports/550e8400-e29b-41d4-a716-446655440000/results/660e8400-e29b-41d4-a716-446655440000/aggregated?key={Your-API-Key}&aggregation=DAILY
Request parameters
Required parameters | Description |
|---|---|
| The base URL for calling TomTom services. Value: |
| The unique identifier of the report. Value: A valid UUID format string. |
| The unique identifier of the feature/region. Value: A valid UUID format string. |
| Authorization key for access to the API. Value: Your valid API key. |
Optional parameters | Description |
|---|---|
| The type of time-based aggregation to apply to the results. Possible values:
|
| Filter results to include only specific days of the week. Value: Array of integers from 1 (Monday) to 7 (Sunday) according to ISO 8601 standard. |
| Filter results to include only specific hours of the day. Value: Array of integers from 0 to 23. |
| Exclude specific dates from the aggregation. Value: Array of date strings in ISO format (YYYY-MM-DD). |
| Whether to exclude anomalous data points from the aggregation. Value: |
Response data
Response format
The response contains aggregated results in JSON format with the structure defined by the AggregatedResponse schema.
Response body example
1{2 "points": [3 {4 "time": "2024-08-01T00:00",5 "v": 22.2,6 "fv": 27.4,7 "c": 23.4,8 "t": 27.0,9 "l": 15.7410 },11 {12 "time": "2024-08-02T00:00",13 "v": 22.2,14 "fv": 27.4,15 "c": 23.4,16 "t": 27.0,17 "l": 15.7418 }19 ]20}
Response body fields
Data Key | Description |
|---|---|
time | Time aggregation level. Possible values:
|
l | NETWORK_LENGTH - Sum of all road network segments where data was provided. |
c | CONGESTION_LEVEL - Average congestion is calculated by collecting all travel times recorded by TomTom during a given period in a specific area and comparing them with the lowest travel times from when traffic is in a completely fluid state. Congestion is expressed as a percentage, indicating the increase in travel time due to excess traffic. For example, a congestion level of 40 means that, on average, journey times across that area's road network were 40% greater than when traffic is free-flowing. |
fv | FREE_FLOW_SPEED - Average free-flow travel times are based on static factors in each city, making the score relevant to that city's infrastructure and environment. |
t | TRAVEL_TIME - Average travel time per 10 km. |
v | SPEED - Average speed on the road network. |
Errors
If the supplied parameters are invalid or an internal error occurs, the API returns an error response in the requested format.
Response codes
Code | Meaning & possible causes |
|---|---|
| OK |
| Bad Request |
| Unauthorized |
| Forbidden |
| Not Found |