Read an analytics metric for the company account

Return one analytics metric for the company account in the access token, for an inclusive period of at most 24 months. groupBy splits it by vertical, by calendar month, by both, by destination_country, by days before travel (lead_time), alone or with vertical, or by booking status, alone or with month or vertical. The destination_country split returns the 10 countries with the highest total, highest first, ties by country code, a country with no known amount last; bookings with no known destination, such as other travel services, are left out. destinationCount is how many countries that split has in the period, after the same filters. vertical restricts any split to the verticals named. Each row carries bookings, the number of bookings behind its figures. total_spend is the transacted value of the processed bookings and the bookings cancelled with fees, in EUR: each booking is converted at its own exchange rate and rounded to the cent before summing, and a cancelled booking counts its remaining fees. completed_bookings counts every processed or cancelled booking, free cancellations included, whatever its amount; its bookings split by status give the cancellation rate, the cancelled bookings divided by all of them. A cancelled row is therefore the bookings that kept a fee in total_spend, and every cancellation in completed_bookings. Days before travel are the whole days from the UTC date a booking was created to the local date its service starts. booking_window is their average for each group, in averageDays. The lead_time split groups bookings into days_0, days_1_3, days_4_6, days_7_10, days_11_14, days_15_29 and days_30_plus, in that order, leaving out a bucket with no bookings; a row's total divided by its bookings is about its spend per booking, as bookings with no known amount count in bookings only. A booking with no service start date, or whose service starts on a date before the one it was created on, is left out of both. periodBasis picks the date that places a booking in the period: booking_date, the default, is the UTC date it was created, and travel_date is the local date its service starts (the first departure, the check-in or the pick-up). With travel_date, every metric and split counts the bookings whose service starts in the period, a booking with no known service start is in no period, and a period in the future shows what is already booked for it. asOf is when the analytics data was last refreshed. asOf: null with no rows means the analytics data is not available yet; no rows with an asOf means no bookings counted in the period. Only account administrators may read it.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
enum
required

The metric to read.

Allowed:
Query Params
date
required

First day of the period, inclusive (YYYY-MM-DD).

date
required

Last day of the period, inclusive (YYYY-MM-DD). The period spans at most 24 months.

groupBy
array of objects
required
length between 1 and 2

How to split the figures: vertical, calendar month, both (repeat it, e.g. ?groupBy=month&groupBy=vertical), destination_country alone, days before travel (lead_time), alone or with vertical, or booking status, alone or with month or vertical. booking_window splits by vertical, month or both; completed_bookings by vertical, month, status or two of them.

Groupby*
Allowed:
array | null

Count only these verticals (repeat to combine, e.g. ?vertical=flight&vertical=train). Omit it to count every vertical.

string
enum
Defaults to booking_date

Which date places a booking in the period: booking_date, the default, or travel_date, the local date its service starts.

Allowed:
Responses

401

Unauthenticated, or no company account identity.

403

The caller is not an administrator of the account.

422

Unknown metric, groupBy, vertical or periodBasis, a split the metric does not support (a repeated groupBy, destination_country with another split, lead_time with month or status, a destination_country or lead_time split of booking_window or completed_bookings, or a status split of booking_window), an invalid or reversed period, a period longer than 24 months, or an unexpected parameter.

500

The analytics data could not be read.

503

The service is temporarily unavailable.

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json