Conventions
Versions, request and response shapes, formats, paging and identifiers, shared by both APIs.
Both APIs follow the same rules, so code you write for one carries over to the other.
Versions
The version is in the path: https://api.voyagelabs.ai/v1/....
- Within
v1, fields are only ever added. Your code must ignore fields it doesn't know. - A field or endpoint is never removed, or changed in meaning, within
v1. A change like that meansv2.v1keeps running beside it, and its answers carry aSunsetheader once an end date is set. - New error codes can be added within
v1. Handle unknown codes by theirretryadvice.
Requests
- Send the key in the
X-API-Keyheader. See Keys and authentication. - Search endpoints take either query parameters (
GET) or a JSON body (POST) withContent-Type: application/json. A body may be up to 16 KB. - Everything is UTF-8.
Responses
Every JSON answer is one of two shapes. A response has data or error, never both.
{
"data": { },
"meta": { "request_id": "req_41ab9c", "mode": "live" }
}{
"error": {
"code": "search_not_found",
"message": "No search with that id. Searches are kept for at least 30 minutes; run the search again.",
"retry": "never",
"request_id": "req_41ab9c"
}
}meta.request_idnames the request, and is also in theX-Request-Idheader.meta.modeisliveortest, after the key that made the call.- Finding nothing is a success, with an empty list.
- Errors lists every
code.
Formats
| Kind | Format | Example |
|---|---|---|
| Dates | YYYY-MM-DD | 2027-02-09 |
| Moments | ISO 8601 in UTC, ending Z | 2026-12-02T00:20:11Z |
| Flight times | Local time at the airport, with no offset. A _utc twin gives the same moment in UTC. | "depart": "2027-02-09T10:45:00", "depart_utc": "2027-02-09T18:45:00Z" |
| Money | A number in the currency's main unit, beside a 3-letter currency code | "total": 2823.38, "currency": "USD" |
| Durations | Whole units, named in the field | duration_min, age_s, retry_after_s |
| Airports | 3-letter IATA codes | SFO |
| Airlines | 2-character codes | NH |
| Countries | 2-letter ISO codes | US |
Identifiers
Ids such as search_id, result ids and request_id are opaque strings. Store them and pass them back as they are. Never parse them, build them or rely on their length.
Paging
Lists come one page at a time:
- Ask for a page size with
limit. - If the answer's
next_cursoris notnull, pass it back ascursorto get the next page. - When
next_cursorisnull, you have the whole list.
Page a search once it has finished. While a search is still running, the list can change between pages.
Prices have an age
Every search answer says when its prices were found, in pricing.priced_at, and how many seconds ago that was, in pricing.age_s. Prices go stale as rooms and seats sell. Search again before you show a price once age_s is over 240 for flights, or over 900 for hotels.
Browsers and CORS
The APIs answer requests from any web origin. Calls with a live key still belong on your server, because a key in a web page is public. See Keep live keys on your server.