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
| Parameter | Description | Example |
|---|---|---|
| market | The market/country your user is in | UK |
| locale | The locale you want the results in (ISO locale) | en-GB |
| currency | The currency you want the prices in | GBP |
| queryLegs | The 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 flights | Query Leg |
| dateTimeGroupingType | The way the quotes are grouped by in terms of dates. | DATE_TIME_GROUPING_TYPE_BY_DATE |
Query leg
| Parameter | Description | Example |
|---|---|---|
| originPlace | The origin place. It needs to contain either an IATA or an entity ID. | Place |
| destinationPlace | The destination place. It needs to contain either an IATA or an entity ID. | Place |
| dateRange, fixedDate, anytime | The date of flight. It can be a range of dates, a fixed date or anytime | Date |
Place
The place value can be either queryPlace or anywhere.
Here is an example of all the possible values:
| queryPlace | anywhere |
|---|---|
| |
QueryPlace
| Parameter | Description | Example |
|---|---|---|
| iata | The IATA code of and origin or destination city or airport | LHR |
| entityId | The internal Skyscanner ID for an origin or destination location | 95565050 |
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:
- SKY codes (old internal Skyscanner IDs)
- IP addresses
- The coordinates of the place (we will return the nearest place)
- 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:
| dateRange | fixedDate | anytime |
|---|---|---|
| | |
The date ranges are considered from the first day of the startDate month to the last day of the endDate month.