# 微信公众号 公众号资料 API (wechat_oa.account_profile)

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

公众号资料按 `account` 读取单个公众号的基本档案：名称 `name`、简介 `description`、账号类型 `account_type`、头像链接 `avatar_url`，以及文章链接里带的 `biz` 标识。建公众号库、给一批文章补上所属账号、在页面里放账号卡片，拿的都是这几项。只有公众号名称时，先用公众号搜索拿候选，再来读这里。

带 __biz 的文章链接可以按 `biz` 对到账号。`avatar_url` 有时是带尺寸参数的 CDN 链接，可能有时效，要长期展示请自己转存。公司名称、运营者和认证信息不在这个接口里，需要时读公众号主体信息，传同一个 `account` 即可。

## Health

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

## 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。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| account_type | 账号类型（订阅号 / 服务号）。 |
| description | 简介或描述，通常比 text 短。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| biz | 公众号的 __biz 参数，文章链接里带的标识。 |
| 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_profile",
  "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_profile",
        "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_profile",
  "results": {
    "account_id": "gh_240fbf8b33e4",
    "name": "36氪",
    "account_type": "订阅号",
    "platform": "wechat_oa"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `biz` 是什么，拿来做什么？

`biz` 是公众号的 __biz 参数，文章链接里带着同一个标识。手里有一批带 __biz 的文章链接、要判断它们属于哪个公众号时，把链接里的值和这个字段对照就行。公众号搜索的结果里也带 `biz`，所以先搜索、再按 `biz` 对到账号，这条路是通的。

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

订阅号和服务号两类。需要区分这两种账号时，直接读 `account_type`，不必再去名称或简介里猜。公众号搜索的候选列表里没有这一项，要这个信息只能来读公众号资料。

### `avatar_url` 能长期使用吗？

不保证。它是头像图片链接，有时是带尺寸参数的 CDN 链接，可能有时效。需要长期展示，就在拿到后下载保存，不要把它当永久地址写进库里。公众号搜索的列表里也带头像链接，批量取头像时可以先搜后存。

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