Booking COM

फ्रीमियम
द्वारा Things4u | अपडेट किया गया vor 4 Tagen | Travel
लोकप्रियता

9.5 / 10

लेटेंसी

1,945ms

सेवा का स्तर

100%

Health Check

100%

सभी चर्चाओं पर वापस जाएं

Empty data array in the response for the second page.

Rapid account: Yakimchyknadzeya
yakimchyknadzeya
vor 19 Tagen

Sometimes the data array in the response is empty for this request. You should try to send the request below multiple times to catch the issue.

import requests

url = "https://booking-com18.p.rapidapi.com/stays/search"

querystring = {"locationId":"eyJjaXR5X25hbWUiOiJNYW50b3ZhIiwiY291bnRyeSI6Ikl0YWx5IiwiZGVzdF9pZCI6Ii0xMjA5NjUiLCJkZXN0X3R5cGUiOiJjaXR5In0=","checkinDate":"2024-06-11","checkoutDate":"2024-06-12","page":"2","sortBy":"price","categoriesFilter":"reviewscorebuckets::70","units":"metric","temperature":"c"}

headers = {
	"x-rapidapi-key": "f34578ded4msh1963ff77f59b6c6p1e40d8jsn040e34f560be",
	"x-rapidapi-host": "booking-com18.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())

data:
meta:
currentPage:2
limit:20
status:true
message:"Successful"
Rapid account: Ntd 119
ntd119 Commented vor 18 Tagen

The second page looks better but I do not always have 20 results on the first page (sometimes it is 19), though the total number of results is 23.

import requests

url = "https://booking-com18.p.rapidapi.com/stays/search"

querystring = {"locationId":"eyJjaXR5X25hbWUiOiJNYW50b3ZhIiwiY291bnRyeSI6Ikl0YWx5IiwiZGVzdF9pZCI6Ii0xMjA5NjUiLCJkZXN0X3R5cGUiOiJjaXR5In0=","checkinDate":"2024-06-11","checkoutDate":"2024-06-12","page":"1","sortBy":"price","adults":"2","units":"metric","temperature":"c"}

headers = {
	"x-rapidapi-key": "f34578ded4msh1963ff77f59b6c6p1e40d8jsn040e34f560be",
	"x-rapidapi-host": "booking-com18.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())

Hi,

I have checked a few cases,
and this issue occurs on the Booking API side.
Therefore, we cannot fix it.

Thanks.

Rapid account: Yakimchyknadzeya
yakimchyknadzeya Commented vor 19 Tagen

The second page looks better but I do not always have 20 results on the first page (sometimes it is 19), though the total number of results is 23.

import requests

url = "https://booking-com18.p.rapidapi.com/stays/search"

querystring = {"locationId":"eyJjaXR5X25hbWUiOiJNYW50b3ZhIiwiY291bnRyeSI6Ikl0YWx5IiwiZGVzdF9pZCI6Ii0xMjA5NjUiLCJkZXN0X3R5cGUiOiJjaXR5In0=","checkinDate":"2024-06-11","checkoutDate":"2024-06-12","page":"1","sortBy":"price","adults":"2","units":"metric","temperature":"c"}

headers = {
	"x-rapidapi-key": "f34578ded4msh1963ff77f59b6c6p1e40d8jsn040e34f560be",
	"x-rapidapi-host": "booking-com18.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
Rapid account: Ntd 119
ntd119 Commented vor 19 Tagen

Hi,

I have just fixed it,
You can check now.

Thanks.

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें