O/D Analysis

Analysis Partial Trips Result

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

Get a partial trips result 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

post
URL request format
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/{id}/result/partial/trips?key={Your_API_Key}&dateRange={dateRange}&timeRange={timeRange}

Example

post
URL request example
https://api.tomtom.com/origindestination/1/analysis/flowmatrix/123/result/partial/trips?key={Your_API_Key}&dateRange=0&timeRange=0

Required parameters

Required parameters

Description

id
integer

Analysis number id.


Value: The analysis number id.

key
string

Authorization key for access to the API.


Value: Your valid API Key.

dateRange
integer

Index of the date range.


Value: Example: 0

timeRange
integer

Index of the time range.


Value: Example: 0

Optional parameters

Optional parameters

Description

excludeSameODTrips
boolean

Drops every link whose origin equals its destination, that is the internal traffic of a region.


Default value: false

Required POST headers

Header

Value

Content-Type

application/json

Request POST body example

post
Request POST body example - JSON
{
"origins": [0, 1, 2, 3],
"destinations": [4, 5, 6, 7, 8],
"vias": [10]
}

Request POST body stucture

Field

Description

origins
array (of integers)

List of region indexes where trips started. Must not be empty.

destinations
array (of integers)

List of region indexes where trips ended. Must not be empty.

vias
array (of integers)

List of region indexes where trips went through.


Leaving it out, or sending an empty list, is not a wildcard: it returns the origin-destination view, that is only the links whose via equals their destination. Send the indexes of all your regions to get the full drill-down by via region.

Response data

This response returns the normalized trip count for trips that started at a given origin, went through the given vias, and ended at a given destination. The result is available once the analysis reaches the ACCEPTED status.

Response example

A link has five positions:

post
Response body
{
"links": [[0,0,0,0,28.5], [0,1,1,2,3.0], ...]
}

[0,0,0,0,28.5] - [Origin region index (number), Destination region index (number), Via region index (number), externalEndsCode (number), Normalized trip count (number)]

Reading the normalized trip count

The last position of a link is the normalized trip count for this date range and time range - for the whole analysis, not for the subset you asked about, as described at Normalized probe counts. Filtering by origins, destinations or vias therefore never rescales the values: it only removes links.

  • With vias left empty, the returned links add up to at most 100, and to exactly about 100 when you ask for all origins and all destinations.
  • With vias filled in, the same trip can appear in several links, so the values add up to more than the origin-destination view.
  • Normalized values of two different results - a different dateRange or timeRange - have different denominators and must not be added together.

Response structure

Field

Description

links
array

An array of links between regions.

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

200

OK

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found