Developer Hub
这是自动生成的译文

搜索和筛选

轻松搜索和筛选 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 部分也将可以进行筛选。

  • address
  • airports
  • all_inclusive
  • amenities
  • attributes
  • brand
  • business_model
  • catalog
  • category
  • chain
  • checkin
  • checkout
  • descriptions
  • fax
  • fees
  • images
  • location
  • multi_unit
  • name
  • onsite_payments
  • payment_registration_recommended
  • phone
  • policies
  • property_id
  • property_ids
  • rank
  • rates
  • ratings
  • registry_number
  • rooms
  • spoken_languages
  • statistics
  • supply_source
  • tax_id
  • themes
  • 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)"
      },
      ...
    }
  }
}
该页面有帮助吗?
我们该如何改进这些内容?
感谢您帮助我们改进!