API Hop 文档
Google Hotels 接口参考
搜索 Google Hotels 酒店、酒店建议、照片和评论。
并发上限
AI 与 Data 分别共享账户级并发槽位,默认 5 AI / 2 Data,订阅套餐可调整上限。接口单独配置仍受分类总上限约束。达到任一上限返回 HTTP 429;异步任务执行结束前占用槽位。
GET /v1/google-hotels/search GET /v1/google-hotels/autocomplete GET /v1/google-hotels/photos GET /v1/google-hotels/reviews 搜索 Google Hotels 酒店、酒店建议、照片和评论。
认证与计费
默认每次成功请求 $0.0003(300 credits)。 使用 API Hop API Key。可用性取决于已启用网关和密钥权限。每次成功请求的价格以当前目录和账户显示为准,账户专属价格优先。成功的空结果也计费,失败请求释放预占额度。超时为 60 秒,不自动重试或翻页,结算失败不会重复调用上游。
Authorization: Bearer YOUR_API_KEYGoogle Hotels: 搜索酒店
GET https://api.apihop.ai/v1/google-hotels/search
请求参数
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
query | string | 搜索词; query: optional | hotels in New York |
next_page_token | string | 下一页令牌; next_page_token: optional; UTF-8 bytes: 24576 | - |
currency | string | 货币代码 (currency); currency: optional; ALL, DZD, ARS, AMD, AWG, AUD, AZN, BSD, BHD, BYN, BMD, BAM, BRL, GBP, BGN, XPF, CAD, CLP, CNY, COP, CRC, CUP, CZK, DKK, DOP, EGP, EUR, GEL, HKD, HUF, ISK, INR, IDR, IRR, ILS, JMD, JPY, JOD, KZT, KWD, LBP, MKD, MYR, MXN, MDL, MAD, TWD, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, RSD, SGD, ZAR, KRW, SEK, CHF, THB, TRY, USD, UAH, AED, VND; ^[A-Z]{3}$ | USD |
country | string | 国家或站点代码 (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | 语言; language: optional | - |
limit | integer | 结果上限; limit: optional; min: 1; max: 100 | 1 |
device | string | 设备; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不归档响应产物; zero_trace: optional | true |
check_in_date | string | 旅行日期(YYYY-MM-DD)或接口支持的日期范围 (check_in_date); check_in_date: optional; ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ | - |
check_out_date | string | 旅行日期(YYYY-MM-DD)或接口支持的日期范围 (check_out_date); check_out_date: optional; ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ | - |
adults | integer | 成人人数 (adults); adults: optional; min: 1; max: 100 | 1 |
children | integer | 儿童人数 (children); children: optional; min: 0; max: 99 | 0 |
children_ages | string | 儿童年龄列表 (children_ages); 默认值: 12; children_ages: optional; UTF-8 bytes: 296; ^(?:[1-9]|1[0-7])(?:,(?:[1-9]|1[0-7])){0,98}$ | - |
sort_by | string | 排序; sort_by: optional; relevance, lowest_price, highest_rating, most_reviewed | relevance |
min_price | integer | 最低价格 (min_price); min_price: optional; min: 0; max: 2147483647 | 0 |
max_price | integer | 最高价格 (max_price); max_price: optional; min: 1; max: 2147483647 | 1 |
rating | integer | 星级(逗号分隔); 7 → 3.5+, 8 → 4.0+, 9 → 4.5+; rating: optional; 7, 8, 9 | 7 |
hotel_class | string | 住宿条件筛选 (hotel_class); hotel_class: optional; UTF-8 bytes: 7 | - |
amenities | string | 住宿条件筛选 (amenities); amenities: optional; UTF-8 bytes: 300; ^[1-9][0-9]*(?:,[1-9][0-9]*)*$ | - |
free_cancellation | boolean | 住宿条件筛选 (free_cancellation); free_cancellation: optional | true |
special_offers | boolean | 住宿条件筛选 (special_offers); special_offers: optional | true |
eco_certified | boolean | 住宿条件筛选 (eco_certified); eco_certified: optional | true |
property_types | string | 住宿条件筛选 (property_types); property_types: optional; UTF-8 bytes: 100; ^[1-9][0-9]*(?:,[1-9][0-9]*)*$ | - |
brands | string | 住宿条件筛选 (brands); brands: optional; UTF-8 bytes: 300; ^[1-9][0-9]{0,5}(?:,[1-9][0-9]{0,5})*$ | - |
vacation_rentals | boolean | 住宿条件筛选 (vacation_rentals); vacation_rentals: optional | true |
bedrooms | integer | 卧室或床数量下限 (bedrooms); bedrooms: optional; min: 0; max: 2147483647 | 0 |
bathrooms | integer | 浴室数量下限 (bathrooms); bathrooms: optional; min: 0; max: 2147483647 | 0 |
property_token | string | 从最新响应复制的选择令牌 (property_token); property_token: optional; UTF-8 bytes: 256; ^[A-Za-z0-9_-]{16,256}$ | - |
校验规则
仅接受查询参数,不接受请求体。拒绝未知、重复、空值或无效参数。仅支持 JSON 响应,不自动翻页或重试。下列规则中 AND 表示同时提供,OR 表示任一,XOR 表示二选一,NOT 表示不能提供,=> 表示需要。
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/min_price <= max_pricecheck_in_date AND check_out_date: supply both or neither; valid YYYY-MM-DD dates; check_out_date > check_in_datequery OR property_token OR next_page_token: requiredadults (default 2) + children <= 100; children_ages: comma-separated ages 0..17; count = childrenbedrooms OR bathrooms => vacation_rentals = true; vacation_rentals = true => NOT brandsTokens: copy the exact token from a fresh response; do not invent or reuse expired tokens; each page or token lookup is a separate billable successful request
示例
curl --get "https://api.apihop.ai/v1/google-hotels/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "currency=USD" \
--data-urlencode "query=hotels in New York"Google Hotels: 查询酒店建议
GET https://api.apihop.ai/v1/google-hotels/autocomplete
请求参数
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
query | string | 搜索词; query: REQUIRED | New York |
country | string | 国家或站点代码 (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | 语言; language: optional | - |
limit | integer | 结果上限; limit: optional; min: 1; max: 100 | 1 |
device | string | 设备; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不归档响应产物; zero_trace: optional | true |
currency | string | 货币代码 (currency); currency: optional; ALL, DZD, ARS, AMD, AWG, AUD, AZN, BSD, BHD, BYN, BMD, BAM, BRL, GBP, BGN, XPF, CAD, CLP, CNY, COP, CRC, CUP, CZK, DKK, DOP, EGP, EUR, GEL, HKD, HUF, ISK, INR, IDR, IRR, ILS, JMD, JPY, JOD, KZT, KWD, LBP, MKD, MYR, MXN, MDL, MAD, TWD, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, RSD, SGD, ZAR, KRW, SEK, CHF, THB, TRY, USD, UAH, AED, VND; ^[A-Z]{3}$ | ALL |
校验规则
仅接受查询参数,不接受请求体。拒绝未知、重复、空值或无效参数。仅支持 JSON 响应,不自动翻页或重试。下列规则中 AND 表示同时提供,OR 表示任一,XOR 表示二选一,NOT 表示不能提供,=> 表示需要。
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/
示例
curl --get "https://api.apihop.ai/v1/google-hotels/autocomplete" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=New York"Google Hotels: 查询酒店照片
GET https://api.apihop.ai/v1/google-hotels/photos
请求参数
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
id | string | 从酒店搜索结果复制的酒店标识 (id); id: REQUIRED | ChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ |
country | string | 国家或站点代码 (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | 语言; language: optional | - |
limit | integer | 结果上限; limit: optional; min: 1; max: 100 | 1 |
device | string | 设备; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不归档响应产物; zero_trace: optional | true |
next_page_token | string | 下一页令牌; next_page_token: optional; UTF-8 bytes: 24576 | - |
校验规则
仅接受查询参数,不接受请求体。拒绝未知、重复、空值或无效参数。仅支持 JSON 响应,不自动翻页或重试。下列规则中 AND 表示同时提供,OR 表示任一,XOR 表示二选一,NOT 表示不能提供,=> 表示需要。
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/Tokens: copy the exact token from a fresh response; do not invent or reuse expired tokens; each page or token lookup is a separate billable successful request
示例
curl --get "https://api.apihop.ai/v1/google-hotels/photos" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "id=ChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ"Google Hotels: 查询酒店评论
GET https://api.apihop.ai/v1/google-hotels/reviews
请求参数
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
id | string | 从酒店搜索结果复制的酒店标识 (id); id: REQUIRED | ChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ |
next_page_token | string | 下一页令牌; next_page_token: optional; UTF-8 bytes: 24576 | - |
sort_by | string | 排序; sort_by: optional; relevance, newest, highest_rating, lowest_rating | relevance |
country | string | 国家或站点代码 (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | 语言; language: optional | - |
limit | integer | 结果上限; limit: optional; min: 1; max: 10 | 10 |
device | string | 设备; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不归档响应产物; zero_trace: optional | true |
category_token | string | 从最新响应复制的选择令牌 (category_token); category_token: optional; UTF-8 bytes: 2800; ^[A-Za-z0-9_-]+$ | - |
source_number | integer | 住宿条件筛选 (source_number); source_number: optional; min: -1; max: 2147483647 | -1 |
校验规则
仅接受查询参数,不接受请求体。拒绝未知、重复、空值或无效参数。仅支持 JSON 响应,不自动翻页或重试。下列规则中 AND 表示同时提供,OR 表示任一,XOR 表示二选一,NOT 表示不能提供,=> 表示需要。
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/Tokens: copy the exact token from a fresh response; do not invent or reuse expired tokens; each page or token lookup is a separate billable successful request
示例
curl --get "https://api.apihop.ai/v1/google-hotels/reviews" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "id=ChgI-N6n0Nnyw_K2ARoLL2cvMXRqZGgzMjkQAQ" \
--data-urlencode "limit=10"响应与错误
保留原生 JSON 响应和数字精度。下方仅为空成功结果示例,不是真实调用。HTTP 400 表示输入无效;401 需要认证;402 余额不足;403 不可用或无权限;405 方法不支持;429 限流;5xx 服务或上游故障。请保留 X-Request-Id 以便排查。
{
"success": true,
"request_id": "example-request",
"data": {
"format": "json",
"content": {
"results": []
}
}
}