✈️Oneway Trip API
In this API you will get prices from multiple airlines and vendors for a oneway route. You can pass any airport IATA code, future date, currency, and pax.
API endpoint for this API is: https://api.flightapi.io/onewaytrip
Each request to this API will cost 2 credits.
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. |
|
departure_airport_code required | This is the IATA code of departure airport. |
|
arrival_airport_code required | This is the IATA code of arrival airport. |
|
departure_date required | Date of deparure Format - YYYY-MM-DD |
|
number_of_adults required | This is the number of adults. |
|
number_of_childrens required | This is the number of childrens. |
|
number_of_infants required | This is the number of infants. |
|
cabin_class required | This is the class of the seat in the plane. Possible Values- "Economy", "Business", "First" or "Premium_Economy" |
|
currency required | You can use any currency code like USD, INR, EUR, etc |
|
region required | Check local prices of any country by passing the ISO code of that country. |
|
API Schema
You can follow this API schema to pass parameters.
https://api.flightapi.io/onewaytrip/<api-key>/<departure_airport_code>/<arrival_airport_code>/<departure_date>/<number_of_adults>/<number_of_childrens>/<number_of_infants>/<cabin_class>/<currency>
API Example
You have to send a GET request to https://api.flightapi.io/oneway
along with all the parameters.
Take a look at how you might call this API using various different coding languages.
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.
Field Name | Description |
---|---|
| A return trip will consist of 2 |
| Provides information about the flight leg from the destination to the origin. A leg comprises a single segment for a direct flight and may consist of multiple segments if there are several stopovers. |
| Displays information about individual stops within a |
| Reveals specific stops within a |
| Like |
| Just like |
Sometimes you might have to make more than one API call to get complete data. Since we compare a lot of airlines and vendors sometimes it becomes impossible to pull this much amount of data at once
Video Tutorial
Last updated