Flight Bookings

FREEMIUM
By airhob
Updated 5 months ago
Travel
4.4/10
Popularity Score
1512ms
Latency
-
Success Rate

Flight Bookings API Documentation

We're providing developer-friendly API's to major low cost and full service carriers with capabilities to search, price and book flights realtime. We directly dive into the inventory of airlines and GDS partners.

View API Details
Flights
POST/sandboxapi/flights/v1.1/search
POSTLook
POSTPrice
POSTIssue
POST/sandboxapi/flights/v1.1/search
Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Accept-EncodingSTRING
OPTIONAL
Content-TypeSTRING
REQUIRED
apikeySTRING
REQUIRED
modeSTRING
REQUIRED
Required Parameters
FLIGHT SEARCHJSON_STRING
REQUIRED
Code Snippet
unirest.post("https://airhob-api.p.rapidapi.com/sandboxapi/flights/v1.1/search")
.header("X-RapidAPI-Host", "airhob-api.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Accept-Encoding", "gzip, deflate")
.header("Content-Type", "application/json")
.header("apikey", "")
.header("mode", "sandbox")
.send({"TripType":"O","NoOfAdults":1,"NoOfChilds":0,"NoOfInfants":0,"ClassType":"Economy","OriginDestination":[{"Origin":"JFK","Destination":"SFO","TravelDate":"07/14/2017"}]})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://airhob-api.p.rapidapi.com/sandboxapi/flights/v1.1/search
Request Method: POST
Response Headers
Response Body

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://airhob-api.p.rapidapi.com/sandboxapi/flights/v1.1/search")
.header("X-RapidAPI-Host", "airhob-api.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Accept-Encoding", "gzip, deflate")
.header("Content-Type", "application/json")
.header("apikey", "")
.header("mode", "sandbox")
.send({"TripType":"O","NoOfAdults":1,"NoOfChilds":0,"NoOfInfants":0,"ClassType":"Economy","OriginDestination":[{"Origin":"JFK","Destination":"SFO","TravelDate":"07/14/2017"}]})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication