# Google Play 图书搜索 API (google_play.books)

- Canonical page: https://everyinfra.com/google-play-api/books
- Endpoint: POST /api/v1/social with {"platform": "google_play", "action": "books", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed and empty results are not charged
- Returns: list, default 20, max 40 per call (larger values are capped)
- 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_play&action=books

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 要搜的书名、作者或主题词，例如 atomic habits；搜的是 Google Play 图书，不是应用。 |
| country | not declared | no | not declared | Google Play 图书店面的国家/地区，两位字母代码，例如 us、gb、jp，默认 us；不同国家上架的书和价格不同。 |
| language | not declared | no | not declared | 结果的显示语言，例如 en（默认）、zh、ja；它不自动更换 country。 |
| limit | integer (1–40) | no | 20 | 这次调用最多返回的条数，整数，1–40；不传按默认值，实际返回可能少于这个数。超过上限照收，按上限返回。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| book_id | Google Play 图书 ID（books），图书详情页链接 ?id= 后的值。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| author | 作者（books）。 |
| url | 该记录在原平台上的可访问链接。 |
| format | 图书形式（books）：ebook 电子书、audiobook 有声书、series 系列。 |
| category | 分类名称，取值为原平台的分类体系，未做跨平台归一。 |
| rating | 评分。**分制随平台而异**，同一行的 `rating_scale` 给出该平台满分 (多数是 5，Booking/豆瓣/爱奇艺/NAVER 是 10)。跨平台比较前必须先按 rating_scale 换算 —— 直接比数字会得出反的结论。 |
| rating_scale | 上一列 `rating` 的满分。5 表示五星制、10 表示十分制。只在该行有 rating 时出现。 |
| price | 价格数值，不含货币符号；币种见 currency。 |
| currency | 价格币种代码（如 CNY、USD）。price 存在但 currency 为 null 时不要假定币种。 |
| cover_url | 封面图（books）。 |
| description | 简介或描述，通常比 text 短。 |
| 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_play",
  "action": "books",
  "params": {
    "keyword": "notes"
  }
}'
```

```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_play",
        "action": "books",
        "params": {
            "keyword": "notes",
        },
    },
    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_play",
  "action": "books",
  "results": [
    {
      "book_id": …,
      "title": …,
      "author": …,
      "url": …,
      "format": …,
      "category": …,
      "rating": …,
      "rating_scale": …,
      "price": …,
      "currency": …,
      "cover_url": …,
      "description": …,
      "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_play
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
