Analysis Preview
Purpose
Perform a GET request to return an analysis preview.
Request data
Format
https://{baseURL}/origindestination/{versionNumber}/analysis/selected-link/{id}?key={Your_API_Key}
Example
https://api.tomtom.com/origindestination/1/analysis/selected-link/512?key={Your_API_Key}
Parameters
Required parameters | Description |
---|---|
| The base URL for calling TomTom services. Value: |
| Version of the service to call. Value: The current value is |
| Analysis number id. Value: The analysis number id. |
| Authorization key for access to the API. Value: Your valid API Key. |
Response data
Response structure
Field | Description |
---|---|
| Information about the analysis. |
| Analysis number id. |
| Job name, given for the user's convenience. |
| Email of the analysis' owner. |
| Authorization key used during creation. |
| Job status. One of the following values:
|
| Current value of the job progress (0-100). |
| Job creation time in |
| Time definition of the analysis. |
| How many trips were counted. Updates when the analysis is in progress. |
| Date and time start of the analysis in the format:
|
| Date and time end of the analysis in the format:
|
| Estimated time in seconds to change the analysis status from
|
| The type of the created analysis. For the Selected Link Analysis the
value is equal to |
| GeoJSON LineString object storing geometry of a link. |
| Map information used during the map matching process. |
| Map version used. |
| The type of version used. Supported types are: |
Response link structure
Field | Description |
---|---|
| Section containing multiple supported formats of data. Each URL covers an incoming part of trips connected with a selected link. |
| Incoming result in JSON format. Your API Key needs to be added to the URL. |
| Incoming result in protobuf format. Your API Key needs to be added to the URL. |
| Incoming result in shapefile format. Your API Key needs to be added to the URL. |
| Incoming result in CSV format. Your API Key needs to be added to the URL. |
| Section containing multiple supported formats of data. Each URL covers an outgoing part of trips connected with the selected link. |
| Outgoing result in JSON format. Your API Key needs to be added to the URL. |
| Outgoing result in protobuf format. Your API Key needs to be added to the URL. |
| Outgoing result in shapefile format. Your API Key needs to be added to the URL. |
| Outgoing result in CSV format. Your API Key needs to be added to the URL. |
| Date range of the result. |
| Start date of the date range in |
| End date of the date range in |
| List of dates to exclude from the given range in |
| Time range of the result. |
| Start time of the time range in |
| End time of the time range in |
Incoming/Outgoing Link response structure
Field | Description |
---|---|
| An array of nodes connected with the selected link. |
JSON response example
1{2 "nodeFormat" : ["id", "parentId", "trips", "geometry"],3 "nodes": [[0,null,2941,[[21.00866,52.23521],[21.00838,52.23515]]],[1,0,44,[[21.00838,52.23515],[21.00835,52.23522]]],...]4}
The result contains a list of 'nodes'. Each node contains the following information:
[Id of link, Parent Id of link, Amount of trips (number), Geometry of link as GeoJSON LineString array]
.
If parentId
is null
, then this is the selected link of the analysis. We also provide self describing information under nodeFormat
key.
CSV response example
1Id;Parent id;Trips;WKT20;;2941;LINESTRING (21.00866 52.23521, 21.00838 52.23515)31;0;44;LINESTRING (21.00838 52.23515, 21.00835 52.23522)42;0;2877;LINESTRING (21.00838 52.23515, 21.0082 52.23512)5...
The result contains nodes stored as separate rows in CSV format separated by a ;
symbol.
If Parent id
is empty, this means the given row is the selected link of the analysis.
Protobuf response example
For more information about the format you can check Protocol Buffers.
The following schema for the protobuf format is required to deserialize the results:
1syntax = "proto3";23message Point {4 double lon = 1;5 double lat = 2;6}78message Node {9 optional uint32 parent_id = 1;10 uint32 id = 2;11 uint32 trips = 3;12 repeated Point geo = 4;13}1415message Result {16 repeated Node nodes = 1;17}
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 |
---|---|
| OK |
| Bad Request |
| Unauthorized |
| Forbidden |
| Not Found |