Best fares, easy and straightforward integration
Designed with for developers
We will automatically query all of our airlines for flights that match your search criteria. You will need to save our Flight ID in order to later reference the flights the end customer has selected on your end.
In order to perform a search you need to provide the following query parameters
from | Mandatory | IATA Code or ID of the Departure airport |
to | Mandatory | IATA Code or ID of the Destination airport |
departureDate | Mandatory | Departure date in the YYYY-MM-DD format |
returnDate | Optional | For return searches, provide a date in the YYYY-MM-DD format |
residents[adults] | Mandatory |
The number of adults flying, between 0 and 12. Any non-numeric value is ignored.
There should be at least one adult regardless of whether they are a resident or a non-resident. |
residents[children] | Optional | The number of children flying, between 0 and 12. Any non-numeric value is ignored. |
residents[infants] | Optional | The number of infants flying, between 0 and 12. Any non-numeric value is ignored. |
nonResidents[adults] | Mandatory |
The number of adults flying, between 0 and 12. Any non-numeric value is ignored.
There should be at least one adult regardless of whether they are a resident or a non-resident. |
nonResidents[children] | Optional | The number of children flying, between 0 and 12. Any non-numeric value is ignored. |
nonResidents[infants] | Optional | The number of infants flying, between 0 and 12. Any non-numeric value is ignored. |
Searching is done using a simple GET request with query string.
A search is considered one-way if returnDate was not provided and the result will not list any return flights at all (the element is not present in the response).
Please be careful when querying Residents.
Residents may get cheaper fares than others.
Displaying Resident Fares to Non-Residents will result in poor user experience as upon booking the passenger data is validated against the offer and it may become more expensive if any of the passengers is not eligible.
You can query both Residents and Non-Residents at the same time. Upon redirection, users will see their flights pre-selected and a final price for each flight.
They can also access a breakdown, displaying the total price paid by each passenger.
If you are unsure what your passengers' nationalities are and whether they qualify for Resident fares, please only query Non-Residents.
There should be at least one adult regardless of whether they are a resident or a non-resident.
Infants should be no more than Adults.
For ease of use and easier implementation, you can reference Airports via their IATA codes.
Please note that Some Airports may NOT have IATA codes. Those may have fake codes assigned, which may be incompatible and/or inconsistent with yours. If you would like to access ALL airports, mapping yours to ours will be mandatory. In such a case, use IDs and as an added bonus, get better performance.
Please keep in mind that if you did not request return flights, the return key will be missing.
Receiving a price for a passenger type you did not include in your request is not guaranteed. This means that if you only queried adults, you may or may not get price for children.
The Total Price is the cheapest possible offer generated by our app for the queried passengers based on their residency and passenger types.
A very simple example in PHP (using JSON format): Residents and Non-Residents
$params = array ( 'from' => 1, 'to' => 2, 'departureDate' => '2024-12-29', 'returnDate' => '2025-01-05', 'affiliate' => 'YourAffiliateCode', 'secret' => 'YourAffiliateSecret', 'residents' => array ( 'adults' => 1, 'children' => 1, 'infants' => 1, ), 'nonResidents' => array ( 'adults' => 1, 'children' => 1, 'infants' => 1, ), ); // URL https://faresapi.com/api/v1/flights/get?from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&residents[adults]=1&residents[children]=1&residents[infants]=1&nonResidents[adults]=1&nonResidents[children]=1&nonResidents[infants]=1&_format=json // Encoded URL https://faresapi.com/api/v1/flights/get?from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&residents%5Badults%5D=1&residents%5Bchildren%5D=1&residents%5Binfants%5D=1&nonResidents%5Badults%5D=1&nonResidents%5Bchildren%5D=1&nonResidents%5Binfants%5D=1&_format=json $queryString = http_build_query($params); var_dump($queryString); // from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&residents[adults]=1&residents[children]=1&residents[infants]=1&nonResidents[adults]=1&nonResidents[children]=1&nonResidents[infants]=1 $url = 'https://faresapi.com/api/v1/flights/get?'.$queryString; var_dump($url); // https://faresapi.com/api/v1/flights/get?from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&residents[adults]=1&residents[children]=1&residents[infants]=1&nonResidents[adults]=1&nonResidents[children]=1&nonResidents[infants]=1 $json = file_get_contents($url); $data = json_decode($json, true); var_dump($data); foreach ($data['departure'] as $flight) { // your code to parse and display the flights } if (isset($data['return'])) { foreach ($data['departure'] as $flight) { // your code to parse and display the flights } }
A very simple example in PHP (using JSON format): Residents Only
$params = array ( 'from' => 1, 'to' => 2, 'departureDate' => '2024-12-29', 'returnDate' => '2025-01-05', 'affiliate' => 'YourAffiliateCode', 'secret' => 'YourAffiliateSecret', 'residents' => array ( 'adults' => 1, 'children' => 1, 'infants' => 1, ), ); // URL https://faresapi.com/api/v1/flights/get?from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&residents[adults]=1&residents[children]=1&residents[infants]=1&_format=json // Encoded URL https://faresapi.com/api/v1/flights/get?from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&residents%5Badults%5D=1&residents%5Bchildren%5D=1&residents%5Binfants%5D=1&_format=json $queryString = http_build_query($params); var_dump($queryString); // from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&residents[adults]=1&residents[children]=1&residents[infants]=1 $url = 'https://faresapi.com/api/v1/flights/get?'.$queryString; var_dump($url); // https://faresapi.com/api/v1/flights/get?from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&residents[adults]=1&residents[children]=1&residents[infants]=1 $json = file_get_contents($url); $data = json_decode($json, true); var_dump($data); foreach ($data['departure'] as $flight) { // your code to parse and display the flights } if (isset($data['return'])) { foreach ($data['departure'] as $flight) { // your code to parse and display the flights } }
A very simple example in PHP (using JSON format): Non-Residents Only
$params = array ( 'from' => 1, 'to' => 2, 'departureDate' => '2024-12-29', 'returnDate' => '2025-01-05', 'affiliate' => 'YourAffiliateCode', 'secret' => 'YourAffiliateSecret', 'nonResidents' => array ( 'adults' => 1, 'children' => 1, 'infants' => 1, ), ); // URL https://faresapi.com/api/v1/flights/get?from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&nonResidents[adults]=1&nonResidents[children]=1&nonResidents[infants]=1&_format=json // Encoded URL https://faresapi.com/api/v1/flights/get?from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&nonResidents%5Badults%5D=1&nonResidents%5Bchildren%5D=1&nonResidents%5Binfants%5D=1&_format=json $queryString = http_build_query($params); var_dump($queryString); // from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&nonResidents[adults]=1&nonResidents[children]=1&nonResidents[infants]=1 $url = 'https://faresapi.com/api/v1/flights/get?'.$queryString; var_dump($url); // https://faresapi.com/api/v1/flights/get?from=1&to=2&departureDate=2024-12-29&returnDate=2025-01-05&affiliate=YourAffiliateCode&secret=YourAffiliateSecret&nonResidents[adults]=1&nonResidents[children]=1&nonResidents[infants]=1 $json = file_get_contents($url); $data = json_decode($json, true); var_dump($data); foreach ($data['departure'] as $flight) { // your code to parse and display the flights } if (isset($data['return'])) { foreach ($data['departure'] as $flight) { // your code to parse and display the flights } }