Overview
Introduction
The Geo API returns a list of localised geographical locations in the requested format.
Endpoints
/flights
GET https://partners.api.skyscanner.net/apiservices/v3/geo/hierarchy/flights/{locale}
The /flights
endpoint takes a locale
and returns a list of geographical locations in a language determined by the given locale
.
/flights/nearest
POST https://partners.api.skyscanner.net/apiservices/v3/geo/hierarchy/flights/nearest
Returns a list of geographical locations in a language determined by the given locale
starting from the nearest airport. Results are based on a locator which is either an ipAddress
or set of coordinates
.
Concepts
Hierarchy
Geographical locations have the concept of hierarchy. Each location has a parent of a larger hierarchy. I.e.: a place type
of airport
can have a parent of city
and city
can have a parent of country
See the Geo API reference for a full list of possible location types.
Request
/flights
To specify which locale (language) the response is returned in, a locale
can be passed into the endpoint following the format above.
Path variable | Description |
---|---|
locale | The locale to return results in, e.g.: en-GB |
/flights/nearest
The /flights/nearest
takes a json request with the fields below to return a map of the geographical hierarchy starting from the nearest airport from the locator
specified. The results will be returned in the locale
specified.
Field name | Description |
---|---|
locale | The locale to return results in, e.g.: en-GB |
locator | Object that takes either coordinates or and an ipAddress to return the nearest airport and geographical hierarchy from that locator |
Response
The response contains a places
field that has a list of geographical locations indexed by entityId
.
Each place
contains the following fields:
Field name | Description |
---|---|
entityId | A unique identifier for a location |
name | The localised name of the location |
parentId | Refers to the entityId of the location's parent |
type | The type of location. See the Geo API reference for a full list of possible location types. |
iata | The IATA code of the location |
coordinates | Coordinates of the location |