Skip to content

Overall Grouped

Bookings Overall Grouped API returns overall bookings' data for the specified {BookingsTimeframes}, grouped by the field(s) defined by the group_type query parameter.

Request

Endpoint

GET /v4/{billing_plan}/account/{account_id}/flights/bookings/overall/grouped

Path Parameters

Name                       Description Type Examples
*{billing_plan} Billing plan to be applied to the call. string ondemand
*{account_id} Provided identifier of the account. string

Header Parameters

Name                          Description Type Examples                         
*x-api-key Provided API key {x_api_key} that allows authentication. string
*Authorization Provided token {jwt_bearer} that allows authorization. string Bearer {jwt_bearer}

Query Parameters

Name                           Description Type Examples Default
*{BookingsTimeframes} Flights Bookings timeframes filter. BookingsTimeframes
*{IATACodes} IATA code identifiers. IATACodes
*group_type Field(s) for which perform grouping. string trip_type
flight_type
departure_country Filter by country of departure in ISO 3166-1 alpha-2 standard format (in lower case). string it
arrival_country Filter by country of arrival in ISO 3166-1 alpha-2 standard format (in lower case). string fr
cabin_class Filter by booked cabin class of the flight. string economy
business
first
haul Filter by duration range of the booked flight. string short
medium
long
flight_type Filter by flight type. string domestic
international
trip_type Filter by trip type. string oneway
round_trip
stop_days.eq
stop_days.gt
stop_days.gte
stop_days.lt
stop_days.lte
Filter by total number of days elapsed between multi-routes flights departure dates, including both stay time and flight connection waiting time.

Field value can be filtered using multiple comparison modes:
    .eq=     → =
    .gt=      → >
    .gte=    →
    .lt=        → <
    .lte=      →
int
pax.eq
pax.gt
pax.gte
pax.lt
pax.lte
Filter by number of passengers that booked the flight.

Field value can be filtered using multiple comparison modes:
    .eq=     → =
    .gt=      → >
    .gte=    →
    .lt=        → <
    .lte=      →
int
page Requested page number for paginated results. int 1
page_size Requested page size for paginated results in the range [1, 100]. int 25
Supported values for group_type
  • iata_departure_code
  • iata_arrival_code
  • departure_country
  • arrival_country
  • cabin_class
  • haul
  • flight_type
  • trip_type
  • status
  • stop_days
  • pax
Supported values for cabin_class
  • economy
  • premium_economy
  • business
  • premium_business
  • first
  • premium_first
Supported values for haul
  • short
  • medium
  • long
Supported values for flight_type
  • domestic
  • international
Supported values for trip_type
  • oneway
  • round_trip
Example
curl -X GET 'https://api.datappeal.io/v4/{billing_plan}/account/{account_id}/flights/bookings/overall/grouped?from=2021-03-15&to=2022-03-15&iata_departure_code=flr&group_type=trip_type&group_type=flight_type' \
-H 'x-api-key: {x_api_key}' \
-H 'Authorization: Bearer {jwt_bearer}' \

Response

Status

Status Description
200 Overall Grouped data has been successfully returned.

Body

FlightsBookingsGroupedOverall

Field Description Type
*results Paginated list of overall data grouped by group_type requested field(s). array[FlightsBookingsGroupedOverallElement]
paging Response pagination. Paging
FlightsBookingsGroupedOverallElement
Field Description Type
*group Group fields values combination for the requested grouping. array[FlightsGroupElement]
*overall Bookings overall values of the corresponding group. FlightsBookingsOverall
FlightsGroupElement
Field Description Type Examples
*name Name that identifies the element in the group. string trip_type
flight_type
*value Value of the corresponding element. string oneway
active
FlightsBookingsOverall
Field Description Type
passengers Count of passengers by booking status. FlightsBookingsPassengers
days_in_advance Average number of days elapsed between booking/cancellation date and departure date. FlightsBookingsDaysInAdvance
partition Incidence percentage of the group's confirmed passengers over total confirmed passengers. decimal
FlightsBookingsPassengers
Field Description Type
confirmed Count of confirmed (not canceled) passengers. int
canceled Count of canceled passengers. int
total Count of total passengers. int
FlightsBookingsDaysInAdvance
Field Description Type
booking Average number of days elapsed between booking date and departure date. decimal
cancellation Average number of days elapsed between cancellation date and departure date. decimal
Paging
Field Description Type
last A relative URI to the last page. string
first A relative URI to the first page. string
prev A relative URI to the previous page. string
next A relative URI to the next page. string
current A relative URI to the current page. string
pages A set of relative URIs calculated around the current page. Page
elements All indexes shown on the current page. array[int]
total The number of all elements that API can retrieve. int
size The selected page size. int
Page
Field Description Type
number Number of the page. int
uri URI of the page. string
Example
{
    "results": [
        {
            "group": [
                {
                    "name": "trip_type",
                    "value": "round_trip"
                },
                {
                    "name": "flight_type",
                    "value": "international"
                }
            ],
            "overall": {
                "passengers": {
                    "confirmed": 6446,
                    "canceled": 2305,
                    "total": 8751
                },
                "days_in_advance": {
                    "booking": 49.2,
                    "cancellation": 63.5
                },
                "partition": 51.5
            }
        },
        {
            "group": [
                {
                    "name": "trip_type",
                    "value": "oneway"
                },
                {
                    "name": "flight_type",
                    "value": "international"
                }
            ],
            "overall": {
                "passengers": {
                    "confirmed": 5756,
                    "canceled": 1143,
                    "total": 6899
                },
                "days_in_advance": {
                    "booking": 52.7,
                    "cancellation": 51.7
                },
                "partition": 46.0
            }
        },
        {
            "group": [
                {
                    "name": "trip_type",
                    "value": "oneway"
                },
                {
                    "name": "flight_type",
                    "value": "domestic"
                }
            ],
            "overall": {
                "passengers": {
                    "confirmed": 233,
                    "canceled": 57,
                    "total": 290
                },
                "days_in_advance": {
                    "booking": 108.2,
                    "cancellation": 81.7
                },
                "partition": 1.9
            }
        },
        {
            "group": [
                {
                    "name": "trip_type",
                    "value": "round_trip"
                },
                {
                    "name": "flight_type",
                    "value": "domestic"
                }
            ],
            "overall": {
                "passengers": {
                    "confirmed": 71,
                    "canceled": 21,
                    "total": 92
                },
                "days_in_advance": {
                    "booking": 75.5,
                    "cancellation": 82.0
                },
                "partition": 0.6
            }
        }
    ],
    "paging": {
        "last": "/bookings/overall/grouped?page=1&page_size=25&iata_departure_code=flr&from=2022-02-15&group_type=trip_type&group_type=flight_type&to=2022-03-15",
        "first": "/bookings/overall/grouped?page=1&page_size=25&iata_departure_code=flr&from=2022-02-15&group_type=trip_type&group_type=flight_type&to=2022-03-15",
        "prev": null,
        "next": null,
        "current": "/bookings/overall/grouped?page=1&page_size=25&iata_departure_code=flr&from=2022-02-15&group_type=trip_type&group_type=flight_type&to=2022-03-15",
        "pages": [
            {
                "number": 1,
                "uri": "/bookings/overall/grouped?page=1&page_size=25&iata_departure_code=flr&from=2022-02-15&group_type=trip_type&group_type=flight_type&to=2022-03-15"
            }
        ],
        "elements": [
            1,
            2,
            3,
            4
        ],
        "total": 4,
        "size": 25
    }
}