RapidAPI logo

Sign Up

Log In

Skyscanner Flight Search

FREE
By skyscannerOfficial
Updated 3 months ago
Travel, Transportation
10/10
Popularity Score
327ms
Latency
45%
Success Rate

Skyscanner Flight Search API Overview

The Sky Scanner API lets you search for flight & get flight prices from Skyscanners database of prices, as well as get live quotes directly from ticketing agencies.

Contact API Provider
star-blueRate

Flights Live Prices

Querying live flight prices is done using sessions. You create a session with the query details (origin location, destination location, cabin class etc…), and get a session ID. You can than use that session ID to poll results, sort results and filter results farther.

  1. Use the endpoint POST Create session to create a query session for flights.
  2. Get back the session ID in the Location header from POST Create session.
  3. Poll the results using the endpoint GET Poll session results.

Booking Redirects:

In addition to price information, your users will need a url that redirects them to where they can book their ticket.

For now, you should utilize the deeplink provided in the response of the API to redirect for booking.

Results payload

When getting the result back from the session polling, they will have the following parameters:

RESPONSE PARAMETERS

SessionKey The Session key to identify the session.
Query A copy of the query which was submitted.
Status The status of the session – ‘UpdatesPending’ or ‘UpdatesComplete’.
Itineraries A list of itineraries - see below for the itinerary object.
Legs Details of the legs that make up the itineraries: airports, times, overall duration, stops and carrier ids.
Segements Details of the segments of each leg. Including the carrier (or marketing carrier) and the operating carrier.
Carriers Details of the carriers.
Agents Details of the agents who sell the tickets. Can be an airline or a travel agent.
Places A list of all the places that appear in the itineraries.
Currencies A list of the currencies shown in the response.

ITINERARY PARAMETERS

OutboundLegId Id of the Outbound Leg
InboundLegId Id of the Inbound Leg
PricingOptions pricing options with agent(s)
the quote age
price (total for all passengers)
deeplink to the agent (the absolute URL needed to make the booking).
In the case where deeplinks are not supplied, you can obtain them with a further step. Refer to the Create/Poll Booking Details documentation.
BookingDetailsLink In some cases such as for group prices you will need to make a second call to retrieve the deeplinks. See the next section Get booking details for details

Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/pricing/v1.0")
.header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("inboundDate=2019-09-10")
.send("cabinClass=business")
.send("children=0")
.send("infants=0")
.send("country=US")
.send("currency=USD")
.send("locale=en-US")
.send("originPlace=SFO-sky")
.send("destinationPlace=LHR-sky")
.send("outboundDate=2019-09-01")
.send("adults=1")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication