skyscanner-python-sdk icon indicating copy to clipboard operation
skyscanner-python-sdk copied to clipboard

Country Codes and Places API

Open ahmasoh1992 opened this issue 8 years ago • 1 comments

Hi Guys,

I'm having a few issues using the Country Codes (e.g. IE or UK) from the Places API in fetching a Grid of Prices. I get the following issue:

HTTPError: 400 Client Error: Bad Request for url: http://partners.api.skyscanner.net/apiservices/browsegrid/v1.0/UK/GBP/en-GB/MAN/IE/2017-05/2017-05?apiKey=[API]: For this query please use the following service [BrowseRoutes]

Is there a way to:

(a) Get a response in the same way you do when you input cities? I don't see why the output should be any different if the city code is UK or LOND

(b) Can we filter the places api to filter out country codes?

ahmasoh1992 avatar May 06 '17 19:05 ahmasoh1992

Hi,

The browse routes endpoint is used to get a list of routes from a country or city to another. Once you have the route (airport to airport) you can look for dates with the browsedates or browsegrid endpoints, which is why you cannot use country of city level search for the browsedates and browsegrid.

No filtering is supported for the places API I'm afraid so you have to either search for a given country (e.g. ?query=france) or get a list of country IATA codes from somewhere like http://www.fedex.com/gb/tracking/codes.html

Hope this helps.

samheyman avatar May 12 '17 16:05 samheyman