Flights
Endpoint
POST https://partners.api.skyscanner.net/apiservices/v3/autosuggest/flights
Request
Requests to autosuggest/flights
contain the following:
Field name | Description |
---|---|
query | Object containing parameters for flights autosuggest search. |
isDestination (Optional) | Alters ranking logic of entities. Defaults to false if not sent. |
limit (Optional) | Limits number of entities returned in response. Take a min value of 1 and max of 50. |
The query
object contains the following fields:
Field name | Description |
---|---|
market | Market where search is coming from. E.g. UK . |
locale | Language to be used for the search. E.g. en-GB . |
searchTerm | The string to get autosuggest results for. If left blank, the most popular flights will be returned. |
includedEntityTypes (Optional) | Can be used to filter type of places returned. See below for full list of supported entity types. |
Here is a sample of a query object:
{
"query": {
"market": "UK",
"locale": "en-GB",
"searchTerm": "united",
"includedEntityTypes": [
"PLACE_TYPE_AIRPORT",
"PLACE_TYPE_CITY",
"PLACE_TYPE_COUNTRY"
]
},
"limit": 10,
"isDestination": true
}
Response
Responses from the autosuggest/flights
are returned as a list of places
. Each places
item will contain the following fields:
Field name | Description |
---|---|
entityId | A unique ID for the place. It's an internal ID and it doesn't have any meaning outside of our APIs. |
iataCode | The IATA code of the entity. E.g. LHR |
parentId | Parent entity Id for this entity. |
name | Name of the entity. E.g London Heathrow |
countryId | Country code for where the entity is located. E.g. London will have a countryId of GB . |
countryName | Name of country entity is located in. E.g. United Kingdom |
cityName | Name of the city the entity is located in. E.g. London |
location | Coordinates of the entity. Expressed as a latitude/longitude pair. E.g. 51.471389,-0.452778 |
hierarchy | Shows hierarchy of places related to this entity. E.g. London Heathrow (LHR), London|England|United Kingdom |
highlighting | Two dimensional list displaying keywords in entity to be highlighted. E.g. [[7,15]] |
type | Type of place. See section below for possible values for PLACE_TYPE. |
airportInformation | Object containing information about nearest airport to entity. See section below for more detailed information |
Entity Types
Below are the possible entity types.
They can be used to filter the response by being passed in the includedEntityTypes
field in the request. They are also used in the type
field in the response.
Type |
---|
PLACE_TYPE_COUNTRY |
PLACE_TYPE_AIRPORT |
PLACE_TYPE_CITY |
Airport Information
Results where the entity type is PLACE_TYPE_CITY
will have information about the nearest airport. It is an object with the following information:
Field name | Description |
---|---|
iataCode | The IATA code of the airport. |
entityId | The entityId of the airport. |
parentId | Parent entity Id of the airport. |
countryId | Country code that airport is located in. |
cityId | City code that airport is located in. |
location | Coordinates of the airport. Expressed as a latitude/longitude pair. E.g. 13.735556,-60.952222 |
distance | Object with the distance from the entity. E.g. {"value": 3.8603525,"unitCode": "mile"} |
Autosuggest API reference
See the Autosuggest API reference for more details.