Analysis Trips Result
Purpose
Get the full trips result by sending a GET request.
Request data
HTTPS Method: GET
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/flowmatrix/{id}/result/trips?key={Your_API_Key}&dateRange={dateRange}&timeRange={timeRange}Example
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/123/result/trips?key={Your_API_Key}&dateRange=0&timeRange=0Request parameters
Required parameters | Description |
|---|---|
| Analysis number id. Value: The analysis number id. |
| Authorization key for access to the API. Value: Your valid API Key. |
| Index of the date range. Value: Example: |
| Index of the time range. Value: Example: |
Optional parameters | Description |
|---|---|
| Drops every link whose origin equals its destination, that is the internal traffic of a region. Default value: |
Response data
This response will return information about all linked connections. The result is available once the
analysis reaches the ACCEPTED status, and it is served as a file attachment named
trips_{dateRange}_{timeRange}-v2.json.
Response structure
Field | Description |
|---|---|
| An array of links between regions. Value: See the following example. |
Each link’s origin and destination are always real region indices: an end that falls outside your regions is attributed to the boundary region the trip actually used, the first region it entered for the origin and the last region it left for the destination.
externalEndsCode
Value | Meaning |
|---|---|
| Both ends of the trip are inside the regions. |
| The trip started outside and ended inside the regions. |
| The trip started inside and ended outside the regions. |
| Both ends of the trip are outside the regions. |
Result interpretation example
A link has five positions: [origin, destination, via, externalEndsCode, normalized trip count].
{ "links": [ [0, 0, 0, 0, 33.6], [0, 0, 0, 1, 18.7], [0, 1, 1, 2, 2.8], [1, 0, 1, 1, 3.2], [1, 1, 1, 3, 6.6] ]}Five rows of an analysis of two regions, where index 0 and 1 follow the order of the regions list of the creation request.
[0, 0, 0, 0, 33.6]- trips that both started and ended inside region 0.[0, 0, 0, 1, 18.7]- the same origin and destination, but the trip started outside the defined regions and entered the analysis area through region 0. Only the last position differs from the row above, soexternalEndsCodeis what separates them.[0, 1, 1, 2, 2.8]- from region 0 to region 1, ending outside the defined regions, leaving the analysis area through region 1.[1, 0, 1, 1, 3.2]- here via is not the destination, so this row belongs to the drill-down rather than to the origin-destination view.[1, 1, 1, 3, 6.6]- both ends outside the defined regions; the trip only passed through region 1.
An empty result is {"links":[]}.
Reading the normalized trip count
The last position of a link is the normalized trip count for this date range and time range, described at Normalized probe counts. A trip counts once towards that total, no matter how many links it appears in.
- The links whose via equals their destination are the origin-destination view of the analysis. Their normalized values add up to about 100.
- Every other link is part of a drill-down by via region. Adding those values up gives more than 100, because a trip that passed through three regions is present in three links.
- Normalized values of two different results - a different
dateRangeortimeRange- have different denominators and must not be added together.
Region indices follow the order of the regions list of the creation request.
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 |