How it differs from hotel search
hotel_search can also rank by the traveler’s wording; see Search by intent.
The flow
- Send the sentence. One call with
textand the traveler’stimezone. - Answer questions. An
input_requiredanswer carries a question; send the traveler’s answer with the samecontext_id. See Conversations. - Get the hotels. Most searches answer
200within 20 seconds. A longer one answers202; read the task until it ends, or stream it. See Waiting for results. - Refine. “with a pool”, “make it Porto instead”, “show more”: each follow-up goes in the same conversation.
- Book. Add an offer’s
trip_item_tokento a trip and check out, as for any hotel.
Quickstart
Hotel AI search is served on production only, athttps://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:
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 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 itstrip_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
- Conversations: questions, follow-ups, corrections and expiry.
- Waiting for results:
202, reading the task, streaming, cancel and retries. - Statuses and errors: every status, failure code and HTTP status.
- API reference:
POST /v1/hotel_ai_search.
