latestOpenAPI 3.1.02026-08-21211181.8 KB

e5d7af502419

Flights

Create a flight search

Creates a metasearch for the given route/dates/passengers and returns its searchId. Results accrue asynchronously – poll getFlightSearchResults with the returned searchId to read ranked trips.

post/v1/flights/searches

Request body

fromstring required

Origin airport or city IATA code, e.g. DXB.

tostring required

Destination airport or city IATA code, e.g. LHR.

fromDatestring required

Outbound departure date, YYYY-MM-DD. Not in the past, within a year.

toDatestring

Return date, YYYY-MM-DD. Omit for a one-way search.

cabin'economy' | 'premium_economy' | 'business' | 'first'

Cabin class requested for all passengers.

adultsinteger

Adult passengers (1-9). Defaults to 1. Note the hotel search defaults adults to 2, since a room sleeps two.

childreninteger

Child passengers (0-8). Defaults to 0.

infantsinteger

Infant passengers (0-8). Must not exceed adults. Defaults to 0.

currencystring

Pricing currency as a 3-letter ISO 4217 code. Defaults to USD.

localestring

Response language tag (e.g. en, ar). Defaults to en.

siteCodestring

Wego market (point of sale) as a 2-letter code, e.g. AE. Optional: if omitted the API defaults to US. A client that knows the user's market (the wego CLI derives it from the id_token) passes it as an explicit siteCode; the response always reports the siteCode used.

Example request

{
  "from": "DXB",
  "to": "LHR"
}

Response

Search created.

searchIdstring required

The id of the created search; pass it to the results and trip reads.

siteCodestring required

The site code (Wego market) the search was created for.

siteCodeSource'explicit' | 'default' required

How the API resolved siteCode: explicit (caller-supplied – including a market a client derived and passed) or default (US, no site supplied).