# 公司数据 同行与竞争对手 API (company_data.peers)

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

同行与竞争对手按 `domain` 返回一家公司的竞争格局，例如 canva.com：每家对手带名称 `name`、一段对比说明 `description` 和关系类型 `peer_type`。`peer_type` 区分直接同行 direct_peer 和大厂对手 broad_incumbent 等，梳理竞品时可以先按它分组。

结果行里没有域名字段，要拿某个对手的主域名，把 `name` 交给品牌检索那一页。这个接口只回答「还有谁在做同样的事」，不含总部、员工数和融资。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| domain | not declared | yes | not declared | 要找同行的公司域名，例如 canva.com；返回直接同行和大厂对手，每家带一段对比说明。 |
| limit | integer (1–50) | no | 20 | 这次调用最多返回的条数，整数，1–50；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| description | 简介或描述，通常比 text 短。 |
| peer_type | 和所查公司的关系（peers）：direct_peer（直接同行）、broad_incumbent（大厂对手）等。 |
| 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": "company_data",
  "action": "peers",
  "params": {
    "domain": "stripe.com"
  }
}'
```

```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": "company_data",
        "action": "peers",
        "params": {
            "domain": "stripe.com",
        },
    },
    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": "company_data",
  "action": "peers",
  "results": [
    {
      "name": …,
      "description": …,
      "peer_type": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `peer_type` 有哪些取值？

`peer_type` 说明对手和所查公司的关系，已知的有 direct_peer（直接同行）和 broad_incumbent（大厂对手），也可能出现别的值。接入时对没见过的取值保留原文，不要当成错误丢掉。

### 为什么结果里没有对手的域名？

这个接口每行只有 `name`、`description`、`peer_type` 和 `platform`，不含域名。要某个对手的主域名，把 `name` 交给品牌检索，它返回主域名、所属国家和官网语言；品牌检索的关键词收品牌名，所以这一步不用自己拼域名。

### 同行与竞争对手怎么和关键词搜索搭配？

先用关键词搜索按一句话描述找到一批公司，拿到它们的 `domain`，再逐个交给同行与竞争对手，看各自的对手是谁。这个接口不含总部、员工数、融资这些字段，需要时回到关键词搜索读。

## Also

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