Giter VIP home page Giter VIP logo

skyscanner-python-sdk's Introduction

Skyscanner Python SDK

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.

image

image

Documentation Status

image

Skyscanner Python SDK for Skyscanner's API

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

  1. Contact us to request an API key: https://partners.skyscanner.net/contact
  2. If you don't already have one, create a Skyscanner account.
  3. Sign into your account and click 'Import Existing App' and use your API key to create an App
  4. Set your API Key in your code:

    from skyscanner.skyscanner import Flights
    flights_service = Flights('<Your API Key>')
  5. 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: http://partners.api.skyscanner.net/apiservices/pricing/v1.0?apiKey=<Your API key>

skyscanner-python-sdk's People

Contributors

ardydedase avatar ddudnik avatar kelvintaywl avatar samheyman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.