Wego Flights API

Wego Flights API allows clients to search for flight fares and availabilty in real-time across Wego's inventory of partners. The service is available via standard HTTP POST request and responses are made available in JSON format.

To make POST request for testing purpose, we recommend to use a Postman plug-in for Google Chrome (example).

Core Concepts

Version

This API documentation is meant only for the latest version, which is 2. Version normally is the number in the URL right after /flights/api/k/, e.g. api.wego.com/flights/api/k/2/searches.

Schema

The current flights API only support JSON format for both request and response, so please remember to set these values to your headers:

  • Content-Type: application/json
  • Accept: application/json

For request JSON, please fill in all required attribtues, do not set optional attributes if not necessary to avoid any issues.

All timestamps are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ, full form or short form.

Authentication

In order to make requests to api.wego.com, your application must first obtain an api_key and a ts_code. Normally you should add your api_key and ts_code into query parameters.

POST api.wego.com/flights/api/k/2/searches?api_key=your_secret_api_key&ts_code=your_secret_ts_code

Please use your api_key and ts_code into all requests you make to api.wego.com and do not share them to anyone.

Affiliate team is supporting api_key and ts_code, you can read more by the following link.

Language

The current Flights API supports several languages. Add query parameter locale to get the response in different locale rather than en.

POST api.wego.com/flights/api/k/2/searches?locale=en

Supported locales are ar, pt-br, ms, nl, zh-cn, pl, th, tr, zh-tw, vi, sv, fr, pt, ja, de, it, ru, id, ko, en.

We strongly recommend to use locale parameter along with the User-country-code!

Status Codes

The API is designed to return different status codes according to context and action. In this way if a request results in an error, the caller is able to get insight into what went wrong.

HTTP code values:

  • 200 Ok - Everything goes correctly
  • 400 Bad Request - Something wrong with the request
  • 403 Forbiden - The limit of API calls is exceeded
  • 422 Unprocessable Entity - Something wrong with the request JSON
  • 500 Internal Server Error - Unidentified server error

When an error happens, normally there will be a message and a list of errors (if available) are responded back for debugging purposes.

HTTP/1.1 404 Not Found

{
  "message": "Not Found"
}     
HTTP/1.1 422 Unprocessable Entity

{
  "message": "Validation Failed",
  "errors": [
    { "field": "trips[0].outbound_date", "error": "must be between today and 365 days from today" },
    { "field": "adults_count", "error": "must be between 1 and 10" }
  ]
}     

API Methods

/flights/api/k/2/searches - Start a new flight search

POST api.wego.com/flights/api/k/2/searches
{
  "trips": [
    {
      "departure_code": "SYD",
      "arrival_code": "LON",
      "outbound_date": "2014-01-24",
      "inbound_date": "2014-01-29"
    }
  ],
  "adults_count": 1
}     

Search Parameters

  • trips (required at least 1 element) - Array of trips. Currently we only support 1 trip, do not send more than 1 trip unless advised here.
  • trips[].departure_code (required) - Departure airport or city code, IATA 3-letter code
  • trips[].arrival_code (required) - Arrival airport or city code, IATA 3-letter code
  • trips[].outbound_date (required) - Travel date from departure_code to arrival_code.
    • By default outbound_date is assumed to be in departure time zone
  • trips[].inbound_date (optional) - Return date from arrival_code to departure_code
    • If inbound_date is not specified, trip is considered as a oneway trip
    • By default inbound_date is assumed to be in arrival time zone
  • trips[].departure_city (required, false as default) - Set true if departure_code is a city code
  • trips[].arrival_city (optional, false as default) - Set true if arrival_code is a city code
  • adults_count (required) - Number of adults
    • Must be a number greater than or equal to 1 and smaller than or equal to 10
  • children_count (optional, 0 as default) - Number of children
    • Must be a number greater than or equal to 0 and smaller than or equal to 10
  • cabin (optional, economy as default) - Can be economy, business, first
  • user_country_code and country_site_code (optional, XX as default) - Country code of the user (use both parameters together).
    • Some of our providers only support users from certain countries due to legal issues
    • If you are not able to set user_country_code and country_site_code, XX will be used and certain content might be unavailable

Search Request Example

POST api.wego.com/flights/api/k/2/searches
{
  "trips": [
    {
      "departure_code": "SYD",
      "arrival_code": "LON",
      "outbound_date": "2014-01-24",
      "inbound_date": "2014-01-29"
    }
  ],
  "adults_count": 2,
  "children_count": 1,
  "cabin": "economy",
  "user_country_code": "GB",
  "country_site_code": "GB"
}      

Search Response Example

{
    "id": "T5dJTxtxQv-uQ6OuYtaWkw",
    "key": "[SYD:LON:2014-01-24:2014-01-29]~1~0~XX~SG",
    "trips": [
        {
            "id": "SYD:LON:2014-01-24:2014-01-29",
            "departure_code": "SYD",
            "departure_name": "Sydney",
            "departure_state_code": "NSW",
            "departure_country_code": "AU",
            "departure_country_name": "Australia",
            "arrival_code": "LON",
            "arrival_name": "London",
            "arrival_city": true,
            "arrival_country_code": "GB",
            "arrival_country_name": "United Kingdom",
            "outbound_date": "2014-01-24",
            "inbound_date": "2014-01-29",
            "trip_type": "standard"
        }
    ],
    "cabin": "economy",
    "adults_count": 1,
    "country_site_code": "XX",
    "user_country_code": "SG",
    "created_at": "2014-01-24T12:51:59.050+08:00"
}     

Please keep search.id, which is T5dJTxtxQv-uQ6OuYtaWkw, and trips[1].id, which is SYD:LON:2014-01-24:2014-01-29, in your local variables to make susequent requests to get fares.

/flights/api/k/2/fares - Get results of a search (fares)

To get the full results you should do at least a 10 seconds delay between SEARCH and FARES requests, because we need to connect to our partners to get the results and sometimes partners can be slow to respond.

POST api.wego.com/flights/api/k/2/fares
{
  "id": "1376967853520",
  "search_id": "T5dJTxtxQv-uQ6OuYtaWkw",
  "trip_id": "SYD:LON:2014-01-24:2014-01-29",
  "fares_query_type": "route"
}     

Fares Parameters

  • id (required) - A random string you need to assign for this query, used for debugging purposes
  • search_id (required) - Search id you get when the search is created
  • trip_id (required) - Trip id you get when the search is created
  • fares_query_type (required) - Please keep it as route
    • Route is a unique combination of segment_ids, including both inbound and outbound. Segment id is the designator_code (full flight number) that operate the segment.
  • sort (optional, price as default) - Routes will be sorted by this attribute
    • price means sort by best price of the route
    • duration means sort by duration of the route
    • outbound_departure_time means sort by outbound departure time of the route
    • inbound_departure_time means sort by inbound departure time of the route
  • order (optional, asc as default) - Sorting order, can be asc, desc
  • page (optional, 1 as default) - Results page, must be a number <= 100
  • per_page (optional, 10 as default) - Results per page, must be a number <= 30
  • currency_code (optional, USD as default) - Currency code in which you want to get the price

Additional Parameters for Filtering the Result Set

  • price_min_usd (optional) - Price min in USD
    • Use this to get fares with price greater than a number
  • price_max_usd (optional) - Price max in USD
    • Use this to get fares with price smaller than a number
  • stop_types (optional) - An array of stop types
    • Use this to get fares match certain stop types, a stop type can be none, one, two_plus
    • none means no stop, or direct flights, both outbound and inbound
    • one means maximun one stop in either outbound or inbound
    • two_plus means maximum 2 or more stops in either outbound or inbound
  • provider_codes (optional) - An array of provider codes (e.g. expedia.com)
    • Use this to get fares match certain providers
  • designator_codes (optional) - An array of designator codes (or full flight numbers)
    • Use this to get fares match certain flight numbers
  • departure_airport_codes (optional) - An array of departure airport codes
    • Use this to get fares from certain departure airports only
  • arrival_airport_codes (optional) - An array of arrival airport codes
    • Use this to get fares to certain arrival airports only
  • stopover_airport_codes (optional) - An array of stopover airport codes
    • Use this to get fares by certain stopover airports only
  • airline_codes (optional) - Airline codes
    • Use this to get fares of certain ailines only
  • stopover_duration_min (optional) - Minimum stopover duration in minute
    • Use this to get fares with total stopover duration >= number of minutes
    • Must be a number >= 0
  • stopover_duration_max (optional) - Maximum stopover duration in minute
    • Use this to get fares with total stopover duration <= number of minutes
    • Must be >= stopover_duration_min, if stopover_duration_min is specified
  • duration_min (optional) - Minimum trip duration in minute
    • Use this to get fares with duration >= number of certain minutes
    • Must be a number >= 0
  • duration_max (optional) - Maximum trip duration in minute
    • Use this to get fares with duration <= number of certain minutes
    • Must be >= duration_min, if duration_min is specified
  • departure_day_time_filter_type (optional) - Special attribute, please keep it as separate so that you can get outbound_departure_day_time_filter and inbound_departure_day_time_filter
  • outbound_departure_day_time_min (optional) - Outbound minimum departure day time in minute
    • Use this to get fares with outbound departure day time >= certain time
    • Must be a number >= 0 and <= 1440
    • Use it along with the parameter departure_day_time_filter_type (you need to set value separate)
  • outbound_departure_day_time_max (optional) - Outbound maximum departure day time in minute
    • Use this to get fares with outbound departure day time <= certain time
    • Must be a number >= 0 and <= 1440
    • Must be >= outbound_departure_day_time_min, if outbound_departure_day_time_min is specified
    • Use it along with the parameter departure_day_time_filter_type (you need to set value separate)
  • inbound_departure_day_time_min (optional) - Inbound minimum departure day time in minute
    • Only applicable for round-trip trips
    • Use this to get fares with inbound departure day time >= certain time
    • Must be a number >= 0 and <= 1440
    • Use it along with the parameter departure_day_time_filter_type (you need to set value separate)
  • inbound_departure_day_time_max (optional) - Inbound maximum departure day time in minute
    • Only applicable for round-trip trips
    • Use this to get fares with inbound departure day time <= certain time
    • Must be a number >= 0 and <= 1440
    • Must be >= inbound_departure_day_time_min, if inbound_departure_day_time_min is specified
    • Use it along with the parameter departure_day_time_filter_type (you need to set value separate)>

Fares Request Example

POST api.wego.com/flights/api/k/2/fares
{
  "id": "1376967853520",
  "search_id": "T5dJTxtxQv-uQ6OuYtaWkw",
  "trip_id": "SYD:LON:2014-01-24:2014-01-29",
  "fares_query_type": "route",

  "sort": "price",
  "order": "asc",
  "page": 1,
  "per_page": 10,

  "currency_code": "EUR",
  "price_min_usd": 515,
  "price_max_usd": 1700,

  "departure_day_time_filter_type": "separate",

  "stop_types": ["none"],

  "provider_codes": ["expedia.com","farebuzz.com"],
  "aiport_codes": ["LCY", "LHR"],
  "airline_codes": ["SQ", "CZ"],
  "designator_codes": ["SQ221", "CZ301"],

  "duration_max": 2090,
  "duration_min": 300,

  "outbound_departure_day_time_min": 360,
  "outbound_departure_day_time_max": 1300,

  "inbound_departure_day_time_min": 400,
  "inbound_departure_day_time_max": 1200
}     

Fares Response Example

{
   "currency": {
      "code": "USD",
      "name": "U.S. Dollar",
      "symbol": "US$",
      "exchange_rate": 1
   },
   "routes": [
      {
         "id": "CZ302-2422:CZ303-2509=CZ304-2922:CZ301-3108",
         "fares": [
            {
               "price": 2285.54,
               "description": "Economy",
               "deeplink": "http://www.wego.com/flights/providers/2/deeplinks?search_id=T5dJTxtxQv-uQ6OuYtaWkw&trip_id=SYD:LON:2014-01-24:2014-01-29&fare_id=edreams.net:0&route=SYD-LHR",
               "provider_code": "edreams.net",
               "deeplink_params": {
                  "trip_id": "SYD:LON:2014-01-24:2014-01-29",
                  "route": "SYD-LHR",
                  "search_id": "T5dJTxtxQv-uQ6OuYtaWkw",
                  "fare_id": "edreams.net:0"
               }
            },
            {
               "price": 2297.183,
               "description": "Economy",
               "deeplink": "http://www.wego.com/flights/providers/2/deeplinks?search_id=T5dJTxtxQv-uQ6OuYtaWkw&trip_id=SYD:LON:2014-01-24:2014-01-29&fare_id=budgetair.co.uk:0&route=SYD-LHR",
               "provider_code": "budgetair.co.uk",
               "deeplink_params": {
                  "trip_id": "SYD:LON:2014-01-24:2014-01-29",
                  "route": "SYD-LHR",
                  "search_id": "T5dJTxtxQv-uQ6OuYtaWkw",
                  "fare_id": "budgetair.co.uk:0"
               }
            },
            { … }
            }
         ],
         "comfort_index": 797.17,
         "best_fare": {
            "price": 2285.54,
            "description": "Economy",
            "deeplink": "http://www.wego.com/flights/providers/2/deeplinks?search_id=T5dJTxtxQv-uQ6OuYtaWkw&trip_id=SYD:LON:2014-01-24:2014-01-29&fare_id=edreams.net:0&route=SYD-LHR",
            "provider_code": "edreams.net",
            "deeplink_params": {
               "trip_id": "SYD:LON:2014-01-24:2014-01-29",
               "route": "SYD-LHR",
               "search_id": "T5dJTxtxQv-uQ6OuYtaWkw",
               "fare_id": "edreams.net:0"
            }
         },
         "outbound_segments": [
            {
               "departure_code": "SYD",
               "arrival_code": "CAN",
               "departure_time": "2014-01-24T22:15:00+10:00",
               "arrival_time": "2014-01-25T05:00:00+08:00",
               "designator_code": "CZ302",
               "airline_code": "CZ",
               "departure_name": "Sydney",
               "arrival_name": "Guangzhou",
               "airline_name": "China Southern Airlines"
            },
            {
               "departure_code": "CAN",
               "arrival_code": "LHR",
               "departure_time": "2014-01-25T09:30:00+08:00",
               "arrival_time": "2014-01-25T14:50:00+00:00",
               "designator_code": "CZ303",
               "airline_code": "CZ",
               "departure_name": "Guangzhou",
               "arrival_name": "London Heathrow Apt",
               "airline_name": "China Southern Airlines"
            }
         ],
         "inbound_segments": [
            {
               "departure_code": "LHR",
               "arrival_code": "CAN",
               "departure_time": "2014-01-29T22:30:00+00:00",
               "arrival_time": "2014-01-30T18:30:00+08:00",
               "designator_code": "CZ304",
               "airline_code": "CZ",
               "departure_name": "London Heathrow Apt",
               "arrival_name": "Guangzhou",
               "airline_name": "China Southern Airlines"
            },
            {
               "departure_code": "CAN",
               "arrival_code": "SYD",
               "departure_time": "2014-01-31T08:20:00+08:00",
               "arrival_time": "2014-01-31T20:40:00+10:00",
               "designator_code": "CZ301",
               "airline_code": "CZ",
               "departure_name": "Guangzhou",
               "arrival_name": "Sydney",
               "airline_name": "China Southern Airlines"
            }
         ],
         "marketing_airline_code": "CZ"
      },
      { … }
   ],
   "query_id": "1376967853520",
   "fares_query_type": "route",
   "price_filter": {
      "min": 2285.54,
      "max": 12141.215,
      "min_usd": 2285.54,
      "max_usd": 12141.215
   },
   "provider_filters": [
      {
         "code": "airfrance.com",
         "name": "airfrance.com",
         "price_min": 3602.2573
      },
      {
         "code": "budgetair.co.uk",
         "name": "budgetair.co.uk",
         "price_min": 2297.183
      },
      { … }
   ],
   "airline_filters": [
      {
         "code": "EI",
         "name": "Aer Lingus",
         "price_min": 6620.515
      },
      {
         "code": "SU",
         "name": "Aeroflot",
         "price_min": 3442.546
      },
      { … }
   ],
   "stopover_airport_filters": [
      {
         "code": "AUH",
         "name": "Abu Dhabi",
         "price_min": 2340.036
      },
      {
         "code": "AMS",
         "name": "Amsterdam",
         "price_min": 3602.2573
      },
      { … }
   ],
   "departure_airport_filters": [
      {
         "code": "SYD",
         "name": "Sydney",
         "price_min": 2285.54
      }
   ],
   "arrival_airport_filters": [
      {
         "code": "LCY",
         "name": "London City Apt",
         "price_min": 3602.2573
      },
      {
         "code": "LGW",
         "name": "London Gatwick Apt",
         "price_min": 2600.488
      },
      { … }
   ],
   "departure_day_time_filter": {
      "min": 430,
      "max": 1350
   },
   "duration_filter": {
      "min": 1400,
      "max": 2720
   },
   "stopover_duration_filter": {
      "min": 0,
      "max": 1410
   },
   "filtered_routes_count": 442,
   "routes_count": 442
}     

Fares Response Attributes

  • routes - Array of routes, sorted by sort and order provided in the fares request
  • routes[].id - Id of the route, a combination of both outbound and inbound segment ids
  • routes[].fares - Array of fares belong to this route sorted by price
  • routes[].fares.price - Price of the fare
  • routes[].fares.description - Description of the fare
  • routes[].fares.deeplink - Deeplink of the fare, use this url to send users to booking page, read more about handoff page
  • routes[].fares.provider_code - Provider that provides the fare
  • routes[].fares.deeplink_params - deeplink params of the fare, used to get deeplink object, read more about customized handoff page.
  • routes[].best_fare - Best fare of the route in terms of price
    • All Best fare attributes are the same with ones in fares
  • routes[].outbound_segments - Array of outbound segments of the route
  • routes[].outbound_segments[].airline_code - Airline code of the segment
  • routes[].outbound_segments[].designator_code - Designator code (full flight number) of the segment
  • routes[].outbound_segments[].operating_airline_name - Operating airline name of the segment
    • Available only when segment is operated by a different ailine, read more about codeshare
  • routes[].outbound_segments[].departure_code - Departure code of the segment
  • routes[].outbound_segments[].departure_name - Departure name of the segment
  • routes[].outbound_segments[].departure_time - Departure time of the segment
  • routes[].outbound_segments[].arrival_code - Arrival code of the segment
  • routes[].outbound_segments[].arrival_name - Arrival name of the segment
  • routes[].outbound_segments[].arrival_time - Arrival time of the segment
  • routes[].inbound_segments - Array of inbound segments of the route
    • Available only when trip is round-trip
    • All segment attributes are the same with ones in outbound_segments[]
  • query_id - The same string from fares query id, used for debugging purposes
  • fares_query_type - The same fares_query_type from fares query, used for debugging purposes
  • currency - Currency information based on currency_code set in from the query
    • All price, price_min are in currency.code, otherwise specified
  • price_filter - Minmum and maximum prices of all filtered fares in USD and in currency_code in currency
  • duration_filter - Minimum and maximum durations in minutes of all filtered fares
  • stopover_duration_filter - Minmum and maximum stopover durations in minutes of all filtered fares
  • outbound_departure_day_time_filter - Minmum and maximum outbound departure day times in minutes of all filtered fares
  • inbound_departure_day_time_filter - Minmum and maximum inbound departure day times in minutes of all filtered fares
  • stop_type_filters - Array of stop types of all filtered fares
    • Maximun 3 items none, one, two_plus
  • provider_filters - Array of providers of all filtered fares, sort by name
  • airline_filters - Array of airlines of all filtered fares, sorted by name
  • departure_airport_filters - Array of departure airports of all filtered fares, sorted by name
  • arrival_airport_filters - Array of arrival airports of all filtered fares, sorted by name
  • stopover_airport_filters - Array of stopover airports of all considerted fares, sorted by name
  • routes_count - Total number of routes for this pair of search_id and trip_id
  • filtered_routes_count - Number of routes filtered by the fares query

/flights/api/k/2/currencies - Get supported currencies

To get supported currencies send a GET request to this end point:

GET api.wego.com/flights/api/k/2/currencies

Currencies response:

{
  "currencies": [
    {
      "code":"USD",
      "name":"U.S. Dollar",
      "symbol":"US$",
      "exchange_rate":1.0
    },
    {
      "code":"SGD",
      "name":"Singapore Dollar",
      "symbol":"S$",
      "exchange_rate":1.2703
    },
    { ... }
  ]
}     

Customized Handoff Page

By default, you can use the URL from fare.deeplink to send users to the booking page of the fare. You have to add your ts_code to that URL query parameters. The handoff page is handled by Wego server.

However, in case you want to build a customized handoff page yourself, you need to obtain deeplink object.

To get deeplink object send a GET request to this end point:

GET http://api.wego.com/flights/api/k/providers/2/deeplinks

You have to add all fare.deeplink_params of the fare you want to deeplink along with your api_key and ts_code to that URL query parameters.

List of parameters currently in fare.deeplink_params:

  • search_id - Search id got when you created the search
  • trip_id - Trip id got when you created the search
  • fare_id - Fare id of the fare you want to deeplink
  • route - A combination of fare.departure_airport_code and fare.arrival_airport_code, e.g. SIN-HAN

Deeplink object response

{
  "requests": [
    {
      "url": "http://www.cebupacificair.com/",
      "method": "GET",
      "delay": 0,
      "post_params": null
    },
    {
      "url": "http://book.cebupacificair.com/Search.aspx",
      "method": "POST",
      "delay": 0,
      "post_params": {
        "Inbound": "2013-08-23",
        "Outbound": "2013-08-13",
        "Destination": "BKK",
        "Origin": "SIN"
      }
    }
  ],
  "provider_code": "cebupacific.com"
}     

Deeplink Object Response Attributes

  • provider_code - Provider that provide the booking service
  • requests (at least 1 element) - Lists of requests you need to make in order to get to booking page
  • requests[].url - URL of the request, including query parameters
  • requests[].delay - Delay in millisecond before you should trigger the request
  • requests[].method - Method to trigger the request, either POST or GET
  • requests[].post_params - In case of POST request, you might have to send certain post params in the post body

Javascript for Customized Handoff Page

You also need to implement javascript on your customized handoff page in order to send user to our partners. Please remember to replace <!-- deeplink object as json --> in the code below with your actual deeplink object as json.

<script>
  (function(){
    var container = document.getElementById('container');
    var deeplink = <!-- deeplink object as json -->;

    function run_requests(requests) {
      requests_count = requests.length

      for (count = 0; count < requests_count; count++) {
        request = requests[count]

        if (requests_count == (count + 1)) {
          // Don't use hidden iframe for the last request
          setTimeout(function() { make_request(window.document, request); }, 1000);
        } else {
          var iframe = document.createElement('iframe');
          iframe.setAttribute('id', 'deep-linker' + count);
          iframe.style.border = '0px';
          iframe.style.width = '0px';
          iframe.style.height = '0px';
          document.body.appendChild(iframe);

          // Get the document object.
          var doc = null;
          if (iframe.contentDocument && iframe.contentDocument.location) {
            // For DOM2-compliant browsers.
            doc = iframe.contentDocument;
          } else if (iframe.contentWindow) {
            // For IE5.5 and IE6.
            doc = iframe.contentWindow.document;
          } else if (window.frames) {
            // For Safari.
            doc = window.frames['deep-linker'].document;
          }

          // Clear the iframe document content if making a POST.
          if (request.method.toUpperCase() === "POST") {
            doc.open();
            doc.write('');
            doc.close();
          }

          make_request(doc, request);
        }
      }
    }

    function make_request(doc, request) {
      var url = request.url;
      var post_params = request.post_params;

      var delay = 200;
      if (request.delay) {
        delay = request.delay;
      }

      if (request.method.toUpperCase() === "POST") {
        // HTTP POST.
        var form_html = '';
        form_html += '<html><body>';

        // Create a <form> and have it auto-submit.
        form_html += '<form id="ninjaForm" name="ninjaForm" method="post" action="' + url + '">';

        if (post_params) {
          Object.keys(post_params).map(function(key) {
            form_html += '<input name="' + key + '" value="' + post_params[key] + '" type="hidden" />';
          });
        }

        form_html += '</form><script type="text/javascript">setTimeout("submitme()", ' + delay + ');function submitme() { document.ninjaForm.submit(); }';
        form_html += '<' + '/script>';
        form_html += '</body></html>';

        doc.open();
        doc.write(form_html);
        doc.close();
      } else {
        doc.location.href = url;
      }
    }

    run_requests(deeplink.requests)
  }());
</script>

Resources

Logos

Airline logos

http://www.mediawego.com/images/flights/airlines/120x40t/{Airline IATA}.gif

e.g. for Singapore Air - http://www.mediawego.com/images/flights/airlines/120x40t/SQ.gif

Provider logos

http://www.mediawego.com/images/partners/handoff/{Partner name}.gif

e.g. for cleartrip.com - http://www.mediawego.com/images/partners/handoff/cleartrip.com.gif

Locations

The list of supported locations can be downloaded by the following links:

Have more questions? Submit a request

Comments

  • Avatar
    LEE, SEUNGHOON

    this API is doesn't work.

    http://api.wego.com/flights/api/k/2/fares this link is 404 not found.
    http://api.wego.com/flights/api/k/2/searches this link is I Think that "api.wego.com/flights/api/k/2/fares"
    Please check your API

  • Avatar
    Natalya Kosenko

    LEE, SEUNGHOON,

    You are trying to perform GET request, whereas the service is available via HTTP POST request.

    For example:
    POST api.wego.com/flights/api/k/2/fares
    {
    "id": "1376967853520",
    "searchid": "T5dJTxtxQv-uQ6OuYtaWkw",
    "trip
    id": "SYD:LON:2014-05-24:2014-05-29",
    "faresquerytype": "route"
    }

    To make POST request for testing purpose, we recommend to use a Postman plug-in for Google Chrome: https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm

  • Avatar
    Travefy Matt

    It would be nice to be able to get a single route (with fares) by route ID to pull the latest flight itinerary and updated prices without having to start a new search with filters and find it. For example, adding a route_ids[] filter to the fares request would accomplish this. Is there a possibility that a call like this exists or is in the pipeline?

  • Avatar
    Natalya Kosenko

    Hi Matt,

    Can you provide an example of the use case for route_ids[] filter? )

  • Avatar
    Travefy Matt

    Hi Natalya -

    We allow our users to save flights to compare and book later. We'd like to be able to go find a particular flight (route) at a later time to be able to pull the latest flight information and cheapest price so that their information is accurate after they have saved. The filter is a possibility, but ideally having a call to get a route by id or collection of routes by ids would work best. This would also allow us to avoid paging through the results to find the routes we need and thus minimize our number of calls to the service.

  • Avatar
    Natalya Kosenko

    Hi Matt,

    Ah I see, I got you.
    Unfortunately we don't have this functionality for now :( I'd recommend you to start a new search and then use filters by designator_codes and by outbound/inbound departure time. It's not so "beautiful" way, but at least you'll most likely avoid paging.
    Something like this:

    POST api.wego.com/flights/api/k/2/fares
    {
    "id": "1376967853520",
    "searchid": "sHAniJQRX-chq4GguNInw",
    "tripid": "IKA:ORY:2014-05-12:2014-05-15",
    "fares
    querytype": "route",
    "departure
    daytimefiltertype": "separate",
    "designator
    codes": ["PC513", "PC513", "PC402", "PC402"],

    "outbounddeparturedaytimemin": 265,
    "outbounddeparturedaytimemax": 265,

    "inbounddeparturedaytimemin": 845,
    "inbounddeparturedaytimemax": 845
    }

  • Avatar
    Itamar Kotler

    Hi Natalya,

    Several days ago you've sent an email with improvements and wrote that you now have support for 3 days Matrix in flights. Is it also updated in the API ?

    Regards,

    Itamar

  • Avatar
    Natalya Kosenko

    Hi Itamar,

    The "+/- 3 days Matrix" available on wego.com only, but we'll add this functionality to the API in future.

  • Avatar
    Hasan Roohani

    Hi Natalya

    Is price per adult or it is the total price for adults and children?

  • Avatar
    Natalya Kosenko

    Hi Mahdi,

    Price is per passenger. For example, adult price is $300, children price is $200. API will return average price per passenger = (300+200)/2 = $250.

  • Avatar
    Hasan Roohani

    Hi Natalya,
    I get lots of this message: Sorry, looks like our server has been caught napping!
    What is this!? Why I get a lot of server errors?

    Bests

  • Avatar
    Natalya Kosenko

    Hi Mahdi,

    You might sending GET request instead of POST. Please send POST request as stated in documentation.
    To make POST request for testing purpose, we recommend to use a Postman plug-in for Google Chrome (example: http://monosnap.com/image/z15uvCOXSQpk46BX09ZbcpbMkoXwfs).

  • Avatar
    Amit Arora

    Hi Natalya

    Could you tell me if we could use your flight location excel sheet for searching locations in hotel API as well. I mean if we use the city name from that sheet, would that work.

    Thanks and Regards

    Amit Arora

  • Avatar
    Natalya Kosenko

    Hi Amit,

    Locations for flights and hotels are different because not every city has an airport.

    For hotel locations I'd suggest you to use the api method: http://support.wan.travel/hc/en-us/articles/200713154-Wego-Hotels-API#apilocationssearch

    Or alternatively you can download the list of hotel locations here: https://www.dropbox.com/s/47ml7jyun1zywka/locations.csv.

  • Avatar
    Muhammad Shafiq

    Hi,

    Is it possible to select multiple cities? like

    1- From - To
    2 From - To
    3 From - To

  • Avatar
    Natalya Kosenko

    Hi @Muhammad,

    The API doesn't support multiple cities search, you can search for fares from City X to City Y only.

  • Avatar
    Umair Mumtaz

    Hi Natalya,

    how i can get the airport codes etc from your API. like i want to give auto suggest to my user. they type city name characters and it show in drop down the airports in that city. is there any solution for that?

  • Avatar
    Natalya Kosenko

    Hi Umair,

    Unfortunately we don't have an autocomplete method in the API, but you can do it on your side. You can download the list of cities and airports here: http://support.wan.travel/hc/en-us/articles/200191669-Wego-Flights-API#locations.

  • Avatar
    Umair Mumtaz

    Hi Natalya,

    i will download it. but if in future Wego change/upgrade locations etc then we have to download again?

  • Avatar
    Natalya Kosenko

    Hi Umair,

    Actually we quite seldom change locatios database as there are not so many new airports are opened in the world. But yes, if there are some changes you'll need to download it again.

  • Avatar
    Justinnealryan

    Hi Natalya,

    We are in the process of updating to the new flights api. While testing this new api, i noticed that the results returned are less that the old api.
    For example, i'm doing a search for a flight from YYZ - YUL ( Toronto - Montreal) and it is only returning one price. Likewise for any other popular flight destinations..i am only getting a few results. Is there something we are doing wrong.

  • Avatar
    Natalya Kosenko

    Hi Justin,

    I've just performed a search with the following parameters:
    {
    "trips": [
    {
    "departurecode": "YYZ",
    "arrival
    code": "YUL",
    "outbounddate": "2014-10-24",
    "inbound
    date": "2014-10-29"
    }
    ],
    "adults_count": 1
    }
    There are 632 routes in the API response.
    Can you check if you do a 10 seconds delay between Search and Fares requests?

  • Avatar
    Justinnealryan

    Hi Natalya,

    Is the api used on the wego website and one used by affiliates the same. I just did a test doing the same flight search on wego and one on the api and the price is different. I did set it to the same currency. I'm wondering if there is something else we are missing.

  • Avatar
    Natalya Kosenko

    Hi Justin,

    You have to pass parameters "usercountrycode" and "countrysitecode" to get the same results as on wego website.

    For example, if you want to get the same results as on wego.com.sg:

    POST http://api.wego.com/flights/api/k/2/searches/
    {
    "trips": [
    {
    "departurecode": "RGN",
    "arrival
    code": "NYU",
    "outbounddate": "2014-10-04"
    }
    ],
    "adults
    count": 1,
    "usercountrycode": "SG",
    "countrysitecode": "SG"
    }

  • Avatar
    Justinnealryan

    Hi,

    I am still using the old version of the flight api. It seems that we are no longer getting any results back. Has that api been turned off? We are in the process of updating to the new api version but that will be in 2 weeks.Can you please let me know if the old api has been turned off?

  • Avatar
    Natalya Kosenko

    Hi Justin,

    We actually stopped supporting the old API more than a year ago. To access the old api try to change the api url: use http://www.wego.com.sg instead of http://www.wego.com.

  • Avatar
    Snehal Brahmbhatt

    Hello Natalya,

    Calling following url for search it will not return me UNIQUE SEARCH ID. Its work before 1 hour. but now its not working for me. Please help me. Its urgent.....

    POST api.wego.com/flights/api/k/2/searches?apikey=APIKEY&tscode=TSCODE

    {"trips":[{"departurecode":"SYD","arrivalcode":"LON","outbounddate":"2014-12-12","inbounddate":"2014-12-12"}],"adultscount":"2","childrencount":1,"cabin":"economy","usercountrycode":"GB","countrysitecode":"GB"}

  • Avatar
    Natalya Kosenko

    Hi @Snehal,

    I've checked, it works OK for me.
    Can you send us the exact API request and API responses to support@wan.travel.
    Thank you.

  • Avatar
    Snehal Brahmbhatt

    Hello Natalya,

    Hope you are doing well!

    I have downloaded a 'flights_locations.csv' which is provided above on this page. and create a database for the flight api. but there are no country field in these above .csv file. Can you please suggest us how we display country name as well?

    i.e. If you're looking for 'Sydney' there are 3 records 1 is for Airport and rest of for Cities. From 2 Cities records 1 is from Australia and another is from Canada. I just wanted to display Country name as well.

    Please help...!

    Thanks in Advance.... :)

  • Avatar
    Natalya Kosenko

    Hi Snehal, I've updated the information: http://support.wan.travel/hc/en-us/articles/200191669#locations

Please sign in to leave a comment.