POST /v1/flights/searches
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.
Operation ID: createFlightSearch
Request body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
from |
string | yes | |
to |
string | yes | |
fromDate |
string | yes | |
toDate |
string | no | |
cabin |
economy | premium_economy | business | first |
no | |
adults |
integer | no | |
children |
integer | no | |
infants |
integer | no | |
currency |
string | no | |
locale |
string | no | |
siteCode |
string | no | 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. |
Responses
| Status | Description |
|---|---|
201 |
Search created. |
400 |
Invalid request body/query/path parameters. |
401 |
Missing or invalid bearer token. |
429 |
Rate limit exceeded; retry after the Retry-After seconds. |
502 |
The upstream flights service returned an invalid response. |
503 |
The flights service is temporarily unavailable; retry after the Retry-After seconds. |
Example
curl -s -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"from":"string","to":"string","fromDate":"string"}' \
"https://api.wego.com/v1/flights/searches"