Skip to Content

Quickstart

Get a test key, search a trip, and read the answer. Then switch to a live key without changing your code.

This walkthrough uses a test key, which answers from saved sample data. It costs nothing, and you can run it as often as you like.

Get a key

Sign in to the console and open Keys. Create a test key and copy it. The console shows a key only once.

Keep it in an environment variable rather than in your code:

Terminal
export VOYAGE_LABS_API_KEY="vl_test_..."

Search a trip

Ask for San Francisco to Tokyo Narita, out on 9 February 2027 and back a week later. That is the trip the test data holds. A test key returns it whatever you ask for.

curl -G https://api.voyagelabs.ai/v1/flights/search \
  -H "X-API-Key: $VOYAGE_LABS_API_KEY" \
  -d origin=SFO \
  -d destination=NRT \
  -d depart_date=2027-02-09 \
  -d return_date=2027-02-16 \
  -d adults=2

Read the answer

A successful answer has data and meta. This is the test key's answer, cut to one result and the fields you need first. Each result also has its slices (the flights, with times) and its fare.

Response (one result, link tokens shortened)
{
  "data": {
    "search_id": "srch_17a3c431-779c-4a88-9ebf-5f4b1eee0736",
    "status": "complete",
    "pricing": { "priced_at": "2026-12-06T20:46:06.727Z", "age_s": 0, "refreshing": false },
    "counts": { "found": 6, "matched": 6, "returned": 1 },
    "results": [
      {
        "id": "it_U0ZPLk5SVC4yMDI3MDIwOS4yMDI3MDIxNi4yLjAuMC5ZLlVTRHxaRzI1QDAyMDksWkcyNkAwMjE2",
        "airlines": [{ "code": "ZG", "name": "ZIPAIR" }],
        "price": { "total": 1445.02, "per_adult": 722.51, "currency": "USD" },
        "stops": 0,
        "total_duration_min": 1230,
        "booking_links": {
          "supplier": { "url": null, "available": false, "lands_on": null },
          "airline": {
            "url": "https://api.voyagelabs.ai/r/al_sE0Iy5Op1BXDrG9I…",
            "available": true,
            "lands_on": "booking_page",
            "airline": "ZG"
          },
          "google_flights": {
            "url": "https://api.voyagelabs.ai/r/al_-v1RAtbiIi6v3Etm…",
            "available": true,
            "lands_on": "itinerary"
          }
        }
      }
    ]
  },
  "meta": { "request_id": "req_4252794c71f0", "mode": "test" }
}
  • status is complete when the search has finished. It is partial while results are still arriving. Read a search shows how to collect the rest.
  • price.total is for all the travellers, in price.currency.
  • pricing.age_s says how old the prices are. Over 240 seconds, search again before you show a price or a link.
  • booking_links holds the links to show. Use a link only when its available is true, and show its url as it is. See Send travellers to book.
  • meta.mode is test here, because the key is a test key.

Go live

Create a live key in the console and put it in VOYAGE_LABS_API_KEY. The code stays the same. Live keys search real prices, and the trip you ask for is the trip you get.

Before you go live, handle the errors your code can meet, and check your limits.

Search hotels instead

The Hotels Search API works the same way. A test key returns the same San Francisco hotels whatever you ask for.

curl -G https://api.voyagelabs.ai/v1/hotels/search \
  -H "X-API-Key: $VOYAGE_LABS_API_KEY" \
  --data-urlencode "city=San Francisco" \
  -d country=US \
  -d check_in=2027-02-09 \
  -d check_out=2027-02-12 \
  -d adults=2

Search hotels explains the request and the answer.

Next

On this page