Skyscanner / skyscanner-python-sdk

Skyscanner Python SDK
Other
122 stars 33 forks source link

Country Codes and Places API #29

Open ahmasoh1992 opened 7 years ago

ahmasoh1992 commented 7 years ago

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?

samheyman commented 7 years ago

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.