# Google 购物 关键词搜索 API (google_shopping.search)

- Canonical page: https://everyinfra.com/google-shopping-api/search
- Endpoint: POST /api/v1/social with {"platform": "google_shopping", "action": "search", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed and empty results are not charged
- Returns: list, default 20, max 100 per call
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=google_shopping&action=search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 商品搜索词（如 wireless earbuds）。 |
| country | not declared | no | not declared | 按哪个国家的 Google 购物搜，两位国家代码（如 us、gb、de），默认 us；价格的货币跟着它。 |
| language | not declared | no | not declared | 结果语言，两位语言代码（如 en、de），默认 en。 |
| max_price | not declared | no | not declared | 最高价，不低于 min_price。 |
| min_price | not declared | no | not declared | 最低价，按 country 的货币，不小于 0。 |
| sort | not declared | no | not declared | 排序：price_low（价格从低到高）、price_high（从高到低）、rating（评分从高到低）；不填按相关度。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| rank | 该商品在这次搜索结果里的名次，从 1 开始。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| product_id | Google 购物的商品聚合 ID（纯数字），同一款商品各商家的报价归在它下面；个别结果没有。 |
| offer_id | 这一行展示的那个商家报价的 ID（纯数字）。 |
| image_id | 这一行主图的 ID（纯数字）。 |
| price_text | 价格原文，带货币符号和当地写法（如 $29.99、Rp 419.000）。 |
| price | price_text 解析出的数值，货币按搜索的国家（country）；不带货币单位。 |
| old_price_text | 划线原价原文；没有打折就不出现。 |
| old_price | old_price_text 解析出的数值。 |
| merchant | 这一行报价的商家名。 |
| multiple_merchants | 是否有多个商家卖这款商品（true 时 Google 购物页上能比价）。 |
| rating | 商品评分，1–5。 |
| rating_scale | 上一列 `rating` 的满分。5 表示五星制、10 表示十分制。只在该行有 rating 时出现。 |
| review_count | 商品评价数。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| url | 该记录在原平台上的可访问链接。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "google_shopping",
  "action": "search",
  "params": {
    "keyword": "wireless earbuds"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "google_shopping",
        "action": "search",
        "params": {
            "keyword": "wireless earbuds",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "google_shopping",
  "action": "search",
  "results": [
    {
      "rank": …,
      "title": …,
      "product_id": …,
      "offer_id": …,
      "image_id": …,
      "price_text": …,
      "price": …,
      "old_price_text": …,
      "old_price": …,
      "merchant": …,
      "multiple_merchants": …,
      "rating": …,
      "rating_scale": …,
      "review_count": …,
      "image_url": …,
      "url": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=google_shopping
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
