Skip to main content
Hotel AI search takes the traveler’s request as written, for example “find me an hotel for my wife birthday near the beach 1h away from San francisco driving next weekend”, and answers with the hotels that match and a reply to show. A place described by its distance from a city, like the beaches within an hour’s drive of San Francisco, is searched as the areas that fit. When something is missing, the answer asks for it. The traveler can then refine the search in the same conversation.
Hotel AI search is in preview. The API may change.
hotel_search can also rank by the traveler’s wording; see Search by intent.

The flow

  1. Send the sentence. One call with text and the traveler’s timezone.
  2. Answer questions. An input_required answer carries a question; send the traveler’s answer with the same context_id. See Conversations.
  3. Get the hotels. Most searches answer 200 within 20 seconds. A longer one answers 202; read the task until it ends, or stream it. See Waiting for results.
  4. Refine. “with a pool”, “make it Porto instead”, “show more”: each follow-up goes in the same conversation.
  5. Book. Add an offer’s trip_item_token to a trip and check out, as for any hotel.

Quickstart

Hotel AI search is served on production only, at https://api.gojinko.com, with a production API key; the sandbox does not serve it. The request is the traveler’s own words, as they typed them:
The search is still running after 20 seconds, so the call answers 202 with the task to read (Location, Retry-After: 2) and the early reply in message: Searching hotels in San Francisco for Oct 31 – Nov 1 (1 night, 2 adults, 1 room). Results are on the way. Read the task until status is no longer working:
The answer, with one hotel and one offer kept. “Next weekend” became October 31 to November 1, “my wife” two adults, and the beaches within an hour’s drive of San Francisco the areas searched:

The request

Optional headers: Prefer: wait=N to change the 20-second wait, Accept: text/event-stream to stream, and Idempotency-Key to retry safely. See Waiting for results.

The answer

What the search understands

Requests in English, French and Chinese are understood. message is always in English; translate it in your app if your traveler reads another language.

Book a result

A result is booked like any hotel offer: add its trip_item_token to a trip, add the travelers and contact, then check out.
total_amount is the price of the offer for the whole stay, in currency. Offers of a reference: true answer cover one night only. See Hotels for rooms, rates and cancellation terms, and Trips and checkout for the rest of the booking.

Next