Skip to Content

Search flights (JSON body)

Search a trip, with the fields in a JSON body

POST
/v1/flights/search

Authorization

headerX-API-Key<token>

vl_live_… for live prices, vl_test_… for saved sample data. Older keys start fs_live_… and fs_test_…, and still work.

Request Body

application/json
  1. body

The fields of GET /v1/flights/search, as a JSON object of up to 16 KB. Name the trip either with origin, destination, depart_date and return_date, or with legs.

origin?string

3-letter airport code.

destination?string

3-letter airport code.

depart_date?string

YYYY-MM-DD.

Formatdate
return_date?string

YYYY-MM-DD.

Formatdate
legs?array<>

One entry per direction flown: one for one-way, two that return to the start for a round trip.

Items1 <= items <= 2
adults?integer

1 to 9.

Range1 <= value <= 9
Default1
children?integer

0 to 8.

Range0 <= value <= 8
Default0
infants?integer

0 to 4.

Range0 <= value <= 4
Default0
cabin?string

The cabin to search.

Default"economy"
Value in"economy""premium_economy""business""first"
currency?string

3-letter code.

Default"USD"
max_stops?integer

0 to 3.

Range0 <= value <= 3
airlines?string

2-character codes, comma separated.

sort?string

How to order results.

Default"best"
Value in"best""price""duration"
limit?integer

Results in this response.

Range1 <= value <= 50
Default10
cursor?string

The next_cursor of the previous page.

detail?string

How much of each result to send.

Default"summary"
Value in"summary""full"
fares?integer

Fares per result when detail is full.

Range1 <= value <= 10
Default3
wait_ms?integer

Answer with whatever has arrived by then, in milliseconds. Left out: 8000, as for the query parameter.

Range0 <= value <= 30000
max_age_s?integer

The oldest price the caller accepts.

Range0 <= value <= 86400
departure_date?string

YYYY-MM-DD (canonical alias for depart_date).

Formatdate
passengers?

Passenger counts (canonical partner object alternative to flat adults/children/infants).

response_mode?string

complete (default JSON), stream (SSE), or partial (fast return + poll).

Default"complete"
Value in"complete""stream""partial"

Response Body

The search, complete or partial.

  1. response
data*
meta*
curl -X POST 'https://api.voyagelabs.ai/v1/flights/search' \  -H 'X-API-Key: ' \  -H 'Content-Type: application/json' \  -d '{  "origin": "SFO",  "destination": "NRT",  "depart_date": "2027-02-09",  "return_date": "2027-02-16",  "adults": 2}'
Example Response
{  "data": {    "search_id": "srch_8f2c1d0e",    "status": "complete",    "query": {      "origin": "SFO",      "destination": "NRT",      "depart_date": "2027-02-09",      "return_date": "2027-02-16",      "adults": 2,      "children": 0,      "infants": 0,      "cabin": "economy",      "currency": "USD"    },    "pricing": {      "priced_at": "2026-12-02T00:20:11Z",      "age_s": 42,      "refreshing": false    },    "counts": {      "found": 6,      "matched": 6,      "returned": 1    },    "next_cursor": "c_eyJvIjoxfQ",    "airlines": [      {        "code": "ZG",        "name": "ZIPAIR",        "results": 1,        "from": 1445.02,        "best_link": "itinerary"      },      {        "code": "NH",        "name": "ANA",        "results": 1,        "from": 2823.38,        "best_link": "flights_selected"      }    ],    "results": [      {        "id": "it_U0ZPLk5SVC4yMDI3MDIwOS4yMDI3MDIxNi4yLjAuMC5ZLlVTRHxOSDcwMTNAMDIwOSxOSDhAMDIxNg",        "airlines": [          {            "code": "NH",            "name": "ANA"          }        ],        "price": {          "total": 2823.38,          "per_adult": 1411.69,          "currency": "USD"        },        "stops": 0,        "total_duration_min": 1240,        "slices": [          {            "direction": "outbound",            "origin": "SFO",            "destination": "NRT",            "depart": "2027-02-09T10:45:00",            "depart_utc": "2027-02-09T18:45:00Z",            "arrive": "2027-02-10T15:05:00",            "arrive_utc": "2027-02-10T06:05:00Z",            "duration_min": 680,            "stops": 0,            "flights": [              "NH7013"            ]          },          {            "direction": "return",            "origin": "NRT",            "destination": "SFO",            "depart": "2027-02-16T17:00:00",            "depart_utc": "2027-02-16T08:00:00Z",            "arrive": "2027-02-16T09:20:00",            "arrive_utc": "2027-02-16T17:20:00Z",            "duration_min": 560,            "stops": 0,            "flights": [              "NH8"            ]          }        ],        "fare": {          "family": "Eco I Basic 1N",          "cabins": [            "Economy"          ],          "refundable": false,          "changeable": false,          "carry_on_included": true,          "checked_bag_included": true,          "seats_left": 9        },        "link": {          "url": "https://flights.example/go?airline=NH&origin=SFO&destination=NRT&depart=2027-02-09&return=2027-02-16&adults=2&children=0&infants=0&cabin=economy&tansel=VjJ8Tkg3MDEz&exp=1796256000&sig=3q2-7w",          "opens": "airline",          "lands_on": "flights_selected",          "verified": true        },        "booking_links": {          "supplier": {            "url": null,            "available": false,            "lands_on": null          },          "airline": {            "url": "https://api.voyagelabs.ai/r/al_example_airline_token",            "available": true,            "lands_on": "flights_selected",            "airline": "NH"          },          "google_flights": {            "url": "https://api.voyagelabs.ai/r/al_example_google_flights_token",            "available": true,            "lands_on": "itinerary"          }        }      }    ]  },  "meta": {    "request_id": "req_41ab9c",    "mode": "live"  }}