搜尋與篩選
輕鬆搜尋並篩選 Rapid Content API 的回應,以獲得更精準的結果。
您可以使用 Rapid Content API 的搜尋與篩選功能,來控制在回應中接收哪些旅宿資訊。這使您能夠精簡接收的資料,並僅取得旅客所需 的信息,從而降低成本並提升靈活性。
搜尋
請使用搜尋功能,尋找提供特定設施或服務給客人的住宿,例如具備進階永續發展特色的住宿。
您可以根據 property-level 中的各項元素進行搜尋,包括:
category_id: 分類all_inclusive:All-inclusive 狀態attribute_id: 屬性amenity_id: 旅宿級別的設施spoken_language_id: 使用的語言
備註:此功能不包括特定的客房或房價計畫元素。
請求範例 1
在此範例中,我們使用搜尋參數 ``amenity_id 來限制回傳的物件。
curl -X GET "https://test.ean.com/v3/properties/content\
?language=en-US\
&supply_source=expedia\
&amenity_id=115\
&include=property_id\
&property_id=1337\
&property_id=1" \
-H "accept: application/json, application/json"\
-H "accept-encoding: gzip"\
-H "authorization: EAN apikey=abcd1234,signature=090a77e7ddd7779980231,timestamp=1697664047"\
-H "user-agent: TravelNow/3.30.112"回應範例 1
從這則回應中可以看出,系統僅回傳旅宿 1337,因為旅宿 1 沒有可用設施 ID 115 。
{
"1337": {
"property_id": "1337"
}
}可用的屬性、設施、使用語言及類別之完整清單,請參閱內容參考清單。
篩選
您可以僅請求所需的 top-level 區段,藉此取得部分回應內容,而無需接收完整的旅宿詳細資訊。請使用include 參數來指定您想要的區段。結果將包含property_id,以及根據旅宿所請求的各區段。
可供篩選的區段
您可以在 Rapid API 上根據超過 200 項參數進行篩選,包括 top-level 及其子欄位。此清單按字母順序列出目前可用的「top-level」專區。無論是「top-level」欄位及其子欄位,皆可透過 API 進行篩選;未來「top-level」中的各區段也將支援篩選功能。
addressairportsall_inclusiveamenitiesattributesbrandbusiness_modelcatalogcategorychaincheckincheckoutdescriptionsfaxfeesimageslocationmulti_unitnameonsite_paymentspayment_registration_recommendedphonepoliciesproperty_idproperty_idsrankratesratingsregistry_numberroomsspoken_languagesstatisticssupply_sourcetax_idthemesvacation_rental_details
請求範例 2
在此範例中,我們在name 參數中使用了amenities 和include 這兩組值。
curl -X GET "https://test.ean.com/v3/properties/content\
?language=en-US\
&supply_source=expedia\
&include=name\
&include=amenities\
&property_id=1337" \
-H "accept: application/json, application/json"\
-H "accept-encoding: gzip"\
-H "authorization: EAN apikey=abcd1234,signature=090a77e7ddd7779980231,timestamp=1697664047"\
-H "user-agent: TravelNow/3.30.112"回應範例 2
此範例顯示,回應中包含了property_id、name 以及amenities。注意:回應中總是會包含 property_id` `;除非您只想取得這個欄位,否則無需將其指定為 include 參數。
{
"1337": {
"property_id": "1337",
"name": "Hyatt Regency Paris Etoile",
"amenities": {
"8": {
"id": "8",
"name": "Elevator"
},
"43": {
"id": "43",
"name": "Concierge services"
},
"115": {
"id": "115",
"name": "Bicycle rentals nearby"
},
"361": {
"id": "361",
"name": "Breakfast available (surcharge)"
},
...
}
}
}