Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Jun 14, 2021. It is now read-only.
/skyscannerjsPublic archive

✈️ Promise access to Skyscanner travel APIs.

License

NotificationsYou must be signed in to change notification settings

Garee/skyscannerjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Promise based wrapper for the Skyscanner travel APIs.

npm versionnpm downloadsCI status

Install

$ npm install skyscannerjs

Examples

Create an API object

import{API}from"skyscannerjs";constapiKey="s3r3t4PIk3y";constapi=newAPI(apiKey);

Create a flight live pricing session

api.flights.livePrices.session({country:"UK",currency:"GBP",locale:"en-GB",locationSchema:"Iata",originplace:"EDI",destinationplace:"LHR",outbounddate:"2016-06-13",adults:1}).then((response)=>{// URL to poll the session.constlocation=response.headers.location;});

Documentation

Poll a flight living pricing session

api.flights.livePrices.poll(session).then((response)=>{constitineraries=response.data.Itineraries;constlegs=response.data.legs;    ...});

Documentation

Create a flight booking details session

api.flights.livePrices.bookingDetails.session(session,{outboundlegid:"",inboundlegid:""}).then((response)=>{// URL to poll the session.constlocation=response.headers.location;});

Documentation

Poll a flight booking details session

api.flights.livePrices.bookingDetails.poll(session,itinerary).then((response)=>{constoptions=response.data.BookingOptions;constplaces=response.data.Places;    ...});

Documentation

Browse the quotes service

api.flights.browse.quotes({market:"UK",currency:"GBP",locale:"en-GB",originPlace:"EDI",destinationPlace:"LHR",outboundPartialDate:"2016-06-13",ip:"98.139.180.149"}).then((response)=>{constquotes=response.data.Quotes;    ...});

Documentation

Browse the routes service

api.flights.browse.routes({market:"UK",currency:"GBP",locale:"en-GB",originPlace:"EDI",destinationPlace:"LHR",outboundPartialDate:"2016-06-13",ip:"98.139.180.149"}).then((response)=>{constquotes=response.data.Quotes;constdates=response.data.Routes;    ...});

Documentation

Browse the dates service

api.flights.browse.dates({market:"UK",currency:"GBP",locale:"en-GB",originPlace:"EDI",destinationPlace:"LHR",outboundPartialDate:"2016-06-13",ip:"98.139.180.149"}).then((response)=>{constquotes=response.data.Quotes;constdates=response.data.Dates;    ...});

Documentation

Browse the grid service

api.flights.browse.grid({market:"UK",currency:"GBP",locale:"en-GB",originPlace:"EDI",destinationPlace:"LHR",outboundPartialDate:"2016-06-13",ip:"98.139.180.149"}).then((response)=>{constquotes=response.data.Quotes;constdates=response.data.Dates;    ...});

Documentation

Create a car hire live pricing session

api.carHire.livePrices.session({market:"UK",currency:"GBP",locale:"en-GB",pickupplace:"EDI",dropoffplace:"GLA",pickupdatetime:"2016-06-13T19:00",dropoffdatetime:"2016-06-14T19:00",driverage:40,ip:"98.139.180.149"}).then((response)=>{// URL to poll the session.constlocation=response.headers.location;});

Documentation

Poll a car hire live pricing session

api.carHire.livePrices.poll(session).then((response)=>{constcars=reponse.data.cars;    ...});

Documentation

Create a hotels live pricing session

api.hotels.livePrices.session({market:"UK",currency:"GBP",locale:"en-GB",entityId:"41.37,2.14-latlong",checkindate:"2016-06-13",checkoutdate:"2016-06-14",guests:1,rooms:1}).then((response)=>{// URL to poll the session.constlocation=response.headers.location;});

Documentation

Poll the hotels live pricing session

api.hotels.livePrices.poll(session).then((response)=>{consthotels=response.data.hotels;conststatus=response.data.status;    ...});

Documentation

Create a hotel details session

api.hotels.livePrices.details.session(session,{HotelIds:"1,2,3"}).then((response)=>{// URL to poll the session.constlocation=response.headers.location;});

Documentation

Poll a hotel details session

api.hotels.livePrices.details.poll(session,{HotelIds:"1,2,3"}).then((response)=>{    ...});

Documentation

Use the hotel autosuggest service

api.hotels.autosuggest({market:"UK",currency:"GBP",locale:"en-GB",query:"pari"}).then((reponse)=>{constresults=response.data.results;constplaces=response.data.places;    ...});

Documentation

Get all supported currencies

api.reference.currencies().then((response)=>{constcurrencies=response.data.Currencies;    ...});

Documentation

Get all supported locales

api.reference.locales().then((response)=>{constlocales=response.data.Locales;    ...});

Documentation

Get all supported countries

For examplelocalecan be equal toen-US, the best way is to get supported locales for this query.

api.reference.countries(locale).then((response)=>{constcountries=response.data.Countries;    ...});

Documentation

Use the location autosuggest service

api.locationAutosuggest({market:"UK",currency:"GBP",locale:"en-GB",query:"ed"}).then((response)=>{constplaces=response.data.Places;    ...});

Documentation

About

✈️ Promise access to Skyscanner travel APIs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp