Introduction

Ikarus is an API that provides the price of flights for loyalty programs. We are able to research in real time the price and miles and money of the flights directly from the airlines website. The requests can use encryption and always return a JSON. Throughout the documentation you can see code examples in PHP and Ruby.

The API works in two steps:

  • Step 1: You request a search for how many fidelity programs you want. In this step our servers fire robots to collect the information and delivery to you the URLs where the result will be returned for each fidelity program.
  • Step 2: You must monitor the URLs from the previous step until the result is found (status "success" or "error"). While the search is not complete you will find the status "loading".

Flight Search: Request Search

Starts your searches on real time on ours servers and return URLs where will be displayed the results (one URL for each fidelity program).

Request Method POST
Request URL https://ikarus.com.br/requests/request/user user: Login do Ikarus
Request Body data=AGLTcCO5Gso3OGnicerNxYocj2TiuBMCw...cerNx data: Encrypted Search Data JSON

Search Data JSON Specifications

Field Type Options/Description
searches array multiplus, smiles, tudo_azul
type array
  • award: returns flight's id with price in miles.
  • award_flight_money: returns price in miles and money.
  • award_flight_money_tax: returns price in miles, money and boarding taxes.
from_airports array size 1 Use one airport only (multiple airports deprecated)
to_airports array size 1 Use one airport only (multiple airports deprecated)
go_date string Format "yyyy-mm-dd"
go_date_flexibility int Use 0 (deprecated for other values)
back_date string Format "yyyy-mm-dd"
back_date_flexibility int Use 0 (deprecated for other values)
adults int 1 <= adults <= 9
children int 1 <= adults+children <= 9
babies int babies <= adults
cabin string
  • E: for economic fares
  • X: for business fares
  • F: for first class fares (deprecated)
$user = "SEU_USUARIO";
$token = "SEU_TOKEN";

$url = "https://ikarus.com.br/requests/ssl_request/{$user}";
$headers = array("Content-Type: application/json", "Token: {$token}");
$json_data = '{"searches":["multiplus"],"type":"award","includes":"none","from_airports":["CNF"],"to_airports":["GIG"],"go_date":"2021-11-15","go_date_flexibility":"0","back_date":"","back_date_flexibility":"","adults":"1","children":"0","babies":"0","cabin":"E"}';

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($curl);
curl_close($curl);

var_dump($output);
require 'cgi'
require 'openssl'
require 'base64'
require 'httparty'

user = "SEU_USUARIO";
token = "SEU_TOKEN";

url = "https://ikarus.com.br/requests/ssl_request/#{user}"
body = '{"searches":["multiplus"],"type":"award","includes":"none","from_airports":["CNF"],"to_airports":["GIG"],"go_date":"2021-11-15","go_date_flexibility":"0","back_date":"","back_date_flexibility":"","adults":"1","children":"0","babies":"0","cabin":"E"}'
headers = {
	"Content-Type" => "application/json",
	"Token" => token
}

output = HTTParty.post(url, { headers: headers, body: body, verify: false })
pp output.body
var user = "SEU_USUARIO";
var token = "SEU_TOKEN";

var url = `https://ikarus.com.br/requests/ssl_request/${user}`;
var data = {"searches":["multiplus"],"type":"award","includes":"none","from_airports":["CNF"],"to_airports":["GIG"],"go_date":"2021-11-15","go_date_flexibility":"0","back_date":"","back_date_flexibility":"","adults":"1","children":"0","babies":"0","cabin":"E"};
var headers = { Token: token };

$.ajax({
  type: "POST",
  url: url,
  dataType: 'json',
  headers: headers,
  data: data,
  success: function (data) {
    console.log(data);
  }
});
Search Data JSON Before Encryption Example
{
    searches: ["multiplus", "smiles"],
    type: "award",
    includes: "none",
    from_airports: ["CNF"],
    to_airports: ["GIG"],
    go_date: "2017-11-15",
    go_date_flexibility: "0",
    back_date": "",
    back_date_flexibility: "",
    adults:"1",
    children:"0",
    babies:"0",
    cabin:"E"
}

Response Body Example

{
    multiplus : "https://ikarus.com.br/requests/result?data=8cQEiCzT...sYQ%3D%3D"
    smiles    : "https://ikarus.com.br/requests/result?data=R%2FYXJq...mug%3D%3D"
}

Flight Search: Search Results

Loads the result when finished (until returns status loading). When the search is finished returns an JSON status "success" or "error".

Tip:

Recommended to test every 3 seconds while the JSON status is not "success" or "error".

Request Method GET
Request URL https://ikarus.com.br/requests/result... Returned on Request Search
$curl = curl_init();
$url = "https://ikarus.com.br/requests/result?data=8cQEiCzT...sYQ%3D%3D";
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($curl);
curl_close($curl);
echo json_decode($output, true);
require 'cgi'
require 'openssl'
require 'base64'
require 'httparty'
output = HTTParty.get("https://ikarus.com.br/requests/result?data=8cQEiCzT...sYQ%3D%3D")
pp output.body
Response Body Example

{
  "status": "completed",
  "flights": {
    "outbound": {
      "E_1655_1555_58_1024": {
        "Flight": {
          "class": "E",
          "airline": "TP",
          "number": "58",
          "from": "BSB",
          "to": "MAD",
          "departure": 1495396500,
          "departure_date": "2017-05-21",
          "departure_time": "16:55",
          "arrival": 1495479300,
          "arrival_date": "2017-05-22",
          "arrival_time": "15:55"
        },
        "Trip": [
          {
            "airline": "TP",
            "number": "58",
            "from": "BSB",
            "to": "LIS",
            "departure": 1495396500,
            "departure_date": "2017-05-21",
            "departure_time": "16:55",
            "arrival": 1495396500,
            "arrival_date": "2017-05-21",
            "arrival_time": "16:55"
          },
          {
            "airline": "TP",
            "number": "1024",
            "from": "LIS",
            "to": "MAD",
            "departure": 1495479300,
            "departure_date": "2017-05-22",
            "departure_time": "15:55",
            "arrival": 1495479300,
            "arrival_date": "2017-05-22",
            "arrival_time": "15:55"
          }
        ],
        "Tax": {
          "adult": 154.61,
          "child": 154.61,
          "baby": 0
        },
        "BestAward": {
          "adult": 80000,
          "child": 80000,
          "baby": 0
        }
      },
      ...
    },
    "inbound": [...]
  }
}