Sorry, you need to enable JavaScript to visit this website.

Analysis Histogram Result As CSV File

Request

Get full histogram result as csv file by sending a GET request.

https://api.tomtom.com/origindestination/1/analysis/flowmatrix/<id>/result/histogram/csv?key=<apiKey>&dateRange=<dateRange>&timeRange=<timeRange>&type=<type>

Example

https://api.tomtom.com/origindestination/1/analysis/flowmatrix/123/result/histogram/csv?key=test-api-key&dateRange=0&timeRange=0&type=HOURS_OF_DAY

Parameters

ParameterDescription

apiKey

Authorization key for access to the API.

dateRange

Index of date range.

timeRange

Index of time range.

type

Type of histogram. One of the following values:

  • HOURS_OF_DAY - hour of day when trips started

  • LENGTHS - trips lengths in kilometers

  • DURATIONS - trips durations in minutes with 20 minutes interval

Response

This response will return csv file containing all histograms for all possible combinations of single origin and destination. The array size depends on histogram type you choose:

typesize of array

HOURS_OF_DAY

24

DURATIONS

no limitation (contains all durations buckets for minimal interval of 5 minutes)

LENGHTS

no limitation (contains all length buckets for minimal interval of 1 kilometer)

Response structure

Response contains csv which should be self describing. First row contains labels and next rows contains data. First two columns are reserved for region name and rest is reserved for histogram values.

Result example

Origin,Destination,0,5,10,15,20,25,30,35,40,..
Region A,Region A,41,21,10,4,0,0,1,2,0,..
Region A,External,473,555,263,174,107,78,78,45,34,..
External,Region A,435,469,213,142,105,86,66,39,42,..
External,External,850,2265,2294,1666,1141,902,665,524,487,..

Errors

If there is an error in the supplied parameters or any other internal problem an error response is generated in the requested format.

HTTP Response Codes
CodeReason

201

Created

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found