In this API you will get prices from multiple airlines and vendors for a multi-city trip. You can pass any airport IATA code, future date, currency, and pax.
API endpoint for this API is: https://api.flightapi.io/multicity
Guide
Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.
You can generate an API key from your Dashboard at any time.
Here is the list of default parameters you have to use with this API:
Parameters
Description
Type
api_key
required
This is your personal API key. You can find this on your Dashboard.
String
numberofFlights
required
Number of Flights one wants to take. Minimum value is 2 and maximum value is 3.
String
dep1
required
This is the IATA code of first departure airport.
String
arr1
required
This is the IATA code of first arrival airport.
String
date1
required
Date of departure from the first airport.
Format - YYYY-MM-DD
String
dep2
required
This is the IATA code of the second departure airport.
String
arr2
required
This is the IATA code of the second arrival airport.
String
date2
required
Date of departure from the second airport.
Format - YYYY-MM-DD
String
dep3
required
String
arr3
required
String
date3
required
String
number_of_adults
required
This is the number of adults.
String
number_of_childrens
required
This is the number of childrens.
String
number_of_infants
required
This is the number of infants.
String
cabin_class
required
This is the class of the seat in the plane.
Possible Values- "Economy", "Business", "First" or "Premium_Economy"
String
currency
required
You can use any currency code like USD, INR, EUR, etc
String
Usage
You have to send a GET request to https://api.flightapi.io/multicity along with all the parameters.
Take a look at how you might call this API using various different coding languages.
// require the Unirest or any other module to make an HTTP GET requestconstunirest=require('unirest')unirest.get('https://api.flightapi.io/multicity/610ae5eb1c7b751ef42b2e75ae1/2/1/0/0/Economy/USD?dep1=SFO&arr1=ARN&date1=2024-12-11&dep2=ARN&arr2=LHR&date2=2024-12-15').then(response => {console.log(response.body); }).catch(error => {console.log(error); });
// Set your API key before making the requestimport requestsresp = requests.get('https://api.flightapi.io/multicity/610ae5eb1c7b751ef42b2e75ae1/2/1/0/0/Economy/USD?dep1=SFO&arr1=ARN&date1=2024-12-11&dep2=ARN&arr2=LHR&date2=2024-12-15')print (resp.json())
Response
The sample response of the API will look somewhat like this.
It is just a sample API response. Some objects will have more attributes. New arrays will also be there.
Understanding the Response
In the JSON response, you may observe that many objects include references (IDs or codes) to objects from other lists. This pattern is employed in our API to prevent redundant data and reduce the overall size by allowing multiple objects to reference the same data.