Skyscanner API Python
You can use the Skyscanner Flight Search API with C# (.NET) by utilizing unirest.
Installing & Making a Request
Please download this entire unirest-net library and reference it in your project.
Task<HttpResponse<MyClass>> response = Unirest.post(API_URL) .header("X-RapidAPI-Key", API_KEY) .header("Content-Type", "application/x-www-form-urlencoded") .asJson();
Asynchronous Requests
Task<HttpResponse<MyClass>> myClassTask = Unirest.post(API_URL) .header("X-RapidAPI-Key", API_KEY) .header("Content-Type", "application/x-www-form-urlencoded") .asJsonAsync<MyClass>();
File Uploads
Task<HttpResponse> response = Unirest.post(API_URL) .header("X-RapidAPI-Key", API_KEY) .header("Content-Type", "application/x-www-form-urlencoded") .field("content", File.ReadAllBytes(@"/path/to/file")) .asJson();
How to Start
- Navigate to the Skyscanner Flight Search API Documentation Page.
- Select an endpoint you would like to use and select C# (.NET) from the Code Snippet dropdown.
- Copy the code snippet and apply it to your application!
What data is available with the Skyscanner Flight Search API?
Browse the available API endpoints & example code snippets below for available data & datasets for flights using Skyscanner API (in C# / .NET).
Live Flight Search
POST Create Session
Create a flight search session. A successful response contains no content. The session key to poll the results are provided in the Location header of the response. The last value of the location header contains the session key which is required when polling the session.
Task<HttpResponse<MyClass>> response = 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") .field("inboundDate", "2019-09-10") .field("cabinClass", "business") .field("children", 0) .field("infants", 0) .field("country", "US") .field("currency", "USD") .field("locale", "en-US") .field("originPlace", "SFO-sky") .field("destinationPlace", "LHR-sky") .field("outboundDate", "2019-09-01") .field("adults", 1) .asJson();
GET Poll Session Results
Get itineraries from a created session.
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/pricing/uk2/v1.0/{sessionkey}?pageIndex=0&pageSize=10") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();
Places
GET List Places
Get a list of places that match a query string.
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/autosuggest/v1.0/UK/GBP/en-GB/?query=Stockholm") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();
Browse Flight Prices
GET Browse Quotes
Retrieve the cheapest quotes from our cache prices.
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsequotes/v1.0/US/USD/en-US/SFO-sky/JFK-sky/2019-01-01?inboundpartialdate=2019-09-01") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();
GET Browse Routes
Retrieve the cheapest routes from our cache prices. Similar to the Browse Quotes API but with the routes built for you from the individual quotes.
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browseroutes/v1.0/US/USD/en-US/SFO-sky/ORD-sky/2019-01-01?inboundpartialdate=2019-09-01") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();
GET Browse Dates
Retrieve the cheapest dates for a given route from our cache.
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsedates/v1.0/US/USD/en-US/SFO-sky/LAX-sky/2019-01-01?inboundpartialdate=2019-09-01") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();
GET Browse Dates Inbound
Retrieve the cheapest dates for a given route from our cache. Must include inboundpartialdate
.
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsedates/v1.0/{country}/{currency}/{locale}/{originplace}/{destinationplace}/{outboundpartialdate}/{inboundpartialdate}") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();
GET Browse Quotes Inbound
Retrieve the cheapest quotes from our cache prices. Must include inboundpartialdate.
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsequotes/v1.0/{country}/{currency}/{locale}/{originplace}/{destinationplace}/{outboundpartialdate}/{inboundpartialdate}") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();
GET Browse Routes Inbound
Retrieve the cheapest routes from our cache prices. Similar to the Browse Quotes API but with the routes built for you from the individual quotes. Must include inboundpartialdate
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browseroutes/v1.0/{country}/{currency}/{locale}/{originplace}/{destinationplace}/{outboundpartialdate}/{inboundpartialdate}") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();
Localisation
GET List markets
Retrieve the market countries that we support. Most suppliers (airlines, travel agents and car hire dealers) set their fares based on the market (or country of purchase). It is, therefore, necessary to specify the market country in every query.
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/reference/v1.0/countries/en-US") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();
GET Currencies
Retrieve the currencies that we support.
Task<HttpResponse<MyClass>> response = Unirest.get("https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/reference/v1.0/currencies") .header("X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com") .header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY") .asJson();