# Google Play App 关键词排名 API (google_play.keywords_for_app)

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

Google Play App 关键词排名按 `app_id` 列出一个应用排得上的搜索词，每个词一行：关键词 `keyword`、搜索量 `search_volume`、应用在这个词的商店搜索结果里排第几 `search_rank`（从 1 开始），以及排名和搜索量最近一次更新的时间 `ranked_at`。它回答「这个应用靠哪些词被搜到、排得多靠前」，适合整理自家或对手的词表。

`app_id` 填 Android 包名，如 com.whatsapp，也可以直接填 play.google.com 的应用链接。默认 20 条，最多 100 条；`total_keywords` 是这个应用排得上的关键词总数，每行相同，`limit` 只决定这次给前多少个。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| app_id | not declared | yes | not declared | Android 应用包名，例如 com.spotify.music，即 Play 商店链接 ?id= 后的值；也可以直接填 play.google.com 的应用链接。不是 Apple App Store 的数字 ID。 |
| country | not declared | no | not declared | Google Play 店面国家/地区：只支持 us（美国站，默认），传别的国家在扣费前被拒。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限照收，按上限返回。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| keyword | platform-native meaning |
| search_volume | platform-native meaning |
| search_rank | 这个 App 在该关键词的商店搜索结果里排第几（keywords_for_app，从 1 开始）。 |
| search_result_count | platform-native meaning |
| ranked_at | 这个关键词的排名和搜索量最近一次更新的时间（keywords_for_app，ISO）；数据按周到按月刷新，不是实时。 |
| app_id | 应用包名（如 com.example.app），Google Play 的唯一标识。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| url | 该记录在原平台上的可访问链接。 |
| icon_url | 应用图标。 |
| developer | 开发者名称。 |
| rating | 评分。**分制随平台而异**，同一行的 `rating_scale` 给出该平台满分 (多数是 5，Booking/豆瓣/爱奇艺/NAVER 是 10)。跨平台比较前必须先按 rating_scale 换算 —— 直接比数字会得出反的结论。 |
| rating_scale | 上一列 `rating` 的满分。5 表示五星制、10 表示十分制。只在该行有 rating 时出现。 |
| rating_count | 参与评分的人数。null 表示不公开，不等于 0。 |
| is_free | 是否免费下载。 |
| price | 价格数值，不含货币符号；币种见 currency。 |
| currency | 价格币种代码（如 CNY、USD）。price 存在但 currency 为 null 时不要假定币种。 |
| total_keywords | 这个 App 一共有多少个排得上的关键词（keywords_for_app），或这组 App 一共有多少个共同关键词（keyword_intersection）；每行相同，limit 只决定这次给前多少个。 |
| 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": "keywords_for_app",
  "params": {
    "app_id": "com.whatsapp"
  }
}'
```

```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": "keywords_for_app",
        "params": {
            "app_id": "com.whatsapp",
        },
    },
    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": "keywords_for_app",
  "results": [
    {
      "keyword": …,
      "search_volume": …,
      "search_rank": …,
      "search_result_count": …,
      "ranked_at": …,
      "app_id": …,
      "title": …,
      "url": …,
      "icon_url": …,
      "developer": …,
      "rating": …,
      "rating_scale": …,
      "rating_count": …,
      "is_free": …,
      "price": …,
      "currency": …,
      "total_keywords": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 这些排名数据是实时的吗？

不是。`ranked_at` 是这个词的排名和搜索量最近一次更新的时间，数据按周到按月刷新。要做趋势就按固定间隔存档，用 `ranked_at` 判断两次读到的是不是同一批数据。

### `search_rank` 是 1 说明什么？

说明这个应用在该关键词的商店搜索结果里排第 1，名次从 1 开始，数字越大越靠后。把 `search_rank` 和 `search_volume` 放在一起看：搜索量大、名次靠前的词值得重点盯，搜索量大但名次靠后的词，是还没拿下的词。

### 和多个 App 共同关键词那一页比，该用哪个？

只关心一个应用自己的词表，用这一页；想知道几个应用在哪些词上同时出现、各自排第几，用共同关键词那一页，它把一组应用的名次放进同一行。这一页每行带应用的评分、开发者、图标等信息，共同关键词那一页没有。评分要先看同一行的 `rating_scale`。

## 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
