WeChat-Media-Platform-V2-API

获取公众号资料页/Get WeChat MP Account Profile

Changed on

[中文]

用途:

  • 传公众号 username,返回公众号资料页:昵称 / IP 属地 / 原创文章数 / 认证主体类型 / 关联视频号等。
  • ⚠️ 签名(简介)与头像这条路取不到 —— 微信的资料页响应里既没有可读简介也没有头像。 它们恒为 null 并列在 $.data.unavailable[] 里,不会用空串冒充,调用方可据此区分 「这个号真的没填」和「这条路取不到」。
  • 💡 头像请改用 /fetch_article_detail_h5(传该号的任意一篇文章链接,raw=true): $.data.content.round_head_img(普通)/ $.data.content.hd_head_img(高清)。 那条路确实有值,已实测。简介目前没有任何接口能取到。
  • 价格:0.01$/次
  • ⏱️ 由于微信服务器原因,本接口响应较慢,请将客户端请求超时(timeout)设置为 30 秒;timeout 设置过小会造成已扣费但收不到响应的情况。

参数:

  • username: 公众号 username。三种形态都支持:gh_…、gh_…@app(关联小程序的账号)、自定义微信号(如 nikejdi)。来源:文章详情 content.user_name、或微信搜索 V2 fetch_search(business_type=account)结果的 jumpInfo.userName。示例 gh_363b924965e9
  • raw: 可选,默认 True。True=原始;False=精简解析。

返回:

  • 公众号资料页信息

响应结构与 JSON Path:

raw=false(精简解析,snake_case):

  • 公众号 username: $.data.user_name
  • 昵称: $.data.nick_name(如 量子位 / NIKE)
  • 用户角色: $.data.user_role
  • 服务类型(订阅号 / 服务号代码): $.data.service_type
  • 封禁类型(0=正常): $.data.ban_type
  • IP 属地: $.data.ip_wording(如 北京 海淀)
  • 原创文章数: $.data.original_article_count / $.data.original_content_str
  • 关联视频号: $.data.finder_nickname / $.data.finder_username (后者可直接喂视频号系列接口)
  • 取不到的字段清单: $.data.unavailable[](当前恒含 signature / head_url)
  • 签名 / 简介: $.data.signature —— 恒为 null,见上方说明
  • 头像: $.data.head_url —— 恒为 null;改用 /fetch_article_detail_h5 的 $.data.content.round_head_img / hd_head_img

raw=true(原始,本接口默认):

  • data 为完整原始响应(几十个顶层字段),精简版字段对应其中嵌套位置:
    • 基础信息块: $.data.baseInfo(原创文章数 / 订阅状态等;不含昵称 / 头像 / 简介)
    • 昵称原始来源: $.data.nameCard.buffer(protobuf,精简层已解出 nick_name)
    • 账号信息: $.data.accountInfo(含 userName 等)
    • 统计信息: $.data.statInfo
    • 关联视频号: $.data.videoFinderInfo
    • 服务信息(自定义菜单原始来源): $.data.serviceInfo
    • 文章 Tab / 消息列表: $.data.articleTab / $.data.msgList
    • IP 属地: $.data.ipwording
    • 其余: liveInfo / nameCard / gender / setting / funcFlag 等

[English]

Purpose:

  • Pass an account username to get the profile: nickname / IP region / original article count / verification entity type / linked Channels account, etc.
  • NOTE: signature and avatar are not obtainable through this path — WeChat's profile response carries neither. They are always null and listed in $.data.unavailable[] (never faked as empty strings).
  • For the avatar, use /fetch_article_detail_h5 instead (pass any article URL of that account with raw=true): $.data.content.round_head_img / $.data.content.hd_head_img. No endpoint currently exposes the signature.
  • Some accounts (like the example) have sparse fields; nick_name / signature / head_url may be null.
  • Price: $0.01 per request
  • ⏱️ Due to WeChat server latency, this endpoint responds slowly; please set your client request timeout to 30 seconds — a timeout that is too small may result in being billed without receiving the response.

Parameters:

  • username: Official account gh_username (gh_…). Sources: content.user_name from article detail, or jumpInfo.userName from WeChat Search V2 fetch_search (business_type=account) results. E.g. gh_363b924965e9
  • raw: Optional, default True. True=raw; False=simplified parsing.

Return:

  • Official account profile info

Response structure & JSON Path:

raw=false (simplified, snake_case):

  • Account username (gh_…): $.data.user_name
  • Nickname (may be null): $.data.nick_name
  • User role: $.data.user_role
  • Service type (subscription / service account code): $.data.service_type
  • Signature / description (may be null): $.data.signature
  • Avatar (may be null): $.data.head_url
  • Ban type (0=normal): $.data.ban_type

raw=true (raw, default for this endpoint):

  • data is the full raw response (dozens of top-level fields); simplified fields map to nested locations:
    • Base info block: $.data.baseInfo (raw source of nickname / avatar / description)
    • Account info: $.data.accountInfo (with userName etc.)
    • Stats info: $.data.statInfo
    • Linked Channels account: $.data.videoFinderInfo
    • Service info (raw source of custom menu): $.data.serviceInfo
    • Article tab / message list: $.data.articleTab / $.data.msgList
    • IP region: $.data.ipwording
    • Others: liveInfo / nameCard / gender / setting / funcFlag etc.
post/api/v1/wechat_mp/v2/fetch_account_profile

Request

  • Base URL
    https://api.tikhub.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Request body

usernamestring required

公众号 username。三种形态都支持:gh_…、gh_…@app(关联小程序的账号)、以及自定义微信号(如 nikejdi)。取自文章详情接口响应的 $.data.content.user_name/Official account username. Three forms are supported: gh_…, gh_…@app (mini-program-linked accounts) and custom WeChat IDs (e.g. nikejdi). Taken from $.data.content.user_name of the article detail endpoints

rawboolean

True=原始响应;False=精简解析结构/True=raw response; False=simplified parsed structure

Example request

{
  "username": "gh_363b924965e9"
}

Response

Successful Response

codeinteger

HTTP status code | HTTP状态码

request_idstring nullable

Unique request identifier | 唯一请求标识符

messagestring

Response message (EN-US) | 响应消息 (English)

message_zhstring

Response message (ZH-CN) | 响应消息 (中文)

supportstring

Support message | 支持消息

timestring

The time the response was generated | 生成响应的时间

time_stampinteger

The timestamp the response was generated | 生成响应的时间戳

time_zonestring

The timezone of the response time | 响应时间的时区

docsstring nullable

Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接

cache_messagestring nullable

Cache message (EN-US) | 缓存消息 (English)

cache_message_zhstring nullable

Cache message (ZH-CN) | 缓存消息 (中文)

cache_urlstring nullable

The URL to access the cached result | 访问缓存结果的 URL

routerstring

The endpoint that generated this response | 生成此响应的端点

paramsunknown
dataunknown

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • warning

      changed the pattern of the request property from ^gh_[A-Za-z0-9_]+$ to ^[0-9A-Za-z][-_0-9A-Za-z]{1,63}(@[0-9A-Za-z]{1,16})?$

    • info

      the request property's maxLength was increased from 64 to 80