• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Rapid Blog

  • Enterprise
  • API Hub
  • Add Your API
  • About
  • Docs
    • API Glossary
  • Blog
    • What is an API?
    • REST API Tutorials
    • Most Popular APIs
    • Write for Us
  • Sign Up
    • Log In
Blog » Skyscanner Travel API Overview » Skyscanner Flight Search API (Objective-C)

Skyscanner Flight Search API (Objective-C)

Skyscanner API Objective-C

You can use the Skyscanner Flight Search API with Objective-C by utilizing unirest.

Requirements

The Unirest-Obj-C client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project. To enable ARC select your project or target and then go to Build Settings and under the section Apple LLVM compiler 3.0 – Language you will see the option Objective-C Automatic Reference Counting:

Enable ARC in Xcode

For existing projects, fortunately, Xcode offers a tool to convert existing code to ARC, which is available at Edit -> Refactor -> Convert to Objective-C ARC

Installing & Making a Request

Download the Objective-C Unirest Library from GitHub (or clone the repo) and import the folder into your project. You can also install Unirest-obj-c with CocoaPods.

Using CocoaPods

If you decide to use CocoaPods, create a Podfile file in your project’s folder:

$ edit Podfile
platform :ios, '5.0'
pod 'Unirest', '~> 1.1.4'

and then execute pod install. Make sure to always open the Xcode workspace instead of the project file when building your project:

$ open App.xcworkspace

Now you can import your dependencies:

#import <UNIRest.h>

NSDictionary *headers = @{@"Authorization": @"", @"X-RapidAPI-Key": @API_KEY, @"Content-Type": @"application/x-www-form-urlencoded"};
UNIUrlConnection *asyncConnection = [[UNIRest post:^(UNISimpleRequest *request) {
  [request setUrl:@API_URL];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

Read more here.

Connect to API

How to Start

  1. Navigate to the Skyscanner Flight Search API Documentation Page.
  2. Select an endpoint you would like to use and select Objective-C from the Code Snippet dropdown.
  3. 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 Objective-C).

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.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY", @"Content-Type": @"application/x-www-form-urlencoded"};
NSDictionary *parameters = @{@"inboundDate": @"2019-09-10", @"cabinClass": @"business", @"children": @(0), @"infants": @(0), @"country": @"US", @"currency": @"USD", @"locale": @"en-US", @"originPlace": @"SFO-sky", @"destinationPlace": @"LHR-sky", @"outboundDate": @"2019-09-01", @"adults": @(1)};
UNIUrlConnection *asyncConnection = [[UNIRest post:^(UNISimpleRequest *request) {
  [request setUrl:@"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/pricing/v1.0"];
  [request setHeaders:headers];
  [request setParameters:parameters];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

GET Poll Session Results

Get itineraries from a created session.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/pricing/uk2/v1.0/{sessionkey}?pageIndex=0&pageSize=10"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

Places

GET List Places

Get a list of places that match a query string.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/autosuggest/v1.0/UK/GBP/en-GB/?query=Stockholm"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

Browse Flight Prices

GET Browse Quotes

Retrieve the cheapest quotes from our cache prices.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"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"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

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.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"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"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

GET Browse Dates

Retrieve the cheapest dates for a given route from our cache.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"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"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

 

GET Browse Dates Inbound

Retrieve the cheapest dates for a given route from our cache. Must include inboundpartialdate.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsedates/v1.0/{country}/{currency}/{locale}/{originplace}/{destinationplace}/{outboundpartialdate}/{inboundpartialdate}"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

GET Browse Quotes Inbound

Retrieve the cheapest quotes from our cache prices. Must include inboundpartialdate.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsequotes/v1.0/{country}/{currency}/{locale}/{originplace}/{destinationplace}/{outboundpartialdate}/{inboundpartialdate}"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

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

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browseroutes/v1.0/{country}/{currency}/{locale}/{originplace}/{destinationplace}/{outboundpartialdate}/{inboundpartialdate}"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

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.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/reference/v1.0/countries/en-US"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

GET Currencies

Retrieve the currencies that we support.

NSDictionary *headers = @{@"X-RapidAPI-Host": @"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", @"X-RapidAPI-Key": @"SIGN-UP-FOR-KEY"};
UNIUrlConnection *asyncConnection = [[UNIRest get:^(UNISimpleRequest *request) {
  [request setUrl:@"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/reference/v1.0/currencies"];
  [request setHeaders:headers];
}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) {
  NSInteger code = response.code;
  NSDictionary *responseHeaders = response.headers;
  UNIJsonNode *body = response.body;
  NSData *rawBody = response.rawBody;
}];

 

Connect to API

Connect to API

Learn More

  • Skyscanner API Overview
    • NodeJS
    • PHP
    • Python
    • Ruby
    • Objective-C
    • Java (Android)
    • C# (.NET)
    • cURL
  • Skyscanner vs Kayak
  • Skyscanner vs Google Flights
  • Skyscanner vs Hipmunk
« Skyscanner Flight Search API (Python)
Skyscanner Flight Search API [C# (.NET)] »

Related Blog Posts

Using Skyscanner Flight Search API with Dark Sky API and City Geo-Location Lookup [Tutorial]
Using Skyscanner Flight Search API with Dark Sky API and City Geo-Location Lookup [Tutorial]

The Top 50 Most Popular APIs on RapidAPI (Updated for 2023)
The Top 50 Most Popular APIs on RapidAPI (Updated for 2023)

The Top 50 Most Popular APIs on RapidAPI (Updated for 2023)
The Top 50 Most Popular APIs on RapidAPI (Updated for 2023)

Top 8 Best Insomnia API Client Alternatives (2021)
Top 8 Best Insomnia API Client Alternatives (2021)

How to Use the Flight Data API with Python, PHP, Ruby & Javascript Examples
How to Use the Flight Data API with Python, PHP, Ruby & Javascript Examples

How to Use the Hotels.com API with Python, PHP, Ruby & JavaScript Examples
How to Use the Hotels.com API with Python, PHP, Ruby & JavaScript Examples


Primary Sidebar

Build anything with APIs, faster.

Discover, evaluate, and integrate with any API. RapidAPI is the world’s largest API Hub with over 4 Million developers and 35,000 APIs.

Browse APIs »

Footer

  • API Guides
  • API Courses
  • API Glossary
  • API Testing
  • API Management
  • How to use an API
  • For API Providers
  • Most Popular APIs
  • For Developers
  • Free APIs List
  • Learn REST API
  • Build API’s
  • About
  • Team
  • Careers
  • Contact Us
  • Write for Us
  • API Directory
  • Press Room
  • Privacy Policy
  • Terms of Use

© 2023 RapidAPI. All rights reserved.