Places

A place is a city or airport that can serve as an origin or destination.

airports
listnullable

The airports associated to a city. This will only be provided where the type is city.

city
objectnullable

The metropolitan area where the airport is located. Only present for airports which are registered with IATA as belonging to a metropolitan area.

city_name
stringnullable

The name of the city (or cities separated by a /) where the airport is located

Example: "London"
iata_city_code
stringnullable

The 3-letter IATA code for the city where the place is located. Only present for airports which are registered with IATA as belonging to a metropolitan area.

Example: "LON"
iata_code
string

The 3-letter IATA code for the place

Example: "LHR"
iata_country_code
string

The ISO 3166-1 alpha-2 code for the country where the city is located

Example: "GB"
icao_code
stringnullable

The four-character ICAO code for the airport

Example: "EGLL"
id
string

Duffel's unique identifier for the resource

Example: "arp_lhr_gb"
latitude
numbernullable

The latitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -90° and 90°

Example: 64.068865
longitude
numbernullable

The longitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -180° and 180°

Example: -141.951519
name
string

The name of the place

Example: "Heathrow"
time_zone
stringnullable

The time zone of the airport, specified by name from the tz database

Example: "Europe/London"
type
enum

The type of the place

Possible values: "airport" or "city"

Retrieves a list of Places whose airport/city/country name or IATA code match the provided query or are within a radius of a location

Query parameters

query
string

A search string for finding matching Places by name.

This is deprecated. Please use the name query instead for equivalent behaviour.

Example: "heathr"
name
string

A search string for finding matching Places by name

Example: "heathr"
rad
string

The radius, in metres, to search within

Example: "10"
lat
string

The latitude to search by

Example: "40.735"
lng
string

The longitude to search by

Example: "-73.973717"

Endpoint

GET https://api.duffel.com/places/suggestions

Request

curl -X GET --compressed "https://api.duffel.com/places/suggestions?query=heathr&name=heathr&rad=10&lat=40.735&lng=-73.973717" \
-H "Accept-Encoding: gzip" \
-H "Accept: application/json" \
-H "Duffel-Version: v1" \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"

Response

{
"warnings": [
{
"type": "deprecation",
"title": "`query` field has been deprecated",
"message": "Use the `name` field instead",
"code": "deprecated_parameter"
}
],
"data": [
{
"type": "airport",
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"iata_city_code": "LON",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
},
"airports": [
{
"time_zone": "Europe/London",
"name": "Heathrow",
"longitude": -141.951519,
"latitude": 64.068865,
"id": "arp_lhr_gb",
"icao_code": "EGLL",
"iata_country_code": "GB",
"iata_code": "LHR",
"iata_city_code": "LON",
"city_name": "London",
"city": {
"name": "London",
"id": "cit_lon_gb",
"iata_country_code": "GB",
"iata_code": "LON"
}
}
]
}
]
}