Hotels

PAGO
Verified
Por Api Dojo | Atualizado a month ago | Travel
Popularidade

9.8 / 10

Latência

2,315ms

Nível de serviço

100%

Health Check

N/A

Voltar para todas as discussões

"sort": "PRICE_LOW_TO_HIGH" does not work correctly

Rapid account: Ancous
Ancous
5 months ago

request:

“sort”: “PRICE_LOW_TO_HIGH”,
“filters”: {
“price”: {
“max”: 300, <----------------- filters max
"min": 200 <----------------- filters min
}
}
}

response:

pinnedDetails:null
price:
__typename:“PropertyPrice”
options:
priceMessaging:null
lead:
__typename:“Money”
amount:2024.69 <==================== Why is that
currencyInfo:
formatted:"$2,025"

Why does it show the price not in the sorting range?

Is this your mistake or mine?

Rapid account: Apidojo
apidojo Commented 5 months ago

Hello,

Please check the screenshot https://prnt.sc/nfWlqLCdUyBh. I simply search for “priceRange” in the response, and there it is.
In addition, I believe you faked the response with the request OR the response and request are not related to each other. Your information is very useless to prove something.

Regards.

Rapid account: Ancous
Ancous Commented 5 months ago

Hello.

							My request:

url = “https://hotels4.p.rapidapi.com/properties/v2/list

payload = {
“currency”: “USD”,
“eapid”: 1,
“locale”: “en_US”,
“siteId”: 300000001,
“destination”: { “regionId”: “6054439” },
“checkInDate”: {
“day”: 20,
“month”: 12,
“year”: 2023
},
“checkOutDate”: {
“day”: 20,
“month”: 12,
“year”: 2023
},
“rooms”: [
{
“adults”: 2,
“children”: []
}
],
“resultsStartingIndex”: 0,
“resultsSize”: 200,
“sort”: “PRICE_LOW_TO_HIGH”,
“filters”: { “price”: {
“max”: 300, <----------------- filters max
“min”: 200 <----------------- filters min
} }
}
headers = {
“content-type”: “application/json”,
“X-RapidAPI-Key”: “???”,
“X-RapidAPI-Host”: “hotels4.p.rapidapi.com
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())

							My esponse:

data:propertySearch:
__typename:"PropertySearchResults"
filterMetadata:
universalSortAndFilter:
properties:0:
1:
2:
3:
4:
5:
6:
7:
8:
9:
__typename:"Property"
id:"45636831"
featuredMessages:
name:"Casa Blanca Villas"
availability:
propertyImage:
destinationInfo:
legalDisclaimer:null
listingFooter:null
mapMarker:
neighborhood:
offerBadge:
offerSummary:
pinnedDetails:null
price:
__typename:"PropertyPrice"
options:
priceMessaging:null
lead:
__typename:“Money"
amount:2024.69 <==================== value that does not fit the filter . A filter is made using this field?
currencyInfo:
formatted:”$2,025"
strikeOut:
displayMessages:
strikeOutType:"STANDALONE"
priceMessages:
priceAfterLoyaltyPointsApplied:
propertyFees:
reviews:
sponsoredListing:null
star:null
supportingMessages:null
regionId:"6054439"
priceMetadata:
saveTripItem:
propertySearchListings:
summary:
searchCriteria:
shoppingContext:
map:
clickstream

Rapid account: Apidojo
apidojo Commented 5 months ago

Did you paste the response in a text editor and search for the field? You should always send along with your request so I can reproduce it. Otherwise, I cannot help you.

Regards.

Rapid account: Ancous
Ancous Commented 5 months ago

Hello,

I get the answer in json. There is no such key

No “priceRange” field in response from endpoint “properties/v2/list”

Rapid account: Apidojo
apidojo Commented 5 months ago

Hello,

You need to use the price range returned in the response, custom price range is not supported. You are interested in “priceRange” field returned in the response.

Regards.

Junte-se à discussão - adicione o comentário abaixo:

Efetue login / inscreva-se para postar novos comentários