# 微信公众号 公众号主体信息 API (wechat_oa.account_principal)

- Canonical page: [https://everyinfra.com/wechat-oa-api/account_principal](https://everyinfra.com/wechat-oa-api/account_principal?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "wechat_oa", "action": "account_principal", "params": {...}}
- Price: $0.005556 per call ($5.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

公众号主体信息按 `account` 读取一个公众号背后的主体：认证主体的公司名称 `company_name`、运营者名称 `owner_name`、主体类型 `customer_type`，认证状态、类型和时间，注册国家和时间，以及是否为境外主体。合作前核对账号背景、整理名单时区分企业号与个人号，读它即可。

`account` 可以填公众号的微信号、gh_ 开头的原始 ID，或能解析出公众号的账号链接、文章链接。`customer_type` 分个人、企业、政府、媒体四类；`authorized_agents` 是授权代理机构，`last_login_province` 是最近登录省份。头像和订阅号、服务号类型不在这里，去公众号资料那一页取。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| account | not declared | yes | not declared | 公众号标识，可用微信号、gh_ 开头的原始 ID，或可解析公众号的账号/文章 URL；不是个人微信号。account_principal 取主体资料，account_articles 取历史文章列表，account_today_articles 取当日文章。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| account_id | 公众号 ID。 |
| ghid | 同 account_ghid。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| description | 简介或描述，通常比 text 短。 |
| company_name | 认证主体的公司名称。 |
| owner_name | 运营者名称。 |
| customer_type | 主体类型（个人 / 企业 / 政府 / 媒体）。 |
| verify_status | 认证状态。 |
| verify_type | 认证类型。 |
| verified_at | 认证时间。 |
| registered_country | 注册国家。 |
| registered_at | 注册时间。 |
| is_overseas | 是否为境外主体。 |
| last_login_province | 最近登录省份。 |
| authorized_agents | 授权代理机构。 |
| 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": "wechat_oa",
  "action": "account_principal",
  "params": {
    "account": "36氪"
  }
}'
```

```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": "wechat_oa",
        "action": "account_principal",
        "params": {
            "account": "36氪",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-24T19:16:38Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "wechat_oa",
  "action": "account_principal",
  "results": {
    "ghid": "gh_240fbf8b33e4",
    "name": "36氪",
    "company_name": "北京多氪信息科技有限公司",
    "verify_status": true,
    "platform": "wechat_oa"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `account` 能填个人微信号吗？

不能。`account` 要填的是公众号：公众号的微信号、gh_ 开头的原始 ID，或能解析出公众号的账号链接、文章链接。历史文章列表和当日文章另有各自的接口，这个接口只取主体资料。

### 怎么判断一个公众号是不是境外主体？

读 `is_overseas`，它直接标明是否为境外主体，不用自己从别的字段推断。`registered_country` 是注册国家，`last_login_province` 是最近登录省份；`verified_at` 和 `registered_at` 分别是认证时间和注册时间，两个时间相减就是注册后多久完成的认证。

### 想要公众号头像和账号类型，读这个接口行吗？

不行。这个接口不返回头像链接、订阅号或服务号的账号类型，也不返回文章链接里带的 __biz 标识。这三项在公众号资料那一页，两个接口的必填参数都是 `account`，同一个值可以直接换着调。

## Also

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