{"openapi":"3.2.0","info":{"title":"Hotels Search API","version":"1.0.0","description":"Hotels with prices for a place and a stay, each with booking links that open the same hotel, dates and guests on travel sites. The API only searches: it never holds or books. Guides: https://docs.voyagelabs.ai/hotels"},"servers":[{"url":"https://api.voyagelabs.ai"}],"paths":{"/v1/hotels/search":{"get":{"operationId":"searchHotels","summary":"Hotels for a place and a stay, one price each","security":[{"apiKey":[]}],"parameters":[{"name":"city","in":"query","schema":{"type":"string"},"description":"A city by name. With country."},{"name":"country","in":"query","schema":{"type":"string"},"description":"The city's 2-letter country code."},{"name":"latitude","in":"query","schema":{"type":"number"},"description":"A point. With longitude."},{"name":"longitude","in":"query","schema":{"type":"number"},"description":"With latitude."},{"name":"radius_km","in":"query","schema":{"type":"number","minimum":0.2,"maximum":50,"default":5},"description":"How far around the point to look."},{"name":"place_id","in":"query","schema":{"type":"string"},"description":"A Google place id, such as ChIJIQBpAG2ahYAR_6128GcTUEo."},{"name":"hotel_ids","in":"query","schema":{"type":"string"},"description":"Up to 200 hotel ids from earlier answers, comma-separated."},{"name":"check_in","in":"query","required":true,"schema":{"type":"string","format":"date"},"description":"First night, YYYY-MM-DD. Not before yesterday, at most 500 days ahead."},{"name":"check_out","in":"query","required":true,"schema":{"type":"string","format":"date"},"description":"Departure day, YYYY-MM-DD. 1 to 30 nights after check_in."},{"name":"adults","in":"query","schema":{"type":"integer","minimum":1,"maximum":8,"default":2},"description":"Adults in the one room. Use rooms for more than one room."},{"name":"child_ages","in":"query","schema":{"type":"string"},"description":"Each child's age in the one room, comma-separated, such as 7,4."},{"name":"rooms","in":"query","schema":{"type":"string"},"description":"More than one room: a JSON list such as [{\"adults\":2,\"child_ages\":[7]},{\"adults\":1}]. Not with adults or child_ages."},{"name":"currency","in":"query","schema":{"type":"string","default":"USD"},"description":"3-letter currency of the prices."},{"name":"nationality","in":"query","schema":{"type":"string","default":"US"},"description":"The guests' 2-letter country code. Some rates depend on it."},{"name":"sort","in":"query","schema":{"type":"string","enum":["price","rating"],"default":"price"},"description":"The order of the hotels: cheapest first, or best rated first."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Hotels in this response."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"The next_cursor of the previous page."},{"name":"response_mode","in":"query","schema":{"type":"string","enum":["complete","partial"],"default":"complete"},"description":"complete waits for the supplier. partial answers at once; read the rest by search_id."},{"name":"wait_ms","in":"query","schema":{"type":"integer","minimum":0,"maximum":30000},"description":"Exactly how long to wait for a running search."},{"name":"max_age_s","in":"query","schema":{"type":"integer","minimum":0,"maximum":86400},"description":"The oldest stored answer to accept, in seconds. 0 forces a new search. A stored answer is never reused past 900 seconds, so a larger value is read as 900."}],"responses":{"200":{"description":"The page asked for. status is running while the supplier has not answered.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"RateLimit-Limit":{"schema":{"type":"string"}},"RateLimit-Remaining":{"schema":{"type":"string"}},"RateLimit-Reset":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/SearchData"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"The request cannot be read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"401":{"description":"No key, or one nobody issued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"403":{"description":"The key may not do this, or not from this network.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"429":{"description":"Over a limit. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"502":{"description":"The supplier failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"503":{"description":"Temporarily unavailable. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"504":{"description":"The supplier took too long.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}}},"post":{"operationId":"searchHotelsByBody","summary":"The same search, with its fields in a JSON body","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}}},"responses":{"200":{"description":"The page asked for.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"RateLimit-Limit":{"schema":{"type":"string"}},"RateLimit-Remaining":{"schema":{"type":"string"}},"RateLimit-Reset":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/SearchData"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"The request cannot be read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"401":{"description":"No key, or one nobody issued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"403":{"description":"The key may not do this, or not from this network.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"429":{"description":"Over a limit. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"502":{"description":"The supplier failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"503":{"description":"Temporarily unavailable. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"504":{"description":"The supplier took too long.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}}}},"/v1/hotels/search/{search_id}":{"get":{"operationId":"getHotelSearch","summary":"The same search again: wait for it, page it, sort it","description":"Never searches again and never counts as a new search. A search is kept for 24 hours.","security":[{"apiKey":[]}],"parameters":[{"name":"search_id","in":"path","required":true,"schema":{"type":"string"},"description":"A search_id from a search or rates answer."},{"name":"sort","in":"query","schema":{"type":"string","enum":["price","rating"],"default":"price"},"description":"The order of the hotels: cheapest first, or best rated first."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Hotels in this response."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"The next_cursor of the previous page."},{"name":"wait_ms","in":"query","schema":{"type":"integer","minimum":0,"maximum":30000},"description":"Exactly how long to wait for a running search."}],"responses":{"200":{"description":"The page asked for.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"RateLimit-Limit":{"schema":{"type":"string"}},"RateLimit-Remaining":{"schema":{"type":"string"}},"RateLimit-Reset":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/SearchData"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"The request cannot be read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"401":{"description":"No key, or one nobody issued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"403":{"description":"The key may not do this, or not from this network.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"404":{"description":"Nothing at this address, or no such search.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"429":{"description":"Over a limit. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"502":{"description":"The supplier failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"503":{"description":"Temporarily unavailable. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"504":{"description":"The supplier took too long.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}}}},"/v1/hotels/rates/{hotel_id}":{"get":{"operationId":"getHotelRates","summary":"One hotel's every room and rate for a stay","security":[{"apiKey":[]}],"parameters":[{"name":"hotel_id","in":"path","required":true,"schema":{"type":"string"},"description":"A hotel's id from a search, such as lp19b5e."},{"name":"check_in","in":"query","required":true,"schema":{"type":"string","format":"date"},"description":"First night, YYYY-MM-DD. Not before yesterday, at most 500 days ahead."},{"name":"check_out","in":"query","required":true,"schema":{"type":"string","format":"date"},"description":"Departure day, YYYY-MM-DD. 1 to 30 nights after check_in."},{"name":"adults","in":"query","schema":{"type":"integer","minimum":1,"maximum":8,"default":2},"description":"Adults in the one room. Use rooms for more than one room."},{"name":"child_ages","in":"query","schema":{"type":"string"},"description":"Each child's age in the one room, comma-separated, such as 7,4."},{"name":"rooms","in":"query","schema":{"type":"string"},"description":"More than one room: a JSON list such as [{\"adults\":2,\"child_ages\":[7]},{\"adults\":1}]. Not with adults or child_ages."},{"name":"currency","in":"query","schema":{"type":"string","default":"USD"},"description":"3-letter currency of the prices."},{"name":"nationality","in":"query","schema":{"type":"string","default":"US"},"description":"The guests' 2-letter country code. Some rates depend on it."},{"name":"response_mode","in":"query","schema":{"type":"string","enum":["complete","partial"],"default":"complete"},"description":"complete waits for the supplier. partial answers at once; read the rest by search_id."},{"name":"wait_ms","in":"query","schema":{"type":"integer","minimum":0,"maximum":30000},"description":"Exactly how long to wait for a running search."},{"name":"max_age_s","in":"query","schema":{"type":"integer","minimum":0,"maximum":86400},"description":"The oldest stored answer to accept, in seconds. 0 forces a new search. A stored answer is never reused past 900 seconds, so a larger value is read as 900."}],"responses":{"200":{"description":"The hotel with all its offers, cheapest first. hotels is empty when it has no rooms for the stay.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"RateLimit-Limit":{"schema":{"type":"string"}},"RateLimit-Remaining":{"schema":{"type":"string"}},"RateLimit-Reset":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/SearchData"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"400":{"description":"The request cannot be read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"401":{"description":"No key, or one nobody issued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"403":{"description":"The key may not do this, or not from this network.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"429":{"description":"Over a limit. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"502":{"description":"The supplier failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"503":{"description":"Temporarily unavailable. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"504":{"description":"The supplier took too long.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}}}},"/v1/hotels/usage":{"get":{"operationId":"getHotelUsage","summary":"The calling key's limits and use","security":[{"apiKey":[]}],"responses":{"200":{"description":"Limits, this minute, and today in UTC.","headers":{"X-Request-Id":{"schema":{"type":"string"}},"RateLimit-Limit":{"schema":{"type":"string"}},"RateLimit-Remaining":{"schema":{"type":"string"}},"RateLimit-Reset":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"$ref":"#/components/schemas/UsageData"},"meta":{"$ref":"#/components/schemas/Meta"}}}}}},"401":{"description":"No key, or one nobody issued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"403":{"description":"The key may not do this, or not from this network.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"429":{"description":"Over a limit. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}},"503":{"description":"Temporarily unavailable. Retry-After says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Failure"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"vl_live_... for live prices, vl_test_... for saved samples at no cost. Authorization: Bearer is also read."}},"schemas":{"Meta":{"type":"object","required":["request_id","mode"],"properties":{"request_id":{"type":"string"},"mode":{"type":"string","enum":["live","test"]}}},"Failure":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","retry","request_id"],"properties":{"code":{"type":"string","enum":["invalid_parameter","invalid_body","unauthenticated","forbidden","not_found","search_not_found","method_not_allowed","gone","rate_limited","supplier_error","search_capacity","service_unavailable","supplier_timeout","internal_error"]},"message":{"type":"string"},"param":{"type":"string","description":"The field at fault, on invalid_parameter."},"retry":{"type":"string","enum":["never","now","after"]},"retry_after_s":{"type":"integer"},"request_id":{"type":"string"}}}}},"Room":{"type":"object","required":["adults"],"properties":{"adults":{"type":"integer","minimum":1,"maximum":8},"child_ages":{"type":"array","items":{"type":"integer","minimum":0,"maximum":17}}}},"SearchRequest":{"type":"object","required":["check_in","check_out"],"description":"Say where in exactly one way: city and country, latitude and longitude, place_id, or hotel_ids.","properties":{"city":{"type":"string"},"country":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"radius_km":{"type":"number"},"place_id":{"type":"string"},"hotel_ids":{"type":"array","items":{"type":"string"},"maxItems":200},"check_in":{"type":"string","format":"date"},"check_out":{"type":"string","format":"date"},"rooms":{"type":"array","items":{"$ref":"#/components/schemas/Room"},"minItems":1},"adults":{"type":"integer"},"child_ages":{"type":"array","items":{"type":"integer"}},"currency":{"type":"string"},"nationality":{"type":"string"},"sort":{"type":"string","enum":["price","rating"]},"limit":{"type":"integer","minimum":1,"maximum":100},"cursor":{"type":"string"},"response_mode":{"type":"string","enum":["complete","partial"]},"wait_ms":{"type":"integer"},"max_age_s":{"type":"integer"}}},"Hotel":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"stars":{"type":["number","null"]},"rating":{"type":["number","null"],"description":"Guest rating out of 10."},"review_count":{"type":["integer","null"]},"address":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"photo":{"type":["string","null"]}}},"Offer":{"type":"object","required":["rooms","board","total","currency","per_night","refundable"],"properties":{"rooms":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"room_id":{"type":["integer","null"]},"adults":{"type":"integer"},"child_ages":{"type":"array","items":{"type":"integer"}}}}},"board_code":{"type":"string"},"board":{"type":"string","description":"Room Only, Breakfast Included, ..."},"total":{"type":"number","description":"The whole stay: every room, every night, taxes in."},"currency":{"type":"string"},"per_night":{"type":"number"},"taxes_included":{"type":["number","null"]},"due_at_property":{"type":"array","description":"Paid at the hotel, on top of total.","items":{"type":"object","properties":{"description":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"}}}},"refundable":{"type":"boolean"},"free_cancellation_until":{"type":["string","null"],"description":"The last moment to cancel at no charge, UTC."},"cancellation":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"charge":{"type":"object","properties":{"amount":{"type":"number"},"currency":{"type":"string"}}}}}}}},"BookingLink":{"type":"object","required":["site","name","url","lands_on","found_by","verified"],"properties":{"site":{"type":"string","enum":["hotels_com","booking_com","expedia","agoda","trip_com","google"]},"name":{"type":"string"},"url":{"type":"string","description":"An address on this service that sends the traveller on. Lasts 24 hours."},"lands_on":{"type":"string","enum":["property","pinned_results","search_results"]},"found_by":{"type":"string","enum":["id","name"],"description":"id: only this hotel can open. name: the site is searched by the hotel's name."},"verified":{"type":"boolean","description":"True when this kind of link was opened in a real browser and did what lands_on says."},"checked":{"type":["string","null"]},"note":{"type":["string","null"]}}},"SearchData":{"type":"object","required":["search_id","status","query","pricing","counts","next_cursor","hotels"],"properties":{"search_id":{"type":"string"},"status":{"type":"string","enum":["complete","running"]},"retry_after_ms":{"type":"integer","description":"While running: when to ask again."},"query":{"type":"object","description":"The stay as the service understood it, with nights."},"pricing":{"type":["object","null"],"properties":{"priced_at":{"type":"string","format":"date-time"},"age_s":{"type":"integer"}}},"counts":{"type":"object","properties":{"found":{"type":"integer"},"returned":{"type":"integer"}}},"next_cursor":{"type":["string","null"]},"hotels":{"type":"array","items":{"type":"object","required":["hotel","offers","booking_links"],"properties":{"hotel":{"$ref":"#/components/schemas/Hotel"},"offers":{"type":"array","items":{"$ref":"#/components/schemas/Offer"}},"booking_links":{"type":"array","items":{"$ref":"#/components/schemas/BookingLink"}}}}}}},"UsageData":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mode":{"type":"string"}}},"limits":{"type":"object","properties":{"requests_per_minute":{"type":"integer"},"new_searches_per_minute":{"type":"integer"},"search_reads_per_minute":{"type":["integer","null"],"description":"How often a search may be read again by its id. null when only requests_per_minute applies."}}},"this_minute":{"type":"object","properties":{"requests":{"type":"integer"},"new_searches":{"type":"integer"}}},"today":{"type":"object","properties":{"requests":{"type":"integer"},"answered_from_memory":{"type":"integer"},"new_searches":{"type":"integer"},"errors":{"type":"integer"}}}}}}}}