O/D Analysis

Analysis Trips Result as a CSV file

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 the full trips result as a CSV file 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

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

Example

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

Request 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

Description

includeVia
boolean

Adds a Via column and breaks the rows down by via region. Without it the file holds the origin-destination view only.


Value: Example: true


Default value: false

Response data

This response returns a CSV file containing the trips per origin and destination, or per origin, destination and via when includeVia=true. The file is served as an attachment named trips_{id}_{dateRange}_{timeRange}-v2.csv.

Response structure

The response contains a CSV file which should be self describing.

  • The first row contains labels.
  • The following rows contain data.
  • The key columns are Origin,Destination, or Origin,Destination,Via when includeVia=true. They are followed by ExternalEndsCode, and the last column, Trips, holds the value.

The file holds only the combinations that carry trips, sorted by origin, destination, via and ExternalEndsCode. A combination with no traffic gets no row.

Trips is the normalized trip count for this date range and time range, written with a dot as the decimal separator.

Without includeVia the rows are the origin-destination view and add up to about 100. With includeVia they are a drill-down by via region and add up to more, because a trip that passed through three regions appears in three rows. See Normalized probe counts.

Region names come from the name property of the analyzed regions; a comma in a name is replaced with a hyphen, and a region without a name is written as Region {index}.

Every key column names one of your own regions. A trip that starts or ends outside your regions is counted under the boundary region it entered or left, and ExternalEndsCode records which of its ends fell outside. It takes the same four values as externalEndsCode in the JSON result.

Response example

CSV response example
Origin,Destination,ExternalEndsCode,Trips
Region A,Region A,0,28.5
Region A,Region A,1,4.2
Region A,Region B,2,3.0
Region B,Region A,1,5.5
Region B,Region B,0,23.0

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