Skyscanner Python SDK
Project description
You will need to contact us to request an API key to use our APIs via the following form: https://partners.skyscanner.net/contact.
We receive a large number of requests and although we do our best to reply to all we cannot guarantee that your application will be successful.
Skyscanner Python SDK for Skyscanner’s API
Free software: Apache license
SDK Documentation: https://skyscanner.readthedocs.org.
API Documentation: https://business.skyscanner.net/portal/en-GB/Documentation/ApiOverview
Features
Tested on Python 2.6, 2.7, 3.3, 3.4
Supports Flights, Hotels, and Carhire
Installation
At the command line:
$ easy_install skyscanner
Or, if you have virtualenvwrapper installed:
$ mkvirtualenv skyscanner $ pip install skyscanner
Quick start
Contact us to request an API key: https://partners.skyscanner.net/contact
If you don’t already have one, create a Skyscanner account.
Sign into your account and click ‘Import Existing App’ and use your API key to create an App
Set your API Key in your code:
from skyscanner.skyscanner import Flights flights_service = Flights('<Your API Key>')
Get the flights live pricing result by writing a few lines of code:
from skyscanner.skyscanner import Flights flights_service = Flights('<Your API Key>') result = flights_service.get_result( country='UK', currency='GBP', locale='en-GB', originplace='SIN-sky', destinationplace='KUL-sky', outbounddate='2017-05-28', inbounddate='2017-05-31', adults=1).parsed print(result)
Note that both the inbounddate and outbounddate might need to be updated.
More examples
For more example usage, refer to the SDK documentation or the API documentation.
Known Issues
Tests might appear to be broken sometimes, this is due to the throttling in the API. In such cases, you will see the following error in the build log:
requests.exceptions.HTTPError: 429 Client Error: Too many requests in the last minute.
Please allow up to 15 minutes for your API key to be activated. Until it is activated you will get a 403 exception:
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://partners.api.skyscanner.net/apiservices/pricing/v1.0?apiKey=<Your API key>
History
1.0.0 (2015-03-24)
First release on PyPI.
1.1.0 (2015-07-18)
Stable release on PyPI.
1.1.1 (2015-08-01)
Fixes for Python 2.6, 3.3, and 3.4.
1.1.2 (2015-08-01)
Support additional params for Flights Pricing Service. Fix for issue #15.
1.1.3 (2015-08-01)
Set default error handling to graceful. Fix for issue #19.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file skyscanner-1.1.5.tar.gz
.
File metadata
- Download URL: skyscanner-1.1.5.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e441fe442fb391e0b73dce4279e1d37dc3bad9a67a2b34a59219ae6b8626d370 |
|
MD5 | 46c9b244add2c6279618af1d5247e35a |
|
BLAKE2b-256 | 0f7406b542acb9e7085a1f0769895136b61a03bf7431d9ce06b02593870c84ba |