Analysis Partial Histogram Result

Service version: 1
Last edit: 2022.08.22

Required parameters

Required parameters

Description

baseURL
string

The base URL for calling TomTom services.


Value: api.tomtom.com

versionNumber
string

Version of the service to call.


Value: The current value is 1.

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

type
string

Type of the histogram.


Values: 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

  • AVG_SPEEDS - average speeds in kilometers per hour

Request POST body example

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

Request POST body stucture

Field

Description

origins
array

List of regions' indexes where trips started.

destinations
array

List of regions' indexes where trips ended.

vias
array

List of regions' indexes where trips went through.

Required POST headers

Header

Value

Content-Type

application/json

Response data

This response will return an array where each index is histogram's bucket with information about the number of trips which started in a given origin, went through given vias, and ended in given destinations. The array size depends on the histogram type you choose.

Response example

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

Response structure

A sample response for an HOURS_OF_DAY histogram contains the following data. Each value of histogram pairs is:

  • A number of trips which started in given origins.
  • Went through given vias.
  • Ended in given destinations for the given hour.

Response types

Type

Size of array

HOURS_OF_DAY

24

DURATIONS

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

LENGTHS

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

AVG_SPEEDS

No limitation (contains all average speed buckets for a minimal interval of 1 kilometer per hour).

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

201

Created

400

Bad request

401

Unauthorized

403

Forbidden

404

Not Found