Search destinations
GET /api/destinations/search
Search for travel destinations (cities and airports) using SerpAPI Google Flights autocomplete.
Request
Authentication: None required (internal API)
Query parameters:
Search query (minimum 2 characters)
Set to "1" or "true" to return only airport results
Response
Indicates if the request was successful
Array of destination suggestions (up to 20)Show DestinationSuggestion object
Unique identifier (IATA code or city ID)
Formatted display name with context
Either "city" or "airport"
IATA airport code (null for cities without airports)
Country code (currently always null)
Error message if ok is false
Example request
curl "http://localhost:8080/api/destinations/search?q=paris"
Example response
{
"ok": true,
"data": [
{
"id": "ChIJD7fiBh9u5kcRYJSMaMOCCwQ",
"name": "Paris",
"displayName": "Paris - France",
"type": "city",
"iataCode": "CDG",
"cityName": "Paris",
"countryCode": null
},
{
"id": "CDG",
"name": "Charles de Gaulle Airport",
"displayName": "Charles de Gaulle Airport (CDG), Paris",
"type": "airport",
"iataCode": "CDG",
"cityName": "Paris",
"countryCode": null
},
{
"id": "ORY",
"name": "Orly Airport",
"displayName": "Orly Airport (ORY), Paris",
"type": "airport",
"iataCode": "ORY",
"cityName": "Paris",
"countryCode": null
}
]
}
Example request (airports only)
curl "http://localhost:8080/api/destinations/search?q=london&airports_only=1"
Example response (airports only)
{
"ok": true,
"data": [
{
"id": "LHR",
"name": "Heathrow Airport",
"displayName": "Heathrow Airport (LHR), London",
"type": "airport",
"iataCode": "LHR",
"cityName": "London",
"countryCode": null
},
{
"id": "LGW",
"name": "Gatwick Airport",
"displayName": "Gatwick Airport (LGW), London",
"type": "airport",
"iataCode": "LGW",
"cityName": "London",
"countryCode": null
}
]
}
Error responses
Status codes:
400 - SerpAPI request error
503 - SerpAPI key not configured
502 - SerpAPI service error
500 - Internal server error
Special cases:
- Returns empty
data array for queries shorter than 2 characters
- Excludes region-type results (only cities and airports)
- City results include the first airport’s IATA code in
iataCode field