# Pinterest 搜索细分词 API (pinterest.search_refinements)

- Canonical page: [https://everyinfra.com/pinterest-api/search_refinements](https://everyinfra.com/pinterest-api/search_refinements?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "pinterest", "action": "search_refinements", "params": {...}}
- Price: $0.001597 per call ($1.6 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- 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=pinterest&action=search_refinements

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 搜索词，最多 100 个字；返回 Pinterest 给这个词的细分词和导购词。 |
| scope | enum: pins / products | no | not declared | pins（默认，图钉搜索的细分）或 products（商品搜索的细分，另有品牌、商家、价格区间）。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| keyword | 关键词：search_suggest 里是联想出的词（推荐账号的行是账号名）；search_refinements、keyword_audience 里是问的那个词；related_keyword_trends 里是相关的搜索词。 |
| scope | 这份细分是哪种搜索的：pins 或 products。 |
| related_searches | 相关细分词（一般 25 个），每项有 label、keyword、image_url；keyword 拿去给 search、product_search 就是对应的结果。 |
| guides | 分组导购词，如 Style 下的 Modern、Vintage：每组有 name 和 options（每项有 label、keyword）。 |
| brands | 品牌（只在 scope=products 时有）：每项有 brand_id、name、image_url。 |
| retailers | 商家（只在 scope=products 时有）：每项有 domain、name、image_url、is_verified；domain 能拿去给 product_search 的 retailer。 |
| price_range | 价格区间（只在 scope=products 时有）：min、max、suggested_max 和币种 currency。 |
| collected_at | 这条数据的抓取时刻（ISO 8601，UTC）。 |
| 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": "pinterest",
  "action": "search_refinements",
  "params": {
    "keyword": "sofa"
  }
}'
```

```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": "pinterest",
        "action": "search_refinements",
        "params": {
            "keyword": "sofa",
        },
    },
    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": "pinterest",
  "action": "search_refinements",
  "results": {
    "keyword": …,
    "scope": …,
    "related_searches": …,
    "guides": …,
    "brands": …,
    "retailers": …,
    "price_range": …,
    "collected_at": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

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