Hotel search API
- Requirements for Hotels API access
- Description search API of hotels
- Search management
- Queries errors
Requirements for Hotels API access
- Each search query must be initiated by the user and the results must be shown to the user in full. The results for each query must contain a “buy” button next to each flight option.
- The conversion rate for searches via the Buy link must be 9% or more. The conversion rate from the Buy button to actual purchases must be at least 5%.
- We'll also need to see the URL of your project, your design prototypes, a description of your project and how our API will be used.
Description hotels search API
With hotels API, a partner can create his or her own search of hotels. Access to the hotel search API is free, limited, and available on an individual basis on request from the partner.
To access the search API hotels, submit your request to firstname.lastname@example.org with the following information:
- URL of your website.
- Design prototypes of search result and hotel's page.
- How you will use the search API?
- Why aren’t the standard methods of integration (search forms, White Label, API access to data) suitable for you?
Attention, please! Data about Booking.com is missing in the API of hotels. The reason for this is the policy of the company to work through the API and White Label.
Search by hotel IATA-code or cityId (ID location), or hotelId (ID hotel). All options or just one can be specified. If you specify hotelId and cityId, only hotelId will be used. If you specify iata and cityId, iata will be used.
When using this search, it is possible to access its results not immediately, but after a period of time not exceeding 15 minutes. Handling is on the request ID searchId.
Attention! The default number of requests is limited to 200 requests per hour for one IP address. If you need to process more requests, send a note to email@example.com.
Required parameters are highlighted in bold.
- cityId – the location ID (the query static/locations.json).
- hotelId – the hotel ID (the query static/hotels.json).
- iata – iata code of city.
Note. The request must have at least one of the required parameters iata, cityId or hotelId.
- checkIn – check-in date format: yyyy–MM–dd.
- checkOut – check-out date format: yyyy–MM–dd.
- adultsCount – number of adults.
- customerIP – IP of the user who initiated the request.
- childrenCount – the number of children; possible values - from 0 to 3. Default - 0.
- childAge1, childAge2, childAge3 – ages of children (if childrenCount greater than 0). The default age is 1 year (max = 17).
- lang – the language of the search result. Stated together with the region.
- currency – USD, RUB, EUR, ...
- waitForResult – wait for the completion of all searches for partners, possible values 0 or 1.
- 1 – the connection is open before all the data from the partners. The result is returned to the user query and its searchId.
- 0 – the connection will be terminated immediately and returned to the user searchId (default).
where signature is md5 of string: "YourToken:YourMarker:adultsCount:checkIn:checkOut:childAge1:childrenCount:currency:customerIP:iata:lang:waitForResult". More information about signatures is available here.
- searchId – search Id.
- limit – maximum number of hotels, from 0 to infinity, where 0 - no limit. Default - 0.
- offset – to skip a number of hotels from 0 to infinity, where 0 - no hotel not passed. Default - 0.
- sortBy – how to sort:
- popularity - by popularity;
- price - by price;
- name - by name;
- guestScore – by User Rating;
- stars – by number of stars
Default – popularity
- sortAsc – how to sort the values
- 1 – ascending;
- 0 – descending.
Default – 1.
- roomsCount – the maximum number of rooms that are returned in each hotel, from 0 to infinity, where 0 - no limit. Default – 0.
where signature is md5 of string: "YourToken:YourMarker:limit:offset:roomsCount:searchId:sortAsc:sortBy".
When you are trying to get a search result, at the end of search you get the error "errorCode 5". This means the results are not yet ready. The search is not interrupted; you should repeat the request later.
"address":"23/8 Soi Hub-Aik, Phuket Road, Muang District",
"name":"Rome Place Hotel",
"desc":"Double or Twin STANDARD",
Block "result" contains:
- fullUrl - the link to the hotel's page with partner's marker;
- maxPrice – the highest price of the hotel rooms;
- maxPricePerNight - the maximum price per night;
- price – the average price per room;
- minPriceTotal - the minimum cost per stay;
- photoCount - the number of photos of the hotel;
- guestScore - the travelers' rating;
- id – the ID of hotel in the database;
- name – hotel's name;
- address – the hotel's address;
- distance - the distance from the hotel to the city center;
- amenities - amenities at the hotel;
- location – the hotel's location:
- lat – latitude of hotel;
- lon – longitude of hotel.
- stars – the number of stars the hotel;
- url – the link to the hotel website.
Block "rooms" contains:
- type, desc – the type of rooms;
- total – the rate for all time;
- price – the daily room rate;
- tax – taxes and fees;
- options – additional services:
- breakfast - whether breakfast included in the rate or not;
- available - the number of available rooms of this type;
- deposit - payment directly on the site, if it is 0 - then pay at the hotel;
- refundable - "free cancellation";
- cardRequired - without reservation card, if 0 - you can book without card and then pay at partners;
- smoking - can smoke in the room;
- freeWifi - whether there is free wifi in the room;
- hotelWebsite - proposal leads to the official hotel website.
- bookingURL – the link to the booking website;
- fullBookingURL - complete link to book with filled all data about users (date of check In and check out, number of adults and childrens, currency and ets);
- internalTypeId - grouping by type of rooms;
- agencyId – the id of booking agencies;
- agencyName – the name of the booking agencies;
- rating - the ranking of visitors. The parameters are calculated based on guest rating, which is compiled on the basis of a vote.
You can get photos and other information about hotel with help of Hotel Data API.
Attention! The reference to the agency's website must be received only when the user clicks the "Buy" button. Automatic collection of all links from the answer is prohibited. Violation of this rule will disable the API search for the partner.
All input parameters are checked and errors are shown if they are wrong:
- errorCode 1 – not all required parameters are filled.
- errorCode 2 – at least one of the parameters does not match the format.
- errorCode 3 – access denied.
- errorCode 4 – the search is not over yet.
Was this article helpful?
Have more questions? Submit a request