Hotels

有料
Verified
よって Api Dojo | 更新済み il y a un mois | Travel
人気

9.8 / 10

レイテンシー

2,315ms

サービスレベル

100%

Health Check

N/A

すべてのディスカッションに戻る

"sort": "PRICE_LOW_TO_HIGH" does not work correctly

Rapid account: Ancous
Ancous
il y a 5 mois

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 il y a 5 mois

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 il y a 5 mois

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 il y a 5 mois

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 il y a 5 mois

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 il y a 5 mois

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.

ディスカッションに参加しましょう-以下にコメントを追加してください:

ログイン/サインアップして新しいコメントを投稿