360 Secure SkillHub
360 安全技能中心

Google Hotels API - Hotel Search, Rates, Ratings, Amenities

通过 Scavio 调用 Google Hotels 搜索接口,按目的地、入住/退房日期及价格、评分、星级、设施等条件查询住宿,并可凭 detail_token 获取各预订网站的每晚与总价,结果以结构化 JSON 返回。需要 SCAVIO_API_KEY。

分类:生活
scavio-ai
scavio-ai
热度 17.33
最近更新 2026-11-29 16:19:24

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add scavio-ai/google-hotels-api
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
google-hotels-api
description
Search Google Hotels for a destination and dates, then fetch per-property booking-site prices — as structured JSON. Price, rating, class, and amenity filters. v2 engine, 1 credit per request.
version
1.0.0
tags
google-hotels, hotels, travel, lodging, accommodation, vacation-rentals, booking, agents, langchain, crewai, autogen, structured-data, json, ai-agents
metadata
{"openclaw":{"requires":{"env":["SCAVIO_API_KEY"]},"primaryEnv":"SCAVIO_API_KEY","timeout":90,"throttle":1,"emoji":"🏨","homepage":"https://scavio.dev/docs/google-hotels?utm_source=agent-skills&utm_medium=skill&utm_campaign=google-hotels-api"}}

Google Hotels via Scavio (v2)

Search Google Hotels for a destination and stay dates, then open any property for its per-vendor booking prices — all as structured JSON. Property details (rating, class, amenities, GPS, check-in times) come from the search call. Two endpoints, each 1 credit.

When to trigger

Use this skill when the user asks to:

  • Find hotels or vacation rentals for a destination and dates
  • Compare lodging by price, rating, class, or amenities
  • Get booking-site prices for a specific property

Setup

Get a free API key at scavio.dev (50 free credits to get started, no card required):

export SCAVIO_API_KEY=sk_live_your_key

If you do not have a key yet

An agent running this skill without SCAVIO_API_KEY set will get 401 on every call below. The whole path from nothing to a working key is self-serve:

  1. Sign up at dashboard.scavio.dev - email or Google, no card required.
  2. A key is created for the account automatically at signup. It is on the dashboard under API Keys, ready to copy.
  3. A new account starts with 50 credits. Endpoints in this skill cost 1 credit each unless the table below says otherwise.

When the balance runs out the API answers 402 with a JSON body carrying billing_url. Topping up needs no code change - the same key keeps working. The smallest purchase is 2,500 credits for $25, and monthly plans work out cheaper per credit if the usage is steady rather than one-off.

Endpoints

Endpoint Credits Description
POST https://api.scavio.dev/api/v2/google/hotels 1 Search lodging, returns properties[]
POST https://api.scavio.dev/api/v2/google/hotels/detail 1 Booking-site prices per vendor, returns property.booking_sources[]
Authorization: Bearer $SCAVIO_API_KEY

Workflow

  1. Search: call /hotels with query (use the "<City> hotels" form), check_in_date, and check_out_date. Filter with price, rating, class, and amenities.
  2. Read properties[]; each has a name, price (nightly: display, amount, currency), total_rate (whole stay), overall_rating, hotel_class, amenities, and a detail_token.
  3. Vendor prices: call /hotels/detail with a property's detail_token and the same stay dates. It returns property with only detail_token and booking_sources[] (one row per booking site: name, rate_per_night, total_rate, sponsored on ads). Keep the property details from the search result.
  4. Page more results with next_page_token from the search response.

Hotels Search Parameters

Parameter Type Default Description
query string required Use the "<City> hotels" form (e.g. Bali hotels)
check_in_date string required Check-in YYYY-MM-DD
check_out_date string required Check-out YYYY-MM-DD
sort_by number -- 3 lowest price, 8 highest rating, 13 most reviewed
min_price number -- Minimum nightly price
max_price number -- Maximum nightly price
rating number -- 7 (3.5+), 8 (4.0+), 9 (4.5+)
hotel_class string -- Comma-separated 2-5 (e.g. 4,5)
amenities string -- Amenity filter ids
property_types string -- 12 = vacation rentals
free_cancellation boolean -- Only free-cancellation offers
eco_certified boolean -- Only eco-certified properties
special_offers boolean -- Only special offers
next_page_token string -- Pagination cursor from a prior response
limit number -- Cap properties returned (1-20)
hl string -- UI language
gl string -- Geo country
currency string -- Currency code (e.g. USD)

Hotels Detail Parameters

Parameter Type Default Description
detail_token string required From a listing property's detail_token
check_in_date string required Check-in YYYY-MM-DD
check_out_date string required Check-out YYYY-MM-DD
currency string -- Currency code
gl string -- Geo country
hl string -- UI language

Example

import requests

BASE = "https://api.scavio.dev"
# Your key from https://scavio.dev. Load it from your environment or secret
# store in real code - keep it out of source control.
API_KEY = "sk_your_key_here"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}
DATES = {"check_in_date": "2026-10-01", "check_out_date": "2026-10-05"}

# 1. Search hotels, highest rated first
search = requests.post(f"{BASE}/api/v2/google/hotels", headers=HEADERS,
    json={"query": "Bali hotels", **DATES, "sort_by": 8, "rating": 8}).json()

prop = search["properties"][0]
print(prop["name"], prop.get("overall_rating"), prop.get("price", {}).get("display"))

# 2. Booking-site prices for that property
detail = requests.post(f"{BASE}/api/v2/google/hotels/detail", headers=HEADERS,
    json={"detail_token": prop["detail_token"], **DATES, "currency": "USD"}).json()
for src in detail["property"]["booking_sources"]:
    print(src["name"], src["rate_per_night"]["display"], src.get("sponsored", False))

Responses

Search returns properties[] plus pagination.next_page_token; detail returns property with detail_token and booking_sources[] only. Each also includes response_time, credits_used, credits_remaining, and cached. Trimmed live captures:

{
  "properties": [
    {
      "type": "hotel",
      "name": "Brown's | Avenue Hotel",
      "hotel_class": "5-star hotel",
      "extracted_hotel_class": 5,
      "overall_rating": 4.6,
      "reviews": 290,
      "amenities": [54, 29, 17, 22, 2, 23, 1, 31],
      "check_in_time": "3:00 PM",
      "check_out_time": "12:00 PM",
      "price": { "display": "$133", "amount": 132.85, "currency": "USD" },
      "total_rate": { "display": "$266", "amount": 266, "currency": "USD" },
      "detail_token": "Q2hrSWhMQ1F3dmpPMklZV0dnMHZaeTh4..."
    }
  ],
  "pagination": { "current_from": 1, "current_to": 3, "next_page_token": "eyJvZmZzZXQiOjE4fQ==" },
  "response_time": 2697,
  "credits_used": 1,
  "cached": false
}
{
  "property": {
    "detail_token": "Q2hrSWhMQ1F3dmpPMklZV0dnMHZaeTh4...",
    "booking_sources": [
      {
        "sponsored": true,
        "name": "Expedia.com",
        "id": 89,
        "rate_per_night": { "display": "$162", "amount": 162.3, "currency": "USD" },
        "total_rate": { "display": "$325", "amount": 324.59, "currency": "USD" }
      },
      {
        "name": "Agoda",
        "id": 100337601,
        "rate_per_night": { "display": "$133", "amount": 132.85, "currency": "USD" },
        "total_rate": { "display": "$266", "amount": 265.69, "currency": "USD" }
      }
    ]
  },
  "response_time": 1679,
  "credits_used": 1,
  "cached": false
}

Each booking source also carries icon and a relative click link.

Guardrails

  • Each call costs 1 credit.
  • Never fabricate property names, ratings, prices, or vendors. Only return API data.
  • The detail call needs a detail_token from a search result plus the same stay dates — always run /hotels first.
  • Prices reflect the requested currency; state the currency and the stay dates when quoting.

Failure handling

  • 400 means an invalid parameter (e.g. missing dates or detail_token) — fix and retry.
  • 401 means the API key is invalid or missing. Check SCAVIO_API_KEY.
  • 429 means rate or usage limit exceeded. Wait before retrying. See rate limits.
  • 502 / 503 mean upstream is temporarily unavailable. Wait a few seconds before retrying.
  • If no properties are returned, loosen price/rating/class filters or try different dates.
  • If SCAVIO_API_KEY is not set, prompt the user to export it before continuing.