Skip to content

narph/SkyScanner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkyScanner

A C# wrapper around the SkyScanner API.

The implemented APIs:

  • Flights: Live Pricing
  • Currency
  • Locale
  • Market
  • Location Autosuggest

Installation

From the NuGet package manager console: Install-Package SkyScanner

How to use

var scanner = new Scanner(ConfigurationManager.AppSettings["apiKey"]);
var fromPlace = (await scanner.QueryLocation("London")).First();
var toPlace = (await scanner.QueryLocation("New York")).First();

//Query flights
var itineraries = await scanner.QueryFlight(
  new FlightQuerySettings(
    new FlightRequestSettings(
      fromPlace, toPlace, 
      new LocalDate(2015, 06, 19), new LocalDate(2015, 06, 25)),
    new FlightResponseSettings(SortType.Price, SortOrder.Ascending)));

var itinerary = itineraries.First();
var estimatedPrice = itinerary.PricingOptions.Min(option => option.Price);

//Query booking
var booking = await scanner.QueryBooking(itinerary);
var actualPrice = booking.BookingOptions
  .Select(option => option.BookingItems.Sum(item => item.Price))
  .Min();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.9%
  • Batchfile 0.1%