本页面提供了 Schema.org 酒店结构化数据标记的技术规范和词汇参考。
概览
酒店价格结构化数据提供了一种标准化的机器可读格式,用于说明、验证和显示您网站上列出的酒店价格,无论您的视觉布局如何。这包括基本价格、费率、客房规格、明细费用和税费,以及预订政策。
Google 建议您使用 Schema.org 提供的标准化结构化数据为网页添加注释,以便准确地从网页中提取价格。
标准结构化数据可通过以下方式扩大价格准确性验证范围:提高抓取工具的可靠性、增加价格准确性验证次数、直接调试价格准确性问题,以及保持价格准确性得分的一致性。
如果您不熟悉结构化数据,可以详细了解结构化数据词汇表和格式。
Google 酒店建议默认使用微数据格式来注释网页,以便进行酒店价格准确性检查。JSON-LD 格式已弃用,无法用于价格准确性验证。请注意,此建议仅适用于酒店价格准确性验证,不会影响 Google 中结构化数据的其他用途(例如 Google 搜索富媒体搜索结果)。如需详细了解常规搜索功能支持的格式,请参阅支持的格式。
此文档提供了详细的参考内容,专门针对酒店中的结构化数据实现。
Hotel 结构化数据用于注释网页中的酒店专用字段。Hotel 结构化数据具有以下属性:
makesOffer属性
HotelRoom 结构化数据用于注释网页中的客房专用字段。
HotelRoom 结构化数据具有以下属性:
offers属性availability属性
导航属性用于向抓取工具说明互动元素和网页状态。如需了解详情,请参阅导航标记。
酒店结构化数据
以下属性适用于酒店实体。
name 和 address 属性
name 和 address 属性用于为酒店的名称和位置添加注释。以下是 name 和 address 属性:
"@type": "Hotel",
"name": "hotel-name",
"identifier": "hotel-id-1234",
"address": {
"@type": "PostalAddress",
"addressCountry": "XX",
"addressLocality": "City Name",
"addressRegion": "State Name",
"postalCode": "01234",
"streetAddress": "1234 Main St."
},
语法
name 和 address 属性使用以下语法:
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">hotel-name</span>
<meta itemprop="identifier" content="hotel-id-1234"/>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<span itemprop="streetAddress">1234 Main St.</span>,
<span itemprop="addressLocality">City Name</span>,
<span itemprop="addressRegion">State Name</span>
<span itemprop="postalCode">01234</span>
<span itemprop="addressCountry">XX</span>
</div>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
...
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "hotel-name",
"identifier": "hotel-id-1234",
"address": {
"@type": "PostalAddress",
"addressCountry": "XX",
"addressLocality": "City Name",
"addressRegion": "State Name",
"postalCode": "01234",
"streetAddress": "1234 Main St."
},
"makesOffer": {
"@type": ["Offer", "LodgingReservation"]
...
}
}
属性
以下是 name 和 address 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| Hotel.name | Required | string | 酒店名称 |
| Hotel.identifier | Required | string | 合作伙伴的酒店 ID。 标识符必须是每个酒店的唯一字符串,并且应与价格 Feed 中使用的字符串完全一致。 |
| Hotel.address | Optional | PostalAddress | 酒店的地址或位置。 |
姓名和地址示例
以下是添加 name 和 address 注释的基本示例:
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<h1 itemprop="name">Mountain Hotel</h1>
<meta itemprop="identifier" content="hotel-id-1234"/>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<span itemprop="streetAddress">Technikerstrasse 21</span>,
<span itemprop="addressLocality">Innsbruck</span>,
<span itemprop="addressRegion">Tyrol</span>
<span itemprop="postalCode">6020</span>
<span itemprop="addressCountry">AT</span>
</div>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "Mountain Hotel",
"identifier": "hotel-id-1234",
"address": {
"@type": "PostalAddress",
"addressCountry": "AT",
"addressLocality": "Innsbruck",
"addressRegion": "Tyrol",
"postalCode": "6020",
"streetAddress": "Technikerstrasse 21"
},
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD"
}
}
}
makesOffer 个房源
makesOffer 注释用于标记酒店行程。
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "YYYY-MM-DD[THH:mm:ss]",
"checkoutTime": "YYYY-MM-DD[THH:mm:ss]",
"availability": "https://schema.org/InStock",
...
}
语法
makesOffer 属性使用以下语法:
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">hotel-name</span>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="YYYY-MM-DDTHH:mm:ss">YYYY-MM-DD[THH:mm:ss]</time>
Check-out: <time itemprop="checkoutTime" content="YYYY-MM-DDTHH:mm:ss">YYYY-MM-DD[THH:mm:ss]</time>
<meta itemprop="availability" content="https://schema.org/InStock"/>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
...
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "hotel-name",
"identifier": "hotel-id-1234",
"address": { ... },
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "YYYY-MM-DD[THH:mm:ss]",
"checkoutTime": "YYYY-MM-DD[THH:mm:ss]",
"availability": "https://schema.org/InStock",
"priceSpecification": { ... }
}
}
属性
以下是 makesOffer 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| makesOffer | Required | Offer and LodgingReservation | 指定行程的酒店优惠。
|
| LodgingReservation.checkinTime | Required | DateTime | 入住时间(采用用户时区)。如果未提及您的时区,则系统会考虑酒店时区。 |
| LodgingReservation.checkoutTime | Required | DateTime | 用户时区的退房时间。如果未提及您的时区,则系统会考虑酒店时区。 |
makesOffer 示例
以下是用于注释酒店优惠的基本示例。您可以为行程指定多个优惠,但应先指定 Google 显示的价格,然后再指定其他价格。指定的价格金额包含所有适用税费。
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">Mountain Hotel</span>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
</div>
</div>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1200.74</span>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "Mountain Hotel",
"identifier": "hotel-id-1234",
"address": { ... },
"makesOffer": [
{
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD"
}
},
{
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1200.74,
"priceCurrency": "USD"
}
}
]
}
Hotel priceSpecification 个房源
此属性用于为酒店或酒店客房添加价格信息注释。您还需要添加两个额外的属性来注释价格和税费。您应使用 CompoundPriceSpecification 来指定总价格信息,例如基本费率、税费和折扣。使用 UnitPriceSpecification 指定其他税费或特殊类型的费用,例如 ResortFee、GenericTax 和 ServiceFee。priceSpecification 属性与 Offer 属性捆绑在一起。
{
...
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": "float",
"priceCurrency": "currency",
"priceComponent": [
{
"@type": "UnitPriceSpecification",
"name": "GenericTax",
"price": "float",
"priceCurrency": "currency"
},
...
]
}
}
语法
Hotel priceSpecification 属性使用以下语法:
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">hotel-name</span>
...
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
...
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">float</span>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name"></span>
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">float</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">GenericTax</span>
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">float</span>
<meta itemprop="priceComponentType" content="GenericTax"/>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">Discount</span>
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">float</span>
<meta itemprop="priceComponentType" content="Discount"/>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
...
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
...
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": "float",
"priceCurrency": "currency",
"priceComponent": [
{
"@type": "UnitPriceSpecification",
"name": "",
"price": "float",
"priceCurrency": "currency"
},
{
"@type": "UnitPriceSpecification",
"name": "GenericTax",
"price": "float",
"priceCurrency": "currency",
"priceComponentType": "GenericTax",
"potentialAction": {
"@type": "https://schema.org/PayAction",
"recipient": {
"@type": "OnlineBusiness",
"name": "name-of-the-business"
}
}
},
{
"@type": "UnitPriceSpecification",
"name": "Discount",
"price": "float",
"priceCurrency": "currency",
"priceComponentType": "Discount"
}
]
}
}
}
属性
以下是 hotel priceSpecification 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| Hotel.Offer.priceSpecification.price | Required | float | 酒店的总价,包括税费和其他费用。 Google 房价应始终在着陆页上显示,并附上完整的房价详情。通过添加费率详情注释,您可以完成价格准确性检查。Google 既接受酒店级价格,也接受客房级价格。 |
| Hotel.Offer.priceSpecification.priceCurrency | Required | currency | 指定价格所对应的三字母货币代码。例如:"USD"
。 |
| Hotel.Offer.priceSpecification.priceComponent | Optional | UnitPriceSpecification[] | 酒店的总价明细,包括税费和其他费用。 价格结构化数据分为两种类型:
您必须在 |
| Hotel.Offer.priceSpecification.priceComponent. potentialAction | Optional | PayAction | 酒店付款流程。酒店付款流程包括在预订网站上退房时和在酒店办理入住时收取的费用。 您应使用与 Google 支持以下两种
|
示例
以下是酒店价格规范的一些示例。
价格
以下是一个向网页添加价格结构化数据的基本示例。makesOffer 属性中可以包含多个酒店级优惠。
如果您选择指定 address 属性,则必须指定 PostalAddress 类型(例如 addressCountry、postalCode、streetAddress)和其他字段。Google 显示的汇率应列在 makesOffer 属性的最前面。指定的价格金额包含所有适用税费。
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">ACME Hotel</span>
<meta itemprop="identifier" content="hotel-id-1234"/>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<span itemprop="streetAddress">Technikerstrasse 21</span>,
<span itemprop="addressLocality">Innsbruck</span>,
<span itemprop="addressRegion">Tyrol</span>
<span itemprop="postalCode">6020</span>
<span itemprop="addressCountry">AT</span>
</div>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
</div>
</div>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1200.74</span>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "ACME Hotel",
"identifier": "hotel-id-1234",
"address": {
"@type": "PostalAddress",
"addressCountry": "AT",
"addressLocality": "Innsbruck",
"addressRegion": "Tyrol",
"postalCode": "6020",
"streetAddress": "Technikerstrasse 21"
},
"makesOffer": [
{
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD"
}
},
{
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1200.74,
"priceCurrency": "USD"
}
}
]
}
价格明细
以下是包含价格细分的 priceSpecification 属性示例。基本费率、一般税费和折扣等税费均使用 UnitPriceSpecification 组件定义。请务必使用与 UnitPriceSpecification 组件对应的值设置 priceComponentType 字段。
住宿晚数的总价应在 CompoundPriceSpecification 属性中指定。价格明细应在 priceComponent 属性中指定。
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<h1 itemprop="name">ACME Hotel</h1>
<meta itemprop="identifier" content="hotel-id-1234"/>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<span itemprop="streetAddress">123 Main street</span>,
<span itemprop="addressLocality">Mountain View</span>,
<span itemprop="addressRegion">Santa Clara</span>
<span itemprop="postalCode">94040</span>
<span itemprop="addressCountry">US</span>
</div>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
Total Price: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
<!-- Price Components -->
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">Base Rate</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1150</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">GenericTax</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">172.74</span>
<meta itemprop="priceComponentType" content="GenericTax" />
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">Discount</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">-100</span>
<meta itemprop="priceComponentType" content="Discount" />
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "ACME Hotel",
"identifier": "hotel-id-1234",
"address": {...},
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD",
"priceComponent": [
{
"@type": "UnitPriceSpecification",
"name": "",
"price": 1150,
"priceCurrency": "USD"
},
{
"@type": "UnitPriceSpecification",
"name": "GenericTax",
"price": 172.74,
"priceCurrency": "USD",
"priceComponentType": "GenericTax"
},
{
"@type": "UnitPriceSpecification",
"name": "Discount",
"price": -100,
"priceCurrency": "USD",
"priceComponentType": "Discount"
}
]
}
}
}
付款时间点
以下示例展示了如何使用 PayAction 的接收者类型来指定 potentialAction。
套餐总价为 1170 美元,在线网站会在预订时收取部分总价(即 1150 美元),这部分价格使用 "@type": "OnlineBusiness" 指定,而用户必须在酒店入住时支付剩余的 20 美元,这部分价格使用 @type": "Hotel" 指定。
您必须指定 potentialAction 组件,才能在预订时和在酒店分别支付款项。如果未指定,则 payAction 会将预订时的支付方式视为默认支付方式。
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">ACME Hotel</span>
<meta itemprop="identifier" content="hotel-id-1234"/>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
Price Due: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1170</span>
<!-- Paid Online -->
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1150</span>
<div itemprop="potentialAction" itemscope itemtype="https://schema.org/PayAction">
<div itemprop="recipient" itemscope itemtype="https://schema.org/OnlineBusiness">
<span itemprop="name">myonlinebusiness</span>
</div>
</div>
</div>
<!-- Paid at Hotel -->
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">20</span>
<div itemprop="potentialAction" itemscope itemtype="https://schema.org/PayAction">
<div itemprop="recipient" itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">The Langham, Boston</span>
</div>
</div>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "ACME Hotel",
"identifier": "hotel-id-1234",
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00]",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1170,
"priceCurrency": "USD",
"priceComponent": [
{
"@type": "UnitPriceSpecification",
"price": 1150,
"priceCurrency": "USD",
"potentialAction": {
"@type": "https://schema.org/PayAction",
"recipient": {
"@type": "OnlineBusiness",
"name": "myonlinebusiness"
}
}
},
{
"@type": "UnitPriceSpecification",
"price": 20,
"priceCurrency": "USD",
"potentialAction": {
"@type": "https://schema.org/PayAction",
"recipient": {
"@type": "Hotel",
"name": "The Langham, Boston",
"address": { ... }
}
}
}
]
}
}
}
hasMerchantReturnPolicy 个房源
此属性用于在行程中添加商家退款政策注释。
"hasMerchantReturnPolicy": {
"@type": "MerchantReturnPolicy",
"returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow",
"refundType": "https://schema.org/FullRefund",
"merchantReturnDays": "YYYY-MM-DD[THH:mm:ss]",
"restockingFee": 0
}
语法
hasMerchantReturnPolicy 的语法如下:
微数据
<div itemscope itemtype="https://schema.org/Hotel">
...
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
...
<div itemprop="hasMerchantReturnPolicy" itemscope itemtype="https://schema.org/MerchantReturnPolicy">
<link itemprop="returnPolicyCategory" href="https://schema.org/MerchantReturnFiniteReturnWindow"/>
<link itemprop="refundType" href="https://schema.org/FullRefund"/>
<meta itemprop="merchantReturnDays" content="YYYY-MM-DDTHH:mm:ss"/>
<meta itemprop="restockingFee" content="0"/>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
...
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "YYYY-MM-DD[THH:mm:ss]",
"checkoutTime": "YYYY-MM-DD[THH:mm:ss]",
"priceSpecification": { ... },
"hasMerchantReturnPolicy": {
"@type": "MerchantReturnPolicy",
"returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow",
"refundType": "https://schema.org/FullRefund",
"merchantReturnDays": "YYYY-MM-DD[THH:mm:ss]",
"restockingFee": 0
}
}
}
属性
以下是 hasMerchantReturnPolicy 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| Offer.hasMerchantReturnPolicy | Optional | MerchantReturnPolicy | 商家退款政策。合作伙伴应使用 如果未指定 |
退货政策示例
以下是一个基本示例,展示了包含客房详情和含税费的总价的酒店结构化数据。此示例表示,在 2023 年 12 月 18 日晚上 11 点(世界协调时间 [UTC])之前,可以免费取消住宿。合作伙伴应使用 "MerchantReturnPolicy.restockingFee" 来指明不全额退还住宿费的取消政策。restockingFee 的默认值为 $0。
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">ACME Hotel</span>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
...
<div itemprop="hasMerchantReturnPolicy" itemscope itemtype="https://schema.org/MerchantReturnPolicy">
<link itemprop="returnPolicyCategory" href="https://schema.org/MerchantReturnFiniteReturnWindow"/>
<link itemprop="refundType" href="https://schema.org/FullRefund"/>
Cancellation Deadline: <time itemprop="merchantReturnDays" content="2023-12-18T23:00:00">2023-12-18 23:00:00</time>
Fee: $<span itemprop="restockingFee">0</span>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "ACME Hotel",
"identifier": "hotel-id-1234",
"description": "Beautiful resort in the outskirts of the city",
"address": {...},
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-12-15 16:00:00",
"checkoutTime": "2023-12-20 11:00:00",
"priceSpecification": {...},
"hasMerchantReturnPolicy": {
"@type": "MerchantReturnPolicy",
"returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow",
"refundType": "https://schema.org/FullRefund",
"merchantReturnDays": "2023-12-18 23:00:00",
"restockingFee": 0
}
}
}
eligibleCustomerType 个房源
此属性可用于注释为酒店会员客户提供的奖励计划。
"eligibleCustomerType": "RewardsMember",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": "float",
"priceCurrency": "currency"
}
语法
eligibleCustomerType 属性的语法如下:
微数据
<div itemscope itemtype="https://schema.org/Hotel">
...
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<meta itemprop="eligibleCustomerType" content="RewardsMember"/>
...
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
...
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "YYYY-MM-DD[THH:mm:ss]",
"checkoutTime": "YYYY-MM-DD[THH:mm:ss]",
"eligibleCustomerType": "RewardsMember",
"priceSpecification": { ... }
}
}
属性
以下是 eligibleCustomerType 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| Offer.eligibleCustomerType | Optional | BusinessEntityType | 面向客户提供的会员回馈活动或会员奖励。 许多酒店页面都会同时显示会员价和公开价,以鼓励用户注册其会员回馈活动。通过设置Offer.eligibleCustomerType 属性,可以指定仅限特定受众群体(例如会员)的费率。 |
示例
以下是奖励会员价的示例。
会员房价
以下是会员价或会员回馈活动限定价格规范的基本示例。客户是酒店的“奖励会员”。
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">ACME Hotel</span>
<meta itemprop="identifier" content="hotel-id-1234"/>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<!-- Address details -->
</div>
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<span itemprop="name">RewardsMember</span>
<meta itemprop="eligibleCustomerType" content="RewardsMember"/>
Check-in: <time itemprop="checkinTime" content="2023-12-15T16:00:00">Dec 15, 2023 4:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-12-20T11:00:00">Dec 20, 2023 11:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
Total: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1342.74</span>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">Base rate</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1069.98</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">GenericTax</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">172.74</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">ResortFee</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">100</span>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "ACME Hotel",
"identifier": "hotel-id-1234",
"address": {...},
"makesOffer": {
"@type": ["Offer", "LodgingReservation"],
"name": "RewardsMember",
"checkinTime": "2023-12-15 16:00:00",
"checkoutTime": "2023-12-20 11:00:00",
"eligibleCustomerType": "RewardsMember",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1342.74,
"priceCurrency": "USD",
"priceComponent": [
{
"@type": "UnitPriceSpecification",
"name": "Base rate",
"price": 1069.98,
"priceCurrency": "USD"
},
{
"@type": "UnitPriceSpecification",
"name": "GenericTax",
"price": 172.74,
"priceCurrency": "currency"
},
{
"@type": "UnitPriceSpecification",
"name": "ResortFee",
"price": 100,
"priceCurrency": "USD"
}
]
}
}
}
会员价和常规价格
以下示例展示了如何同时添加常规价格和会员价注释。会员价格会先列出,然后是常规价格。
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">ACME Hotel</span>
<meta itemprop="identifier" content="hotel-id-1234"/>
<div itemprop="address" itemscope itemtype="https://schema.org/PostalAddress">
<!-- Address details -->
</div>
<!-- Member Rate -->
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<span itemprop="name">RewardsMember</span>
<meta itemprop="eligibleCustomerType" content="RewardsMember"/>
Check-in: <time itemprop="checkinTime" content="2023-12-15T16:00:00">Dec 15, 2023 4:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-12-20T11:00:00">Dec 20, 2023 11:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
Total: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1342.74</span>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">Base rate</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1069.98</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">GenericTax</span>: <span itemprop="priceCurrency" content="currency">$</span><span itemprop="price">172.74</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">ResortFee</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">100</span>
</div>
</div>
</div>
<!-- Regular Rate -->
<div itemprop="makesOffer" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<span itemprop="name">regularRate</span>
Check-in: <time itemprop="checkinTime" content="2023-12-15T16:00:00">Dec 15, 2023 4:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-12-20T11:00:00">Dec 20, 2023 11:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
Total: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1572.24</span>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">Base rate</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1369.98</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">GenericTax</span>: <span itemprop="priceCurrency" content="currency">$</span><span itemprop="price">202.26</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">ResortFee</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">100</span>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "ACME Hotel",
"identifier": "hotel-id-1234",
"address": {...},
"makesOffer": [
{
"@type": ["Offer", "LodgingReservation"],
"name": "RewardsMember",
"checkinTime": "2023-12-15 16:00:00",
"checkoutTime": "2023-12-20 11:00:00",
"eligibleCustomerType": "RewardsMember",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1342.74,
"priceCurrency": "USD",
"priceComponent": [
{
"@type": "UnitPriceSpecification",
"name": "Base rate",
"price": 1069.98,
"priceCurrency": "USD"
},
{
"@type": "UnitPriceSpecification",
"name": "GenericTax",
"price": 172.74,
"priceCurrency": "currency"
},
{
"@type": "UnitPriceSpecification",
"name": "ResortFee",
"price": 100,
"priceCurrency": "USD"
}
]
}
},
{
"@type": ["Offer", "LodgingReservation"],
"name": "regularRate",
"checkinTime": "2023-12-15 16:00:00",
"checkoutTime": "2023-12-20 11:00:00",
"priceSpecification": {
"price": 1572.24,
"priceCurrency": "USD",
"priceComponent": [
{
"@type": "UnitPriceSpecification",
"name": "Base rate",
"price": 1369.98,
"priceCurrency": "USD"
},
{
"@type": "UnitPriceSpecification",
"name": "GenericTax",
"price": 202.26,
"priceCurrency": "currency"
},
{
"@type": "UnitPriceSpecification",
"name": "ResortFee",
"price": 100,
"priceCurrency": "USD"
}
]
}
}
]
}
HotelRoom结构化数据
以下属性适用于 HotelRoom 实体。
offers 个房源
offers 注释用于标记房间行程。您应使用 offers 属性来指定 HotelRoom。
"offers": {
"@type": ["Offer", "LodgingReservation"],
"identifier": "hotel-room-id-1234",
"checkinTime": "YYYY-MM-DD[THH:mm:ss]",
"checkoutTime": "YYYY-MM-DD[THH:mm:ss]",
"priceSpecification": {...}
}
语法
offers 属性的语法如下:
微数据
<div itemscope itemtype="https://schema.org/HotelRoom">
<meta itemprop="identifier" content="hotel-room-id-1234"/>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="YYYY-MM-DDTHH:mm:ss">YYYY-MM-DD[THH:mm:ss]</time>
Check-out: <time itemprop="checkoutTime" content="YYYY-MM-DDTHH:mm:ss">YYYY-MM-DD[THH:mm:ss]</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">float</span>
...
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "HotelRoom",
"identifier": "hotel-room-id-1234",
"offers": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "YYYY-MM-DD[THH:mm:ss]",
"checkoutTime": "YYYY-MM-DD[THH:mm:ss]",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": "float",
"priceCurrency": "currency",
...
}
}
}
属性
以下是 offers 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| offers | Required | Offer and LodgingReservation | 指定行程的客房价格规范。
|
| LodgingReservation.checkinTime | Required | DateTime | 入住时间(采用用户时区)。如果未提及您的时区,则系统会考虑酒店时区。 |
| LodgingReservation.checkoutTime | Required | DateTime | 用户时区的退房时间。如果未提及您的时区,则系统会考虑酒店时区。 |
offers 示例
微数据
<div itemscope itemtype="https://schema.org/HotelRoom">
<meta itemprop="identifier" content="hotel-room-id-1234"/>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<meta itemprop="identifier" content="rate-plan-id-of-member-rate"/>
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "HotelRoom",
"identifier": "hotel-room-id-1234",
"offers": {
"@type": ["Offer", "LodgingReservation"],
"identifier": "rate-plan-id-of-member-rate",
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD"
}
}
}
bed 和 occupancy 属性
bed 属性用于注释房间中的床位类型和床位数量。occupancy 属性用于注释房间内的房客人数。可以使用 HotelRoom 属性指定 bed 和 occupancy 属性。
"@type": "Hotel",
"identifier": "hotel-id-1234",
"containsPlace": {
"@type": ["HotelRoom", "Product"],
"identifier": "hotel-room-id",
"bed": {
"@type": "BedDetails",
"numberOfBeds": "integer",
"typeOfBed": "KING"
},
"occupancy": {
"@type": "QuantitativeValue",
"value": "integer"
}
}
语法
bed 和 occupancy 属性的语法如下:
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">hotel-name</span>
<meta itemprop="identifier" content="hotel-id-1234"/>
<div itemprop="containsPlace" itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
<span itemprop="name">room-name</span>
<meta itemprop="identifier" content="hotel-room-id-1234"/>
<!-- Bed Details -->
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">integer</span>
<span itemprop="typeOfBed">KING</span>
</div>
<!-- Occupancy -->
<div itemprop="occupancy" itemscope itemtype="https://schema.org/QuantitativeValue">
Occupancy: <span itemprop="value">integer</span>
</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
...
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "hotel-name",
"identifier": "hotel-id-1234",
"containsPlace": {
"@type": ["HotelRoom", "Product"],
"name": "room-name",
"identifier": "hotel-room-id-1234",
"bed": {
"@type": "BedDetails",
"numberOfBeds": "integer",
"typeOfBed": "KING"
},
"occupancy": {
"@type": "QuantitativeValue",
"value": "integer"
},
"offers": {
"@type": ["Offer", "LodgingReservation"],
"identifier": "rate-plan-id-of-member-rate",
"checkinTime": "YYYY-MM-DD[THH:mm:ss]",
"checkoutTime": "YYYY-MM-DD[THH:mm:ss]",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": "float",
"priceCurrency": "currency",
"priceComponent": {
"@type": "UnitPriceSpecification",
"name": "",
"price": "float",
"priceCurrency": "currency"
},
...
}
}
}
}
bed 和 occupancy 属性只能使用 HotelRoom 属性进行设置。通过 containsPlace 属性,可以将客房级价格等客房专用信息添加到 Hotel 属性中。请参阅 Hotel 和 HotelRoom 规范示例。
属性
以下是 bed 和 occupancy 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| HotelRoom.bed | Optional (Recommended) | bed | 住宿中包含的床位类型以及房间内的入住人数。 支持的值如下:
|
| HotelRoom.occupancy | Optional (Recommended) | QuantitativeValue | 酒店客房的入住人数。入住率的类型为 |
| containsPlace | Optional (Recommended) | LocationFeatureSpecification | 用于注释与特定客房关联的客房级房价。它还可用于指定客房内的设施。 详细了解如何在
amenityFeature 属性中使用 |
示例
以下是床位和入住率规范的示例。
HotelRoom 示例
以下是房间规格的床位和入住情况的基本示例。
微数据
<div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
<meta itemprop="identifier" content="hotel-room-id-1234"/>
<span itemprop="name">Deluxe Room, 1 King Bed</span>
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">1</span>
<span itemprop="typeOfBed">KING</span>
</div>
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">1</span>
<span itemprop="typeOfBed">SINGLE</span>
</div>
<div itemprop="occupancy" itemscope itemtype="https://schema.org/QuantitativeValue">
Occupancy: <span itemprop="value">2</span>
</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<meta itemprop="identifier" content="rate-plan-id-of-member-rate"/>
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": ["HotelRoom", "Product"],
"name": "Deluxe Room, 1 King Bed",
"identifier": "hotel-room-id-1234",
"bed": [
{
"@type": "BedDetails",
"numberOfBeds": 1,
"typeOfBed": "KING"
},
{
"@type": "BedDetails",
"numberOfBeds": 1,
"typeOfBed": "SINGLE"
}
],
"occupancy": {
"@type": "QuantitativeValue",
"value": 2
},
"offers": {
"@type": ["Offer", "LodgingReservation"],
"identifier": "rate-plan-id-of-member-rate",
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD"
}
}
}
Hotel 和 HotelRoom 示例
以下示例展示了如何为 Hotel 和 HotelRoom 属性以及 bed、occupancy 和 priceSpecification 添加注释。
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">hotel-name</span>
<meta itemprop="identifier" content="hotel-id-1234"/>
<div itemprop="containsPlace" itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
<span itemprop="name">Deluxe Room, 1 King Bed</span>
<meta itemprop="identifier" content="hotel-room-id"/>
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">1</span>
<span itemprop="typeOfBed">KING</span>
</div>
<div itemprop="occupancy" itemscope itemtype="https://schema.org/QuantitativeValue">
Occupancy: <span itemprop="value">2</span>
</div>
<div itemprop="amenityFeature" itemscope itemtype="https://schema.org/LocationFeatureSpecification">
<span itemprop="name">Minibar</span>
<meta itemprop="value" content="true"/>
</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<meta itemprop="identifier" content="rate-plan-id-of-member-rate"/>
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "hotel-name",
"identifier": "hotel-id-1234",
"containsPlace": {
"@type": ["HotelRoom", "Product"],
"name": "Deluxe Room, 1 King Bed",
"identifier": "hotel-room-id",
"bed": {
"@type": "BedDetails",
"numberOfBeds": 1,
"typeOfBed": "KING"
},
"occupancy": {
"@type": "QuantitativeValue",
"value": 2
},
"amenityFeature": {
"@type": "LocationFeatureSpecification",
"name": "Minibar",
"value": true
},
"offers": {
"@type": ["Offer", "LodgingReservation"],
"identifier": "rate-plan-id-of-member-rate",
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD"
}
}
}
}
HotelRoom priceSpecification 个房源
酒店客房价格规范与酒店价格规范类似。不同之处在于,客房价格是使用 Product.offers 属性(而非 Hotel.makesOffer 属性)指定的。
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": "float",
"priceCurrency": "currency",
"priceComponent": {
"@type": "UnitPriceSpecification",
"name": "GenericTax",
"price": "float",
"priceCurrency": "currency"
}
...
}
语法
酒店客房的 priceSpecification 属性具有以下语法:
微数据
<div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
...
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
...
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">float</span>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name"></span>
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">float</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">GenericTax</span>
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">float</span>
<meta itemprop="priceComponentType" content="GenericTax"/>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">Discount</span>
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">float</span>
<meta itemprop="priceComponentType" content="Discount"/>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": ["HotelRoom", "Product"],
...
"bed": {
"@type": "BedDetails",
"numberOfBeds": "integer",
"typeOfBed": "KING"
},
"occupancy": {
"@type": "QuantitativeValue",
"value": "integer"
},
"offers": {
"@type": ["Offer", "LodgingReservation"],
...
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": "float",
"priceCurrency": "currency",
"priceComponent": [
{
"@type": "UnitPriceSpecification",
"name": "",
"price": "float",
"priceCurrency": "currency"
},
{
"@type": "UnitPriceSpecification",
"name": "GenericTax",
"price": "float",
"priceCurrency": "currency",
"priceComponentType": "GenericTax"
},
{
"@type": "UnitPriceSpecification",
"name": "Discount",
"price": "float",
"priceCurrency": "currency",
"priceComponentType": "Discount"
}
]
}
}
}
属性
以下是 HotelRoom priceSpecification 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| Hotel.Offer.priceSpecification.price | Required | float | 每间客房的价格,包括 Google 房价应始终在着陆页上显示,并附上完整的房价详情。通过添加费率详情注释,您可以完成价格准确性检查。Google 接受酒店级价格和客房级价格。 |
| Hotel.Offer.priceSpecification.priceCurrency | Required | currency | 指定价格所对应的三字母货币代码。例如:"USD"
。 |
| Hotel.Offer.priceSpecification.priceComponent | Optional | UnitPriceSpecification[] | 酒店客房的总价明细,包括税费和其他费用,以及与
|
示例
以下是 HotelRoom 价格规范的示例。
客房价格总计示例
以下是一个基本示例,展示了如何定义住宿时段的总价和每位入住者的价格。
微数据
<div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
<span itemprop="name">Deluxe Room King, 1 Single Bed</span>
<meta itemprop="identifier" content="hotel-room-id-1234"/>
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">1</span>
<span itemprop="typeOfBed">KING</span>
</div>
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">1</span>
<span itemprop="typeOfBed">SINGLE</span>
</div>
<div itemprop="occupancy" itemscope itemtype="https://schema.org/QuantitativeValue">
Occupancy: <span itemprop="value">2</span>
</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1232.74</span>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": ["HotelRoom", "Product"],
"name": "Deluxe Room King, 1 Single Bed",
"identifier": "hotel-room-id-1234",
"bed": [
{
"@type": "BedDetails",
"numberOfBeds": 1,
"typeOfBed": "KING"
},
{
"@type": "BedDetails",
"numberOfBeds": 1,
"typeOfBed": "SINGLE"
}
],
"occupancy": {
"@type": "QuantitativeValue",
"value": 2
},
"offers": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1232.74,
"priceCurrency": "USD"
}
}
}
客房价格明细示例
以下是每间客房或每个方案的价格示例。价格明细是针对客房类型(例如 Deluxe 客房)以及 bed 和 occupancy 类型(例如 KING 和 SINGLE 床)和 2 位房客的入住人数定义的。
微数据
<div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
<span itemprop="name">Deluxe Room King, 1 Single Bed</span>
<meta itemprop="identifier" content="hotel-room-id-1234"/>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<meta itemprop="identifier" content="rate-plan-id-of-member-rate"/>
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">1</span>
<span itemprop="typeOfBed">KING</span>
</div>
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">1</span>
<span itemprop="typeOfBed">SINGLE</span>
</div>
<div itemprop="occupancy" itemscope itemtype="https://schema.org/QuantitativeValue">
Occupancy: <span itemprop="value">2</span>
</div>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
Total: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">Base rate</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1150</span>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">GenericTax</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">172.74</span>
<meta itemprop="priceComponentType" content="GenericTax"/>
</div>
<div itemprop="priceComponent" itemscope itemtype="https://schema.org/UnitPriceSpecification">
<span itemprop="name">Discount</span>: <span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">-100</span>
<meta itemprop="priceComponentType" content="Discount"/>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": ["HotelRoom", "Product"],
"name": "Deluxe Room King, 1 Single Bed",
"identifier": "hotel-room-id-1234",
"offers": {
"@type": ["Offer", "LodgingReservation"],
"identifier": "rate-plan-id-of-member-rate",
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"bed": [
{
"@type": "BedDetails",
"numberOfBeds": 1,
"typeOfBed": "KING"
},
{
"@type": "BedDetails",
"numberOfBeds": 1,
"typeOfBed": "SINGLE"
}
],
"occupancy": {
"@type": "QuantitativeValue",
"value": 2
},
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD",
"priceComponent": [
{
"@type": "UnitPriceSpecification",
"name": "Base rate",
"price": 1150,
"priceCurrency": "USD"
},
{
"@type": "UnitPriceSpecification",
"name": "GenericTax",
"price": 172.74,
"priceCurrency": "USD",
"priceComponentType": "GenericTax"
},
{
"@type": "UnitPriceSpecification",
"name": "Discount",
"price": -100,
"priceCurrency": "USD",
"priceComponentType": "Discount"
}
]
}
}
}
includesObject 个房源
此属性用于注释酒店或客房内提供的特定房价服务,例如餐点选项和代客泊车服务。您可以在 Hotel 或 HotelRoom 属性中对 includesObject 进行注释。
{
"includesObject": [
{
"@type": "TypeAndQuantityNode",
"typeOfGood": {
"@type": "Service",
"name": "Valet"
}
},
{
"@type": "TypeAndQuantityNode",
"amountOfThisGood": "float",
"unitText": "currency",
"typeOfGood": {
"@type": "FoodService",
"name": "MealCredit"
}
}
]
}
语法
includesObject 针对客房内提供的特定房价服务具有以下语法:
微数据
<div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
...
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
...
<div itemprop="includesObject" itemscope itemtype="https://schema.org/TypeAndQuantityNode">
<div itemprop="typeOfGood" itemscope itemtype="https://schema.org/Service">
<span itemprop="name">Valet</span>
</div>
</div>
<div itemprop="includesObject" itemscope itemtype="https://schema.org/TypeAndQuantityNode">
<meta itemprop="amountOfThisGood" content="float"/>
<meta itemprop="unitText" content="currency"/>
<div itemprop="typeOfGood" itemscope itemtype="https://schema.org/FoodService">
<span itemprop="name">MealCredit</span>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
...
"@type": ["HotelRoom", "Product"],
...
"offers": {
"@type": ["Offer", "LodgingReservation"],
...
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": "float",
"priceCurrency": "currency"
},
"includesObject": [
{
"@type": "TypeAndQuantityNode",
"typeOfGood": {
"@type": "Service",
"name": "Valet"
}
},
{
"@type": "TypeAndQuantityNode",
"amountOfThisGood": "float",
"unitText": "currency",
"typeOfGood": {
"@type": "FoodService",
"name": "MealCredit"
}
}
]
}
}
属性
includesObject 具有以下属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| Offer.includesObject | Optional | TypeAndQuantityNode | 酒店或客房内提供的服务。 费率专属功能包含在 特定费率的功能可能也包含在基础级优惠中,或者可以指定为加购项,但需要额外付费。
|
includesObject 示例
以下是代客泊车和餐饮服务的费率特定功能的简单示例。应使用 Offer.includesObject 属性指定特定于费率的功能。TypeAndQuantityNode.typeOfGood 上的 name 字段应用于指明服务类型。
微数据
<div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
<span itemprop="name">Deluxe Room, 1 King Bed</span>
<meta itemprop="identifier" content="hotel-room-id-1234"/>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<meta itemprop="identifier" content="rate-plan-id-of-member-rate"/>
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
</div>
<!-- Included Services -->
<div itemprop="includesObject" itemscope itemtype="https://schema.org/TypeAndQuantityNode">
<div itemprop="typeOfGood" itemscope itemtype="https://schema.org/Service">
<span itemprop="name">Valet</span>
</div>
</div>
<div itemprop="includesObject" itemscope itemtype="https://schema.org/TypeAndQuantityNode">
<meta itemprop="amountOfThisGood" content="50"/>
<meta itemprop="unitText" content="USD"/>
<div itemprop="typeOfGood" itemscope itemtype="https://schema.org/FoodService">
<span itemprop="name">MealCredit</span>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": ["HotelRoom", "Product"],
"name": "Deluxe Room, 1 King Bed",
"identifier": "hotel-room-id-1234",
"offers": {
"@type": ["Offer", "LodgingReservation"],
"identifier": "rate-plan-id-of-member-rate",
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD"
},
"includesObject": [
{
"@type": "TypeAndQuantityNode",
"typeOfGood": {
"@type": "Service",
"name": "Valet"
}
},
{
"@type": "TypeAndQuantityNode",
"amountOfThisGood": 50,
"unitText": "USD",
"typeOfGood": {
"@type": "FoodService",
"name": "MealCredit"
}
}
]
}
}
availability 个房源
offer.availability 属性用于注释酒店客房的已售完行程。
"offers": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "YYYY-MM-DD[THH:mm:ss]",
"checkoutTime": "YYYY-MM-DD[THH:mm:ss]",
"availability": "https://schema.org/SoldOut"
}
语法
availability 属性的语法如下:
微数据
<div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
...
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
...
<meta itemprop="availability" content="https://schema.org/SoldOut"/>
Sold Out
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
...
"@type": ["HotelRoom", "Product"],
"name": "room-type",
"identifier": "hotel-room-id-1234",
"bed": {
"@type": "BedDetails",
"numberOfBeds": "integer",
"typeOfBed": "KING"
},
"occupancy": {
"@type": "QuantitativeValue",
"value": "integer"
},
"offers": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "YYYY-MM-DD[THH:mm:ss]",
"checkoutTime": "YYYY-MM-DD[THH:mm:ss]",
"availability": "https://schema.org/SoldOut"
}
}
属性
以下是 availability 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| Offer.availability | Optional | ItemAvailability | 酒店或客房的空房情况。 汇率是从
没有 如果相应优惠已使用有效的 |
availability 示例
以下是一个基本示例,用于显示酒店客房不可订。您应提供指定客房的床位类型、床位数和入住详情。
微数据
<div itemscope itemtype="https://schema.org/HotelRoom https://schema.org/Product">
<span itemprop="name">Deluxe Room, 1 King Bed</span>
<meta itemprop="identifier" content="hotel-room-id-1234"/>
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">1</span>
<span itemprop="typeOfBed">KING</span>
</div>
<div itemprop="bed" itemscope itemtype="https://schema.org/BedDetails">
<span itemprop="numberOfBeds">1</span>
<span itemprop="typeOfBed">SINGLE</span>
</div>
<div itemprop="occupancy" itemscope itemtype="https://schema.org/QuantitativeValue">
Occupancy: <span itemprop="value">2</span>
</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<meta itemprop="availability" content="https://schema.org/SoldOut"/>
Sold Out
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<!-- Price Specification details -->
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": ["HotelRoom", "Product"],
"name": "Deluxe Room, 1 King Bed",
"identifier": "hotel-room-id-1234",
"bed": [
{
"@type": "BedDetails",
"numberOfBeds": 1,
"typeOfBed": "KING"
},
{
"@type": "BedDetails",
"numberOfBeds": 1,
"typeOfBed": "SINGLE"
}
],
"occupancy": {
"@type": "QuantitativeValue",
"value": 2
},
"offers": {
"@type": ["Offer", "LodgingReservation"],
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"availability": "https://schema.org/SoldOut",
"priceSpecification": {...}
}
}
amenityFeature 个房源
您可以使用 amenityFeature 属性以 Hotel 或 HotelRoom 类型指定设施。您应使用 containsPlace 属性指定客房内提供的设施。
{
"@type": "Hotel",
"amenityFeature": [
{
"@type": "LocationFeatureSpecification",
"name": "HotTub",
"hoursAvailable": {
"@type": "OpeningHoursSpecification",
"opens": "HH:mm:ss",
"closes": "HH:mm:ss"
}
},
{
"@type": "LocationFeatureSpecification",
"name": "GymFitnessEquipment",
"value": "boolean"
}
],
"containsPlace": {
"@type": "HotelRoom",
"amenityFeature": [
{
"@type": "LocationFeatureSpecification",
"name": "Minibar",
"value": true
},
{
"@type": "LocationFeatureSpecification",
"name": "Smoking",
"value": false
}
]
}
}
语法
amenityFeature 和 containsPlace 属性具有以下语法:
微数据
<div itemscope itemtype="https://schema.org/Hotel">
...
<!-- Hotel Amenity -->
<div itemprop="amenityFeature" itemscope itemtype="https://schema.org/LocationFeatureSpecification">
<span itemprop="name">HotTub</span>
<div itemprop="hoursAvailable" itemscope itemtype="https://schema.org/OpeningHoursSpecification">
<time itemprop="opens" content="HH:mm:ss">HH:mm:ss</time>
<time itemprop="closes" content="HH:mm:ss">HH:mm:ss</time>
</div>
</div>
<div itemprop="containsPlace" itemscope itemtype="https://schema.org/HotelRoom">
<!-- Room Amenity -->
<div itemprop="amenityFeature" itemscope itemtype="https://schema.org/LocationFeatureSpecification">
<span itemprop="name">Minibar</span>
<meta itemprop="value" content="boolean"/>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
...
"amenityFeature": {
"@type": "LocationFeatureSpecification",
"name": "HotTub",
"hoursAvailable": {
"@type": "OpeningHoursSpecification",
"opens": "HH:mm:ss",
"closes": "HH:mm:ss"
}
},
"containsPlace": {
"@type": "HotelRoom",
"amenityFeature": {
"@type": "LocationFeatureSpecification",
"name": "Minibar",
"value": "boolean"
}
}
}
设施
以下设施是允许的,并在 name 属性中定义。
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| amenityFeature.AC | Optional | boolean | 房源是否有空调。 |
| amenityFeature.AirportShuttle | Optional | boolean | 房主是否提供往返机场或其他交通站点的交通服务。 |
| amenityFeature.Balcony | Optional | boolean | 住宿是否有阳台。 |
| amenityFeature.BeachAccess | Optional | boolean | 房源是否可通往房源附近的公共海滩。 |
| amenityFeature.ChildFriendly | Optional | boolean | 房源是否适合儿童。 |
| amenityFeature.Crib | Optional | boolean | 房源是否提供婴儿床。 |
| amenityFeature.Elevator | Optional | boolean | 房源是否有电梯。 |
| amenityFeature.FirePlace | Optional | boolean | 住宿是否有壁炉。 |
| amenityFeature.FreeBreakfast | Optional | boolean | 房源是否为所有客人提供免费早餐。使用费率功能来指明早餐是否仅包含在特定费率方案中。 |
| amenityFeature.GymFitnessEquipment | Optional | boolean | 房源是否有健身房或任何健身器材。 |
| amenityFeature.Heating | Optional | boolean | 住宿是否有暖气。 |
| amenityFeature.HotTub | Optional | boolean | 房源是否有热水浴缸。 |
| amenityFeature.InstantBookable | Optional | boolean | 房源是否可通过退房流程立即预订。备用选项是等待批准。 |
| amenityFeature.IroningBoard | Optional | boolean | 房源是否提供熨衣板。 |
| amenityFeature.Kitchen | Optional | boolean | 住宿是否设有厨房。 |
| amenityFeature.Microwave | Optional | boolean | 住宿是否有微波炉。 |
| amenityFeature.OpenAirBath(Hotels only) | Optional | boolean | 住宿是否附带露天浴池。如果是在客房级别指定的,则浴室应仅供客房入住者使用。 |
| amenityFeature.OutdoorGrill | Optional | boolean | 房源是否有烧烤架。 |
| amenityFeature.OvenStove | Optional | boolean | 房源是否有炉灶。 |
| amenityFeature.Patio | Optional | boolean | 房源是否有露台。 |
| amenityFeature.Pool | Optional | boolean | 住宿是否有泳池。 |
| amenityFeature.PrivateBeachAccess | Optional | boolean | 房源是否有专属非公共海滩。 |
| amenityFeature.SelfCheckinCheckout | Optional | boolean | 房源是否支持自助入住和退房。 |
| amenityFeature.WasherDryer | Optional | boolean | 住宿是否提供洗衣机。 |
| amenityFeature.Wifi | Optional | boolean | 房源是否有 Wi-Fi。 |
| amenityFeature.Smoking | Optional | boolean | 住宿是否允许吸烟。 |
| amenityFeature.InternetType | Optional | Enum | 房源提供的互联网类型。 支持的值包括:
|
| amenityFeature.ParkingType | Optional | Enum | 房源提供的停车类型。 支持的值包括:
|
| amenityFeature.PoolType | Optional | Enum | 房源提供的泳池类型。 支持的值包括:
|
| amenityFeature.RoomStyle | Optional | Enum | 指明房间是否为日式设计。 支持的值包括:
|
| amenityFeature.LicenseNum | Required | string | 要在全球某些地区的房源上显示的商家的许可号码。此属性可以重复添加,如果存在多个许可,建议添加许可的所有者或授权机构。例如 |
属性
以下是 amenityFeature 属性:
| 属性 | 是否必需? | 类型 | 说明 |
|---|---|---|---|
| amenityFeature | Optional | LocationFeatureSpecification | 酒店或客房内提供的设施。可以使用 可以在 |
| containsPlace | Optional | LocationFeatureSpecification | 酒店或客房内为所有酒店房客提供的酒店设施。可以使用
|
酒店设施示例
以下是一个基本示例,展示了酒店的泳池开放时间为上午 10 点至晚上 10 点,且酒店内没有健身房。酒店客房为无烟客房,并配有迷你吧。
微数据
<div itemscope itemtype="https://schema.org/Hotel">
<span itemprop="name">ACME Hotel</span>
<!-- Amenities -->
<div itemprop="amenityFeature" itemscope itemtype="https://schema.org/LocationFeatureSpecification">
<span itemprop="name">HotTub</span>
<div itemprop="hoursAvailable" itemscope itemtype="https://schema.org/OpeningHoursSpecification">
Open from <time itemprop="opens" content="10:00:00">10:00</time>
to <time itemprop="closes" content="22:00:00">22:00</time>
</div>
</div>
<div itemprop="amenityFeature" itemscope itemtype="https://schema.org/LocationFeatureSpecification">
<span itemprop="name">GymFitnessEquipment</span>:
<meta itemprop="value" content="false"/> No
</div>
<div itemprop="containsPlace" itemscope itemtype="https://schema.org/HotelRoom">
<!-- Room Amenities -->
<div itemprop="amenityFeature" itemscope itemtype="https://schema.org/LocationFeatureSpecification">
<span itemprop="name">Minibar</span>:
<meta itemprop="value" content="true"/> Yes
</div>
<div itemprop="amenityFeature" itemscope itemtype="https://schema.org/LocationFeatureSpecification">
<span itemprop="name">Smoking</span>:
<meta itemprop="value" content="false"/> No
</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer https://schema.org/LodgingReservation">
<meta itemprop="identifier" content="rate-plan-id-of-member-rate"/>
Check-in: <time itemprop="checkinTime" content="2023-03-10T15:00:00">Mar 10, 2023 3:00 PM</time>
Check-out: <time itemprop="checkoutTime" content="2023-03-16T10:00:00">Mar 16, 2023 10:00 AM</time>
<div itemprop="priceSpecification" itemscope itemtype="https://schema.org/CompoundPriceSpecification">
<span itemprop="priceCurrency" content="USD">$</span><span itemprop="price">1222.74</span>
</div>
</div>
</div>
</div>
JSON-LD(已弃用)
{
"@context": "https://schema.org",
"@type": "Hotel",
"name": "ACME Hotel",
"address": { ... },
"amenityFeature": [
{
"@type": "LocationFeatureSpecification",
"name": "HotTub",
"hoursAvailable": {
"@type": "OpeningHoursSpecification",
"opens": "10:00:00",
"closes": "22:00:00"
}
},
{
"@type": "LocationFeatureSpecification",
"name": "GymFitnessEquipment",
"value": false
}
],
"containsPlace": {
"@type": "HotelRoom",
"amenityFeature": [
{
"@type": "LocationFeatureSpecification",
"name": "Minibar",
"value": true
},
{
"@type": "LocationFeatureSpecification",
"name": "Smoking",
"value": false
}
],
"offers": {
"@type": ["Offer", "LodgingReservation"],
"identifier": "rate-plan-id-of-member-rate",
"checkinTime": "2023-03-10 15:00:00",
"checkoutTime": "2023-03-16 10:00:00",
"priceSpecification": {
"@type": "CompoundPriceSpecification",
"price": 1222.74,
"priceCurrency": "USD"
}
}
}
}
导航标记
带有 data-nav- 前缀的自定义 HTML5 属性用于注释互动元素和声明网页状态,从而使抓取工具能够浏览预订流程。
语法
导航标记使用以下属性语法:
属性
<body data-nav-stage="stage_name">
...
<button data-nav-criticalpath="true"
data-nav-interactiontype="CLICK"
data-nav-interactionorder="1">
Action
</button>
...
<button data-nav-close="true">Dismiss</button>
</body>
属性
以下是导航属性:
| 属性 | 值 | 说明 |
|---|---|---|
| data-nav-stage | landing, room-selection, checkout, confirmation | 为爬虫声明有效漏斗状态。附加到 <body> 或高级别封装容器。 |
| data-nav-stage-final | true, false | 流程最后一页的指示器(默认值为 false)。如果某个网页上没有 data-nav-criticalpath="true" 元素,抓取工具会自动将其视为流程的最后一页。 |
| data-nav-criticalpath | true, false | 标记了爬虫必须与之互动才能到达最终预订页面的元素。如果网页上没有任何包含 data-nav-criticalpath="true" 的元素,抓取工具会自动将其视为流程的最后一页。 |
| data-nav-interactiontype | CLICK, SELECT | 指定互动操作。CLICK 适用于按钮/链接。SELECT 适用于下拉菜单/单选组。 |
| data-nav-interactionorder | integer | 为多步导航提供执行序列。数字越小,执行顺序越靠前。 |
| data-nav-close | true | 标记弹出式窗口、Cookie 横幅叠加层或追加销售模态框上的关闭按钮。 |
导航示例
以下是导航标记的示例。
点击导航
以下是一个基本示例,展示了如何通过点击导航声明漏斗阶段。
<body data-nav-stage="room-selection" data-nav-stage-final="false">
<h1>Select Your Room</h1>
<!-- Crawler needs to click this to proceed -->
<button data-nav-criticalpath="true"
data-nav-interactiontype="CLICK"
data-nav-interactionorder="1">
Select & Proceed
</button>
</body>
多步骤导航
以下示例展示了多步导航,包括 Cookie 横幅、手风琴展开和点击。
<div data-nav-stage="landing" data-nav-stage-final="false">
<!-- Hotel, LodgingReservation info, and Offer price are expected to be included in this page -->
<!-- Step 1: Accept cookies -->
<div class="cookie-banner">
<p>We use cookies to improve your experience.</p>
<button data-nav-close="true"
data-nav-criticalpath="true"
data-nav-interactiontype="CLICK"
data-nav-interactionorder="1">Accept cookies</button>
</div>
<!-- Step 2: Open accordion to reveal pricing (Crucial for making prices visible in Mobile UIs) -->
<div data-nav-criticalpath="true"
data-nav-interactiontype="CLICK"
data-nav-interactionorder="2"
class="accordion-header">
<span>View Room Rates</span>
</div>
<!-- Step 3: Book the room -->
<div class="accordion-content">
<button data-nav-criticalpath="true"
data-nav-interactiontype="CLICK"
data-nav-interactionorder="3">
Book Now
</button>
</div>
</div>
最终页面声明
以下示例展示了如何声明预订流程的最后一页。
<!-- Marks this as the final confirmation page where price is extracted -->
<!-- Hotel, LodgingReservation info, and Offer price are expected to be included in this page -->
<div data-nav-stage="confirmation" data-nav-stage-final="true">
<h1>Grand View Hotel</h1>
<!-- Price and other details here -->
</div>