Junction Analytics

Generate Historical Data Archive

Important Note Explore ready-to-use traffic reports and data visualizations immediately by signing up for a 30-day free trial on the MOVE Portal. Once registered, you’ll receive an API key to start using the Traffic Analytics APIs right away. Alternatively, you may contact our Sales team for a tailored solution.

Purpose

Important Note This endpoint works only if you have been granted access to enhanced features.

The Generate Historical Data Archive endpoint allows you to create an archive generation task for selected junctions within a specified date range.

Request data

You can generate an archive by sending a POST request.

HTTPS method: POST

post
URL request example
https://api.tomtom.com/junction-analytics/junctions/1/archive/data/tasks/generate?key={Your_API_Key}

POST request body example

post
POST request body example - JSON
{
"junctionIds": ["65268ff77cd5d952a185b9b5", "65268ff77cd5d952a185b9b6"],
"startDay": "2024-08-01",
"endDay": "2025-08-01"
}

Request parameters

The following table shows the query parameters:

  • Required parameters must be used or the call will fail.
  • Optional parameters may be used.
Required parametersDescription

key string

An API Key valid for the requested service. Value: Your valid API Key.

Post request body fields

FieldTypeDescription
junctionIdsarrayList of junction IDs for which the archive generation task is created.
startDaydateStart date of the archive generation task in the format YYYY-MM-DD. This is the first day for which the archive will be generated.
endDaydateEnd date of the archive generation task in the format YYYY-MM-DD. This is the last day for which the archive will be generated.

Request headers

HeaderValue
Content-Typeapplication/json

Example request

The following is an example curl request to generate an archive for specific junction IDs and date range:

post
curl command example
$ curl 'https://api.tomtom.com/junction-analytics/junctions/1/archive/data/tasks/generate?key={Your_API_Key}' -i -H 'Content-Type: application/json' -X POST -d '
{
"junctionIds": ["65268ff77cd5d952a185b9b5", "65268ff77cd5d952a185b9b6"],
"startDay": "2024-08-01",
"endDay": "2025-08-01"
}'

Response data

This response returns the ID of the archive generation task.

The response status tells you whether a task was created:

  • 202 Accepted - the archive generation was triggered for at least one of the requested junctions. The body contains the task id and lists the junctions that were and were not triggered.
  • 422 Unprocessable Entity - none of the requested junctions could be triggered. No task is created, id is null and isSuccess is false. The body has the same shape as for 202 and lists the reason for every junction.

Response body example

post
Response body example - JSON
{
"id": "65268ff77cd5d952a185b9b7",
"isSuccess": true,
"triggeredJunctions": ["65268ff77cd5d952a185b9b5"],
"notTriggeredJunctions": {
"NO_ARRIVAL_POINTS": ["65268ff77cd5d952a185b9b6"]
}
}

Response fields

The following section describes all of the fields that can appear in a response.

id (string) - Unique identifier for the archive generation task. This ID can be used to check the status of the task later. null when no junction was triggered (422).

isSuccess (boolean) - true when the archive generation was triggered for at least one junction (202), even if other junctions were not triggered. false when no junction was triggered (422).

triggeredJunctions (array) - List of junction IDs for which the archive generation task was successfully triggered.

notTriggeredJunctions (object) - Contains junction IDs that were not triggered, along with the reason for failure. The keys represent the failure reasons, and the values are arrays of junction IDs. Possible keys:

  • JUNCTION_NOT_FOUND - the junction does not exist or does not belong to your account.
  • NO_ARRIVAL_POINTS - the junction has no arrival points, so no arrival-time data can be generated for it.
  • JUNCTION_IN_PROGRESS - another archive generation task of the same archiveType that is still IN_PROGRESS already covers this junction and an overlapping date range.

Errors

The system generates an error response if there is an error in the supplied parameters or any other internal problem. This response is generated in the requested format.

Error response codes

The following table shows the HTTP error response codes.

CodeDescription
401

Unauthorized

403

Forbidden

422

Unprocessable Entity None of the requested junctions could be triggered. The body has the same shape as the success response, with id set to null and isSuccess set to false.

Error response field

FieldDescription

message string

The problem description.

Example error response

The following is an example error response for Unprocessable Entity:

post
Response body example - JSON
{
"id": null,
"isSuccess": false,
"triggeredJunctions": [],
"notTriggeredJunctions": {
"JUNCTION_NOT_FOUND": ["65268ff77cd5d952a185b9b5"],
"NO_ARRIVAL_POINTS": ["65268ff77cd5d952a185b9b6"]
}
}