Skip to main content

Query object

The query object is used when querying the endpoint for data on your search criteria.

Layout

query object
├── currency
├── market
├── locale
├── queryLegs
│ ├── originPlace
│ │ │ queryPlace
│ │ ├── ├── iata
│ │ └── └── entityId
│ ├── destinationPlace
│ │ │ queryPlace
│ │ ├── ├── iata
│ │ └── └── entityId
│ └── date
└─── dateTimeGroupingType

Description

ParameterDescriptionExample
marketThe market/country your user is inUK
localeThe locale you want the results in (ISO locale)en-GB
currencyThe currency you want the prices inGBP
queryLegsThe legs queried for inbound and outbound place and date. Its an array that can have 1 or two entries. Having two entries means the query will search for return flightsQuery Leg
dateTimeGroupingTypeThe way the quotes are grouped by in terms of dates.DATE_TIME_GROUPING_TYPE_BY_DATE

Query leg

ParameterDescriptionExample
originPlaceThe origin place. It needs to contain either an IATA or an entity ID.Place
destinationPlaceThe destination place. It needs to contain either an IATA or an entity ID.Place
dateRange, fixedDate, anytimeThe date of flight. It can be a range of dates, a fixed date or anytimeDate

Place

The place value can be either queryPlace or anywhere.

Here is an example of all the possible values:

queryPlaceanywhere
{
"queryPlace": {
"iata": "EDI"
}
}
{
"anywhere": true
}

QueryPlace

ParameterDescriptionExample
iataThe IATA code of and origin or destination city or airportLHR
entityIdThe internal Skyscanner ID for an origin or destination location95565050
info

The supported place types for the requests are cities and airports. Not all supported place types have IATA codes, so you can use entity IDs for them.

What are entity IDs?

Entity IDs are internal Skyscanner unique identifiers for places. We use them because not all places we support for our searches have industry-standard identifiers like IATA or ICAO.

You can use the Autosuggest API v1 to get entity IDs for places.

You can look up places with the Autosuggest API by:

  1. SKY codes (old internal Skyscanner IDs)
  2. IP addresses
  3. The coordinates of the place (we will return the nearest place)
  4. The name of the place (partial names are also supported)

For full details on the Autosuggest API v1 check out the full documentation.

Date

The date can be either dateRange, fixedDate, or anytime.

All the dates must be in the future. Requests with dates in the past will fail.

Here are examples of all the possible values:

dateRangefixedDateanytime
{
"dateRange": {
"startDate": {
"year": 2022,
"month": 8
},
"endDate": {
"year": 2022,
"month": 8
}
}
}
{
"fixedDate": {
"year": 2022,
"month": 8,
"day": 11
}
}
{
"anytime": "true"
}

The date ranges are considered from the first day of the startDate month to the last day of the endDate month.