> ## Documentation Index
> Fetch the complete documentation index at: https://docs.socq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 酒店价格追踪

> 从 Google Hotels 获取一家酒店未来几周每个入住日期的最低每晚价格。

# 酒店价格追踪

就是 Google Hotels 日期选择器背后的那张价格日历，按行返回。查询一家酒店，得到每个入住日期一晚的最低价，通常从入住日起覆盖六到八周。用它找出最便宜的出行日期，画出酒店周末和工作日的价差，或者给收益经理做竞争价格报告。

```json theme={"dark"}
{
  "hotel_id": "ChoIyKbJ6puqvPf8ARoNL2cvMTFqNHR2MjczeBAB",
  "currency": "USD"
}
```

通过 hotel\_id 提供 Google 酒店搜索结果中 id 字段的值。check\_in 决定日历的起始日期（不传时从明天开始），需与 check\_out 一起提供。每次请求计 4 积分；每行是一个入住日期及其一晚的价格。

## 标准结果字段

任务结果使用下方稳定的 SocQ 字段。系统会统一来源特有的字段名和格式，但不会推断或补充来源未提供的数据。如需缩小返回字段集合，MCP 查询使用 `fields`，Typed 工具使用 `_result_fields`，CLI 使用 `--result-fields`。声明字段的值为 `null` 时仍会保留。

| 字段 | 类型 | 可空 | 说明 |
| - | - | - | - |
| `id` | `string` | 是 | 酒店 ID 与入住日期，例如 `ChoI...:2026-12-10`。 |
| `platform` | `string` | 否 | 结果所属的平台，例如 `instagram` 或 `linkedin`。 |
| `resource` | `string` | 否 | 该结果对应的 SocQ 资源，例如 `videos` 或 `comments`。 |
| `type` | `string` | 否 | 结果项的类别，例如 `video`、`post` 或 `comment`。 |
| `url` | `string` | 是 | 酒店在 Google Hotels 上的地址。 |
| `published_at` | `string` | 是 | 源内容的发布时间（如可获得），使用 ISO 8601 格式。 |
| `collected_at` | `string` | 否 | SocQ 采集或处理该结果的时间，使用 ISO 8601 格式。 |
| `hotel_id` | `string` | 是 | 价格所属的酒店 ID。 |
| `name` | `string` | 是 | 酒店名称。 |
| `check_in` | `string` | 是 | 入住日期，格式为 YYYY-MM-DD。 |
| `check_out` | `string` | 是 | 离店日期，格式为 YYYY-MM-DD。 |
| `price` | `object` | 是 | 该晚的最低价格。 |
| `price.amount` | `number` | 是 | 价格数值。 |
| `price.currency` | `string` | 是 | 价格的三位币种代码。 |
| `price.formatted` | `string` | 是 | 带币种代码的价格，例如 `USD 176`。 |

以下示例展示任务完成后的响应格式，具体数据以实际查询结果为准。

## 任务完成响应

```json theme={"dark"}
{
  "code": 200,
  "data": {
    "task_id": "example-google-hotels-hotel-prices",
    "status": "succeeded",
    "public_id": "google-hotels/hotel-prices",
    "result_count": 1,
    "credits_amount": 4,
    "results": {
      "limit": 50,
      "next_cursor": null,
      "has_more": false,
      "schema_id": "hotel-price",
      "schema_version": "1.0",
      "items": [
        {
          "id": "ChoIyKbJ6puqvPf8ARoNL2cvMTFqNHR2MjczeBAB:2026-11-18",
          "platform": "google-hotels",
          "resource": "hotel-prices",
          "type": "hotel-price",
          "url": "https://www.google.com/travel/hotels/entity/ChoIyKbJ6puqvPf8ARoNL2cvMTFqNHR2MjczeBAB",
          "published_at": null,
          "collected_at": "2026-11-17T23:54:23.792170Z",
          "hotel_id": "ChoIyKbJ6puqvPf8ARoNL2cvMTFqNHR2MjczeBAB",
          "name": "The Rockaway Hotel",
          "check_in": "2026-11-18",
          "check_out": "2026-11-19",
          "price": {
            "amount": 206,
            "currency": "USD",
            "formatted": "USD 206"
          }
        }
      ]
    }
  }
}
```


## OpenAPI

````yaml zh/api-manual/agent-api/agent-api.json POST /v1/google-hotels/hotel-prices
openapi: 3.1.0
info:
  title: SocQ Agent API 中文版
  version: v1-87892a6484c2
  description: 根据 SocQ 能力目录生成的异步社交数据 API。
servers:
  - url: https://api.socq.ai
security: []
paths:
  /v1/google-hotels/hotel-prices:
    post:
      tags:
        - google-hotels
      summary: 酒店价格追踪
      description: 从 Google Hotels 获取一家酒店未来几周每个入住日期的最低每晚价格。
      operationId: socq_google_hotels_hotel_prices
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              additionalProperties: false
              properties:
                callback_url:
                  type: string
                  format: uri
                  description: 可选的任务完成回调 URL。
                check_in:
                  type: string
                  pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
                  description: 入住日期，格式为 YYYY-MM-DD，默认明天；需与 check_out 一起提供。
                check_out:
                  type: string
                  pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
                  description: 离店日期，格式为 YYYY-MM-DD，需晚于 check_in，最长 30 晚。
                currency:
                  type: string
                  pattern: ^[A-Za-z]{3}$
                  description: 价格币种的三位代码，例如 USD 或 EUR。
                hotel_id:
                  type: string
                  minLength: 1
                  description: Google 酒店搜索结果中 id 字段的酒店 ID。
                language_code:
                  type: string
                  minLength: 2
                  maxLength: 10
                  default: en
                  description: 结果的语言代码，默认 en。
                location_code:
                  type: integer
                  minimum: 1
                  description: 搜索市场的位置代码，默认 2840（美国）。
                  default: 2840
              required:
                - hotel_id
              description: >-
                通过 hotel_id 提供 Google 酒店搜索结果中 id 字段的值。check_in
                决定日历的起始日期（不传时从明天开始），需与 check_out 一起提供。每次请求计 4
                积分；每行是一个入住日期及其一晚的价格。
      responses:
        '200':
          description: 任务已受理
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSubmitResponse'
        '422':
          description: Input validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentValidationErrorResponse'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    AgentSubmitResponse:
      type: object
      properties:
        code:
          type: integer
          const: 200
          description: HTTP 业务状态码。
        data:
          type: object
          properties:
            task_id:
              type: string
              description: 任务 ID，用于查询任务状态和结果。
            status:
              type: string
              description: 任务当前状态。
            created_time:
              type:
                - string
                - 'null'
              description: 任务创建时间。
          required:
            - task_id
            - status
    AgentValidationErrorResponse:
      type: object
      properties:
        code:
          type: integer
          const: 422
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            details:
              type: object
          required:
            - message
            - type
      required:
        - code
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: '使用 `Authorization: Bearer <token>` 请求头进行身份验证。'
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 也可以通过 `x-api-key` 请求头提供 API Key。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.