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

Analysis Partial Histogram Result

Request

Get partial histogram result by sending a POST request.

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

Example

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

Required POST Headers

HeaderValue

Content-Type

application/json

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

Request body stucture

FieldDescription

origins

List of regions' indexes where trips started

destinations

List of regions' indexes where trips ended

vias

List of regions' indexes where trips went through

Request body example

{
    "origins": [0,1,2,3],
    "destinations": [4,5,6,7,8],
    "vias": [10]
}

Response

This response will return array where each index is histogram’s bucket with information about number of trips which started in given origin, went through given vias and ended in given destinations. 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

Sample response for HOURS_OF_DAY histogram contains following data. Each value of histogram pairs is a number of trips which started in given origins, went through given vias and ended in given destinations for given hour.

Result interpretation example

{
  "bucketInterval": 1,
  "unit": "HOUR",
  "histogram": {
    "4": 6,
    "5": 15,
    "6": 52,
    "7": 148,
    "8": 568,
    "9": 10766,
    "10": 39039,
    "11": 41573,
    "12": 44617,
    "13": 44866,
    "14": 44537,
    "15": 48869,
    "16": 49014,
    "17": 48767,
    "18": 47713,
    "19": 40060
  }
}

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