Is there a way to get the airport/city name from DestinationID in the Skyscanner API?

401 Views Asked by At

Using the EVERYWHERE quote feature with the Skyscanner API, it is returning quotes with a destinationID but no city or airport name. When I try to search for a flight using the DestinationID as the destination, it throws an error saying "is not a recognised place id". I've also tried using the destinationID as the query in the List Places request, which returns an object with an empty places array. I read the documentation and it looks like the only way to query a destination place is with the code or city, but I am trying to do a reverse search for the city name after I already found flights to "everywhere".

Is there a way to get the placeID or airport name from the Destination ID?

EDIT: While it's not stated in the docs, I figured out that the destination ID and place ID match up, so I stored the destination IDs then looped through the places array to find the matching placeID and city name.

1

There are 1 best solutions below

0
Leslie Alldridge On

Their documentation suggests this is how you can GET places

GET "https://partners.api.skyscanner.net/apiservices/ autosuggest/v1.0/{country}/{currency}/{locale}? query={query}& apiKey={apiKey}"

Based on that, I'd suggest appending ?query=pari to find places in Paris. You'd just replace pari with your destination.

Disclaimer: I've never used this API before, just read their documentation.