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).
Table of Contents
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
{ "trips": [ { "departure_code": "SYD", "arrival_code": "LON", "outbound_date": "2014-01-24", "inbound_date": "2014-01-29" } ], "adults_count": 1,
"locale": "ar" }
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 correctly400
Bad Request - Something wrong with the request403
Forbiden - The limit of API calls is exceeded422
Unprocessable Entity - Something wrong with the request JSON500
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 oftrips
. 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 codetrips[].arrival_code
(required) - Arrival airport or city code, IATA 3-letter codetrips[].outbound_date
(required) - Travel date fromdeparture_code
toarrival_code
.- By default
outbound_date
is assumed to be in departure time zone
- By default
trips[].inbound_date
(optional) - Return date fromarrival_code
todeparture_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
- If
trips[].departure_city
(required,false
as default) - Settrue
ifdeparture_code
is a city codetrips[].arrival_city
(optional,false
as default) - Settrue
ifarrival_code
is a city codeadults_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
infants_count
(optional, 0 as default) - Number of infants- Must be a number greater than or equal to 0 and smaller than or equal to 2
cabin
(optional,economy
as default) - Can beeconomy
,business
,first
user_country_code
andcountry_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
andcountry_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 purposessearch_id
(required) - Search id you get when the search is createdtrip_id
(required) - Trip id you get when the search is createdfares_query_type
(required) - Please keep it asroute
- Route is a unique combination of
segment_ids
, including both inbound and outbound. Segment id is thedesignator_code
(full flight number) that operate the segment.
- Route is a unique combination of
sort
(optional,price
as default) - Routes will be sorted by this attributeprice
means sort by best price of the routeduration
means sort by duration of the routeoutbound_departure_time
means sort by outbound departure time of the routeinbound_departure_time
means sort by inbound departure time of the route
order
(optional,asc
as default) - Sorting order, can beasc
,desc
page
(optional, 1 as default) - Results page, must be a number <= 100per_page
(optional, 10 as default) - Results per page, must be a number <= 30currency_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 inUSD
- Use this to get fares with price greater than a number
price_max_usd
(optional) - Price max inUSD
- 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 inboundone
means maximun one stop in either outbound or inboundtwo_plus
means maximum 2 or more stops in either outbound or inbound
- Use this to get fares match certain stop types, a stop type can be
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
, ifstopover_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
, ifduration_min
is specified
departure_day_time_filter_type
(optional) - Special attribute, please keep it asseparate
so that you can getoutbound_departure_day_time_filter
andinbound_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 valueseparate
)
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
, ifoutbound_departure_day_time_min
is specified - Use it along with the parameter
departure_day_time_filter_type
(you need to set valueseparate
)
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 valueseparate
)
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
, ifinbound_departure_day_time_min
is specified - Use it along with the parameter
departure_day_time_filter_type
(you need to set valueseparate
)>
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", "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 bysort
andorder
provided in the fares requestroutes[].id
- Id of the route, a combination of both outbound and inbound segment idsroutes[].fares
- Array of fares belong to this route sorted byprice
routes[].fares.price
- Price of the fareroutes[].fares.description
- Description of the fareroutes[].fares.deeplink
- Deeplink of the fare, use this url to send users to booking page, read more about handoff pageroutes[].fares.provider_code
- Provider that provides the fareroutes[].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
- All Best fare attributes are the same with ones in
routes[].outbound_segments
- Array of outbound segments of the routeroutes[].outbound_segments[].airline_code
- Airline code of the segmentroutes[].outbound_segments[].designator_code
- Designator code (full flight number) of the segmentroutes[].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 segmentroutes[].outbound_segments[].departure_name
- Departure name of the segmentroutes[].outbound_segments[].departure_time
- Departure time of the segmentroutes[].outbound_segments[].arrival_code
- Arrival code of the segmentroutes[].outbound_segments[].arrival_name
- Arrival name of the segmentroutes[].outbound_segments[].arrival_time
- Arrival time of the segmentroutes[].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 purposesfares_query_type
- The samefares_query_type
from fares query, used for debugging purposescurrency
- Currency information based oncurrency_code
set in from the query- All
price
,price_min
are incurrency.code
, otherwise specified
- All
price_filter
- Minmum and maximum prices of all filtered fares inUSD
and incurrency_code
incurrency
duration_filter
- Minimum and maximum durations in minutes of all filtered faresstopover_duration_filter
- Minmum and maximum stopover durations in minutes of all filtered faresoutbound_departure_day_time_filter
- Minmum and maximum outbound departure day times in minutes of all filtered faresinbound_departure_day_time_filter
- Minmum and maximum inbound departure day times in minutes of all filtered faresstop_type_filters
- Array of stop types of all filtered fares- Maximun 3 items
none
,one
,two_plus
- Maximun 3 items
provider_filters
- Array of providers of all filtered fares, sort byname
airline_filters
- Array of airlines of all filtered fares, sorted byname
departure_airport_filters
- Array of departure airports of all filtered fares, sorted byname
arrival_airport_filters
- Array of arrival airports of all filtered fares, sorted byname
stopover_airport_filters
- Array of stopover airports of all considerted fares, sorted byname
routes_count
- Total number of routes for this pair ofsearch_id
andtrip_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", "symbol":"US$", "exchange_rate":1.0 }, { "code":"SGD", "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 searchtrip_id
- Trip id got when you created the searchfare_id
- Fare id of the fare you want to deeplinkroute
- A combination offare.departure_airport_code
andfare.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 servicerequests
(at least 1 element) - Lists of requests you need to make in order to get to booking pagerequests[].url
- URL of the request, including query parametersrequests[].delay
- Delay in millisecond before you should trigger the requestrequests[].method
- Method to trigger the request, either POST or GETrequests[].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://0.omg.io/wego/image/upload/c_fit,w_200,h_70/flights/airlines_rectangular/{airline_code}.png
e.g. for Singapore Air - http://0.omg.io/wego/image/upload/c_fit,w_200,h_70/flights/airlines_rectangular/SQ.png
Provider logos
http://0.omg.io/wego/image/upload/c_fit,w_200,h_70/providers/rectangular_logos/{provider_id}.png
e.g. for cleartrip.com - http://0.omg.io/wego/image/upload/c_fit,w_200,h_70/providers/rectangular_logos/cleartrip.com.png
Locations
For information about the list of airlines, airports, locations, IATA codes, you may visit the links below:
- IATA official site: http://www.iata.org/about/members/Pages/airline-list.aspx?All=true
- Airport codes: https://www.world-airport-codes.com
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
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",
"search_id": "T5dJTxtxQv-uQ6OuYtaWkw",
"trip_id": "SYD:LON:2014-05-24:2014-05-29",
"fares_query_type": "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
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?
Hi Matt,
Can you provide an example of the use case for route_ids[] filter? )
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.
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",
"search_id": "sHAniJQ_RX-chq4GguNInw",
"trip_id": "IKA:ORY:2014-05-12:2014-05-15",
"fares_query_type": "route",
"departure_day_time_filter_type": "separate",
"designator_codes": ["PC513", "PC513", "PC402", "PC402"],
"outbound_departure_day_time_min": 265,
"outbound_departure_day_time_max": 265,
"inbound_departure_day_time_min": 845,
"inbound_departure_day_time_max": 845
}
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
Hi Itamar,
The "+/- 3 days Matrix" available on wego.com only, but we'll add this functionality to the API in future.
Hi Natalya
Is price per adult or it is the total price for adults and children?
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.
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
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).
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
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#api_locations_search
Or alternatively you can download the list of hotel locations here: https://www.dropbox.com/s/47ml7jyun1zywka/locations.csv.
Hi,
Is it possible to select multiple cities? like
1- From - To
2 From - To
3 From - To
Hi @Muhammad,
The API doesn't support multiple cities search, you can search for fares from City X to City Y only.
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?
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.
Hi Natalya,
i will download it. but if in future Wego change/upgrade locations etc then we have to download again?
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.
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.
Hi Justin,
I've just performed a search with the following parameters:
{
"trips": [
{
"departure_code": "YYZ",
"arrival_code": "YUL",
"outbound_date": "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?
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.
Hi Justin,
You have to pass parameters "user_country_code" and "country_site_code" 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": [
{
"departure_code": "RGN",
"arrival_code": "NYU",
"outbound_date": "2014-10-04"
}
],
"adults_count": 1,
"user_country_code": "SG",
"country_site_code": "SG"
}
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?
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.
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?api_key=API_KEY&ts_code=TS_CODE
{"trips":[{"departure_code":"SYD","arrival_code":"LON","outbound_date":"2014-12-12","inbound_date":"2014-12-12"}],"adults_count":"2","children_count":1,"cabin":"economy","user_country_code":"GB","country_site_code":"GB"}
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.
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.... :)
Hi Snehal, I've updated the information: http://support.wan.travel/hc/en-us/articles/200191669#locations