This is an auto-generated translation

搜索和过滤

轻松搜索和过滤快速内容 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和每个属性所请求的部分组成。

可供过滤的部分

注意:此列表不应被视为详尽无遗的,因为过滤功能也将适用于将来添加的任何新的 top-level 部分。

  • property_id
  • name
  • address
  • ratings
  • location
  • phone
  • fax
  • category
  • rank
  • business_model
  • checkin
  • checkout
  • fees
  • policies
  • attributes
  • amenities
  • images
  • onsite_payments
  • rooms
  • rates
  • dates
  • descriptions
  • statistics
  • airports
  • themes
  • all_inclusive
  • tax_id
  • chain
  • brand
  • spoken_languages
  • multi_unit
  • payment_registration_recommended
  • supply_source
  • vacation_rental_details

请求示例 2

在此示例中,我们在 name参数中使用 amenitiesinclude值。

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_idnameamenities。注意: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)"
      },
      ...
    }
  }
}
您觉得这个页面有用吗?
我们该如何改进这些内容?
感谢您帮助我们改进!