NAV Navbar

Introduction

Why did we build Travel Insight (TI) API?

Travel Insight (TI) Aggregation API is driven by our partners' need to connect to a significantly easier alternative to the traditional, ad-hoc approaches of data collection and data analysis.

What is it?

Travel Insight (TI) Aggregated API is a public API that enables subscribed partners to get an aggregated result of search and redirect data based on a set of queries.

Why Use it?

Instant Results

There’s no additional data processing required, unlike with raw data files.

Easy Accessibility

It’s easy to use and simple to plug into your Power BI tools.

How does it work?

For a given Origin and Destination itinerary, Travel Insight API parses previously searched itineraries across an array of specified dates. The service is highly customisable and offers unsurpassed search criteria, including filtering such as multiple lengths of stay, number of stops, day of week, departure/arrival time window, etc.

Aggregation API provides two endpoints to submit analytics queries:

You’ll find an in-depth explanation of both endpoints later in this document.

Some questions API will help answer

Scope of API

Supported Dimensions (used in both filters and groupBy query parameter)

On searches data:

On exits(redirects) data:

Supported Aggregations

On searches data

On redirects data

Sorting

Results are sorted by the count value (descending)

Supported Query Criteria

Authentication

API Key Based Authentication

Security scheme type: API Key
Header parameter name: API-Key

Aggregation API

API to serve analytical queries over searches and exits

Aggregated Exits

POST /exits

Request samples

{
  "startDate": "string",
  "endDate": "string",
  "filter": "string",
  "groupBy": ["string"],
  "aggregations": ["count", "averageFarePerPax"]
}

Response samples

{
  "results": [
    {
      "dimensions": [
        {
          "name": "market",
          "value": "SG"
        }
      ],
      "aggregations": [
        {
          "name": "count",
          "value": "123"
        },
        {
          "name": "averageFarePerPax",
          "value": "765.43"
        },
      ]
    }
  ],
  "subscription": {
    "included": [
      {
        "market": "ES",
        "origin": "BCN",
        "destination": "*"
      }
    ]
  }
}

/exits endpoint supports 2 types of queries

In both type of queries only startDate and endDate are mandatory query parameters.

filter and groupBy query parameters, on the other hand, are optional.

Supported filter format can be expressed with the following grammar:

EBNF grammar for filter structure:

<filter> ::= "{" <fieldTokens> ("," <fieldTokens>)* "}";

<fieldTokens> ::= <fieldName> "=" <fieldValue> | <fieldRangeToken>;

<fieldRangeToken> ::= <fieldName> ("<" | "<=" | ">" | ">=") <value>;

<fieldValue> ::= valueToken;

<valueToken> ::= <value> | "(" <value> (<operator> valueToken)* ")"

<operator> ::= "|";

<fieldName> ::= "originCountry" | "destinationCountry" | "originIATA" | "destinationIATA" | "market"
| "cabinClass" | "departureDate" | "returnDate" | "pax" | "journeyDuration" |"route" | "kind" | "departureTimeOfDay"
| "returnTimeOfDay" | "marketingCarriers" | "stops" ;

<value> ::= string | integer | date | datetime;


Semantics:
<operator> "|" represents logical OR (||)
EBNF syntax:
* for "zero or more" occurrences

Range operators allowed only for pax, stops, departureDate, returnDate, journeyDuration

Example: filter={market=(UK|FR),originIATA=LHR,destinationIATA=(CDG|ORY),pax>1,pax<=5}

Please note that there should not be any spaces between filter tokens

Responses

Code Description
200 Aggregated results returned
400 Request validation failure - Invalid input syntax
401 Unsuccessful authentication
422 Request validation failure - Malformed semantics in input
429 Too many requests
500 Failure to process the request

Aggregated Searches

POST /searches

Request samples

{
  "startDate": "string",
  "endDate": "string",
  "filter": "string",
  "groupBy": ["string"],
  "aggregations": ["count"]
}

Response samples

{
  "results": [
    {
      "dimensions": [
        {
          "name": "market",
          "value": "SG"
        }
      ],
      "aggregations": "count",
      "subscription": {
        "included": [
          {
            "market": "ES",
            "origin": "BCN",
            "destination": "*"
          }
        ]
      }
    }
  ]
}

/searches endpoint supports 2 types of queries

In both type of queries only startDate and endDate are mandatory query parameters.

filter and groupBy query parameters, on the other hand, are optional.

Supported filter format can be expressed with the following grammar:

EBNF grammar for filter structure:

<filter> ::= "{" <fieldTokens> ("," <fieldTokens>)* "}";

<fieldTokens> ::= <fieldName> "=" <fieldValue> | <fieldRangeToken>;

<fieldRangeToken> ::= <fieldName> ("<" | "<=" | ">" | ">=") <value>;

<fieldValue> ::= valueToken;

<valueToken> ::= <value> | "(" <value> (<operator> valueToken)* ")"

<operator> ::= "|";

<fieldName> ::= "originCountry" | "destinationCountry" | "originIATA" | "destinationIATA"
| "market" | "cabinClass" | "departureDate" | "returnDate" | "pax" | "route" | "kind" ;

<value> ::= string | integer | date | datetime;


Semantics:
<operator> "|" represents logical OR (||)
EBNF syntax:
* for "zero or more" occurrences

Range operators allowed only for pax, departureDate, returnDate

Example: filter={market=(UK|FR),originIATA=LHR,destinationIATA=(CDG|ORY),pax>1,pax<=5}

Please note that there should not be any spaces between filter tokens

Responses

Code Description
200 Aggregated results returned
400 Request validation failure - Invalid input syntax
401 Unsuccessful authentication
422 Request validation failure - Malformed semantics in input
429 Too many requests
500 Failure to process the request