Analysis Creation
Purpose
Create a Selected Link Analysis by sending a POST request.
Request data
HTTPS Method: POST
For ease of viewing and identification:
- Parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
Format
https://api.tomtom.com/origindestination/1/analysis/selected-link?key={Your_API_Key}Example
https://api.tomtom.com/origindestination/1/analysis/selected-link?key={Your_API_Key}Request parameters
Required parameters | Description |
|---|---|
| Authorization key for access to the API. Value: Your valid API Key. |
Request POST body structure
Required fields | Description |
|---|---|
| Job name string which will be used in the process and output. Given for the user’s convenience. |
| Version of the analysis to create. Value: The field itself is optional in the API and defaults to |
|
|
| Time definition for the analysis. |
| Time zone for the analysis as a
TZ database name. For example |
| Days of the week to analyze. Applies to every date range that does not declare its own
|
| List of date ranges to analyze. The earliest and the latest date you may request, and the maximum number of date ranges in a single analysis, are part of the limits granted to your contract. (Limit: a single date range cannot cover more days than the calendar year it starts in, that is 365 or 366 days.) |
| List of time ranges to analyze. The maximum number of time ranges in a single analysis is part of the limits granted to your contract. |
Optional fields | Description |
|---|---|
| Determines from what devices data will be used.
|
| Optional parameter indicating which map version should be used for map-matching. If not provided, a map version will be selected automatically based on the selected date ranges. You can check the list of available maps at Available maps. The value of this parameter should align with the selected date range in order to avoid confusion. For an analysis that requests traffic volume, the map version has to be one that carries traffic volume data, and that is what the automatic selection picks. See Enhanced metrics. If your date ranges span two calendar years, the analysis accepts the traffic volume map version of either the first or the last day of the analysis period. |
| Radius of the analyzed area.
|
| List of functional road classes (FRCs) used to define entrance and exit roads for the specified region. This parameter restricts the analysis to selected road classes intersecting the region. Accepts values: 0 to 7. Note:
|
| List of additional metrics to calculate for every node of the result tree.
See Enhanced metrics for the full list of prerequisites. |
Enhanced metrics
TRAVEL_TIME_AND_DISTANCE has no prerequisites beyond "analysisVersion": 2.
VOLUME enriches every node of the result with the estimated absolute traffic volume on it, a model estimate rather than a vehicle count.
See the volume field under Node fields for how that estimate is derived and distributed across the result tree.
All of the following must hold:
- The traffic volume data must cover the whole
linkgeometry. - All requested date ranges must fall inside the period for which traffic volume data is available in that area, and the last requested day must be at least four days in the past. The response lists the period you may use.
- The map version used for the analysis must be one that carries traffic volume data for the year of your date ranges.
See the
mapVersionrow of the request POST body structure table for how that version is chosen, and Finding the map version that supports traffic volumes for how to look it up. - A LineString
linkmust map-match to exactly one road segment, so it must not route over more than one.
Finding the map version that supports traffic volumes
Only one map version carries traffic volume data for a given calendar year, and it is not always the newest map available for the area.
Ask the Available maps endpoint for it with onlyVolumeVersions=true and a from date taken from your analysis period, then pass the returned version as mapVersion in the analysis request.
Required POST headers
Header | Value |
|---|---|
|
Request POST body example
{ "name": "Selected Link Example", "analysisVersion": 2, "time": { "dateRanges": [ { "startDate": "2026-01-05", "endDate": "2026-01-10" }, { "startDate": "2026-02-05", "endDate": "2026-02-10" }, { "startDate": "2026-02-09", "endDate": "2026-02-10", "name": "weekend" } ], "daysOfWeek": [ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY" ], "timeRanges": [ { "startTime": "08:00", "endTime": "12:00" }, { "startTime": "15:00", "endTime": "19:00" } ], "zoneId": "Europe/Warsaw" }, "link": { "type": "LineString", "coordinates": [ [21.02143, 52.24896], [21.02401, 52.25008] ] }}All date ranges and all time ranges are multiplied to cover all possible time definitions. The preceding example has 3 date ranges and 2 time ranges, so it results in 6 different periods:
2026-01-05 - 2026-01-10 : 08:00 - 12:002026-01-05 - 2026-01-10 : 15:00 - 19:002026-02-05 - 2026-02-10 : 08:00 - 12:002026-02-05 - 2026-02-10 : 15:00 - 19:002026-02-09 - 2026-02-10 : 08:00 - 12:002026-02-09 - 2026-02-10 : 15:00 - 19:00
Request POST body example with traffic volumes
Replace {volumes_map_version} with the traffic volume map version for your analysis period, looked up as described in
Finding the map version that supports traffic volumes.
{ "name": "Selected Link Example with volumes", "analysisVersion": 2, "enhancedMetrics": ["VOLUME", "TRAVEL_TIME_AND_DISTANCE"], "mapVersion": "{volumes_map_version}", "time": { "dateRanges": [ { "startDate": "2026-03-02", "endDate": "2026-03-08" } ], "daysOfWeek": [ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY" ], "timeRanges": [ { "startTime": "08:00", "endTime": "12:00" } ], "zoneId": "Europe/Warsaw" }, "link": { "type": "LineString", "coordinates": [ [21.02143, 52.24896], [21.02401, 52.25008] ] }}Date range format
Required fields | Description |
|---|---|
| Start date of the date range in |
| End date of the date range in |
Optional fields | Description |
|---|---|
| List of dates to exclude from the given range in |
| Days of the week for this date range only. When present, it overrides Default value: the days of the week given as |
| Date range name. Given for the user’s convenience.
Value: A date range name. For example: Default value: none. When the field is omitted, the date range has no name and the field is absent from the response. |
Time range format
Required fields | Description |
|---|---|
| Start time of the time range in |
| End time of the time range in |
NOTE: To analyze a whole day you should use 00:00 for both the startTime and endTime.
NOTE: A time range must be at least 1 hour long.
Response data
This response will return information about the created analysis. The following table describes all of the fields that can appear in a response.
Response structure
Field | Description |
|---|---|
| Analysis number id. |
| Job name, given for the user’s convenience. |
| Analysis type. Always |
| Version of the created analysis. Use it to confirm that the analysis was created as version
|
| Job status. One of the following values:
|
| Current value of the job progress (0-100). |
| Job creation time in |
| Date and time start of the analysis in format:
|
| Date and time end of the analysis in format:
|
| Time definition of the analysis. |
| Time zone as a
TZ database name. For example |
| Days of the week of the analysis. Allowed values:
|
| List of date ranges of the analysis. |
| List of time ranges of the analysis. |
| Data sources the analysis runs on. |
| Enhanced metrics the analysis was created with. Not returned when the request did not contain the field. |
| The analyzed geometry, as a GeoJSON LineString or Polygon. For a LineString this is the geometry after map-matching, not the geometry you sent. |
| Identifiers of the map segments the link was matched to. Empty for a Polygon link. |
| The map used for map-matching. |
| Map version, as a string in the |
| Name of the map the version belongs to. |
| Radius of the analyzed area, in meters. |
| Functional road classes used to define entrance and exit roads of the region. Omitted when not applicable. |
Errors
If there is an error in the supplied parameters or any other internal problem, an error response is generated in the requested format.
Response codes
Code | Meaning & possible causes |
|---|---|
| Created |
| Bad Request |
| Unauthorized |
| Forbidden |
| Not Found |