Booking.com

FREEMIUM
By Things4u | Updated a month ago | Travel
Popularity

9.3 / 10

Latency

3,386ms

Service Level

100%

Health Check

N/A

Back to All Discussions

How to get the price for a hotel room

Rapid account: Faisal Shakeel
FaisalShakeel
9 months ago
For the endpoint : stays/properties/list

How can I get the price for a room for each hotel based on the checkin and checkout date and number of rooms and adults.

accommodationTypeId has an ID in it, how can i fetch the corresponding value for this id and get different accomodation type options

Rapid account: Ntd 119
ntd119 Commented 9 months ago

Hi,

I have just updated the stays/properties/list endpoint.
You can use it now, and if any errors occur, please let me know.

Thanks

Rapid account: Ntd 119
ntd119 Commented 9 months ago

Hi

  1. For the price, you can find it at data->listings[index]->priceDisplayInfoIrene->displayPrice->amountPerStay->amountRounded (this is the displayed price on the booking.com website). Additionally, there’s the ‘currency’ which indicates the currency unit.

  2. To retrieve ‘accommodationTypeId,’ you can follow these steps:
    After you make the initial call to the stays/properties/list endpoint, it will return data->filters. You search for the category ‘hoteltype’ within it. Under ‘options,’ you’ll find values; you take the ‘urlId’ value and set it as 'filter_by.'
    For example, if you want to search for a hotel type = Entire homes & apartments with a ‘urlId’ of privacy_type=3, then in the stays/properties/list endpoint, you set ‘filter_by’ to privacy_type=3.
    It seems a bit complex; I will customize the stays/properties/list endpoint to make it more user-friendly.

Thanks.

Join in the discussion - add comment below:

Login / Signup to post new comments