跳到导航

整理品牌公众号与视频号名单,怎样核对账号和关联关系?

查一个公众号关联的视频号:用 wechat_mp.v2.fetch_account_profile 和已核对的公众号 username 查询账号资料,再读 data.finder_username。要核对公众号背后的公司,先记录账号公开资料展示的主体信息,再去登记来源单独核验。筛合作账号时,比较可见的发文频率和头条阅读样本。粉丝数向号主单独核对。

用公众号标识查资料

已有文章详情时,从文章详情响应里取 data.content.user_name。只有显示名时,先找到一篇属于目标账号的公开文章,再核对账号标识。把核对过的 ID 填进下面资料请求的 username,返回的显示名留作参考。

curl --max-time 30 -sS https://api.beatapi.io/v1/social-data/call \
-H "Authorization: Bearer $BEATAPI_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"action":"wechat_mp.v2.fetch_account_profile","params":{"username":"<username>","raw":false}}' \
-o wechat-account-profile.json -w '%{http_code}\n'

拿到资料后,怎样整理账号名单?

先核对 data.user_name 是你要查的公众号。输入的是自定义微信号、响应返回的是规范账号 ID 时,把自定义微信号和规范账号 ID 分两列保留。再按下表处理关联信息:

看到什么怎样记、接下来怎么做
返回可用的 finder_username保留公众号标识、视频号标识、请求号和采集时间。要看作品,传给视频号作品目录。
只有同名视频号,或响应未返回关联标识公众号与视频号的关系记为待核,保留原始资料。
要回答公司归属或合作规模按下方的主体核对和头条抽样步骤操作,每一步分别保留来源。

例如,资料响应返回了明确的关联视频号 ID 时,通过公众号追品牌的文章,通过关联视频号追品牌的视频。报告里要写「运营主体为某公司」时,另附账号公开的主体信息和对应的登记记录。资料路线把简介 signature 和头像 head_url 列为不可获取;已保存的文章响应里有头像时,把头像和这份文章响应一起按来源保存。

具体能取哪些资料?

明确传 raw:false。供应商的资料说明在 data 下给出以下字段:

字段账号核对用途
user_name、nick_name稳定账号标识与显示名分开保存
user_role、service_type原始角色/服务代码,不编造成公司名称
ban_type账号状态代码;说明定义 0 为正常
ip_wording平台显示 IP 属地,不是公司注册地址
original_article_count、original_content_str原创内容信息,不是粉丝数或历史完整性证明
finder_username、finder_nickname明确关联的视频号标识与显示名
unavailable资料路线取不到的字段清单,与真实的零值分开

缺少粉丝字段不等于粉丝为零。不要用文章阅读数除以某个比例来估算准确粉丝数。服务类型代码或昵称同样不能证明公司归属。

从已保存资料生成公众号—视频号关联证据表

对十个指定公众号,当前交付的是公众号—视频号关联表;每周监控需要另外搭建。每份资料都用明确的 raw:false 请求。下面的 link_accounts.py 离线读取 1–10 份已保存的成功资料响应,把缺失、null、空字符串和不可获取的关联分别记成不同状态;只有 finder_username 符合已发布的视频号 username 合同时,才准备第一页视频请求。脚本不按同名搜索,也不联网。

在响应文件旁保存 profile-pages.json:

[{"action":"wechat_mp.v2.fetch_account_profile","params":{"username":"gh_example","raw":false},"http_status":200,"collected_at":"2026-11-17T09:00:00Z","response_file":"profile-1.json"}]

把下面的脚本保存为 link_accounts.py,运行 python3 link_accounts.py profile-pages.json account-link-review。profile-pages.json 里的路径相对于清单文件,输出目录必须尚不存在。失败或身份不一致的资料要在批量运行前先处理,不能默默删行。自定义别名和返回的规范 ID 各占一列。gh_ 身份(包括 @app 后缀)必须完全一致,不能删掉后缀绕过不一致。

import csv,hashlib,json,pathlib,re,sys
from datetime import datetime
manifest,out=map(pathlib.Path,sys.argv[1:3]);manifest_bytes=manifest.read_bytes();entries=json.loads(manifest_bytes)
if not isinstance(entries,list) or not 1<=len(entries)<=10:raise ValueError('Select 1–10 recorded profile requests')
ACTION='wechat_mp.v2.fetch_account_profile'
rows,sources,seen,requests=[],[],set(),set()
def valid_id(value):return isinstance(value,str) and len(value)<=80 and re.fullmatch(r'[0-9A-Za-z][-_0-9A-Za-z]{1,63}(@[0-9A-Za-z]{1,16})?',value)
def safe(value):
if value is None:return ''
value=str(value)
return "'"+value if value.startswith(('=','+','-','@','\t','\r','\n')) else value
for i,e in enumerate(entries,1):
params=e.get('params');requested=params.get('username') if isinstance(params,dict) else None
if e.get('action')!=ACTION or not isinstance(params,dict) or set(params)!={'username','raw'} or params['raw'] is not False or not valid_id(requested):raise ValueError('Use explicit simplified profile and valid username')
if type(e.get('http_status')) is not int or e['http_status']!=200:raise ValueError('Resolve failed profiles separately; do not silently omit an account')
collected=e.get('collected_at')
if not isinstance(collected,str) or datetime.fromisoformat(collected.replace('Z','+00:00')).tzinfo is None:raise ValueError('Record collection time with timezone')
raw=(manifest.parent/e['response_file']).read_bytes();body=json.loads(raw);data=body.get('data')
if body.get('action')!=ACTION or body.get('status')!='succeeded' or body.get('error') is not None or not isinstance(data,dict):raise ValueError('Invalid successful profile envelope')
rid=body.get('request_id')
if not isinstance(rid,str) or not rid.strip() or rid in requests:raise ValueError('Missing or duplicate request ID')
requests.add(rid);returned=data.get('user_name')
if not valid_id(returned):raise ValueError('Missing returned account identity')
if requested.startswith('gh_') and returned!=requested:raise ValueError('Canonical identity mismatch; do not normalize @app')
if returned in seen:raise ValueError('Repeated canonical account; select one observation')
seen.add(returned)
unavailable=data.get('unavailable',[])
if not isinstance(unavailable,list) or any(not isinstance(x,str) for x in unavailable):raise ValueError('Invalid unavailable flags')
finder=data.get('finder_username');name=data.get('finder_nickname')
if name is not None and not isinstance(name,str):raise ValueError('Invalid linked display name')
if 'finder_username' in unavailable:state='unavailable' if finder in (None,'') else 'inconsistent_unavailable'
elif 'finder_username' not in data:state='missing'
elif finder is None:state='null'
elif finder=='':state='empty'
elif isinstance(finder,str) and 10<=len(finder)<=256 and re.fullmatch(r'v2_[0-9a-fA-F]+@finder',finder):state='linked_identifier_returned'
else:state='unsupported_identifier'
next_request={'action':'wechat_channels.v2.fetch_user_videos','params':{'username':finder,'raw':False,'last_buffer':''}} if state=='linked_identifier_returned' else None
row={'requested_username':requested,'returned_username':returned,'identity_relation':'exact' if requested==returned else 'alias_returned_by_profile','profile_request_id':rid,'collected_at':collected,'finder_username_raw':json.dumps(finder,ensure_ascii=False),'finder_nickname_raw':json.dumps(name,ensure_ascii=False),'link_state':state,'legal_common_owner_verified':'false','source_index':i}
rows.append(row);sources.append({'row':row,'raw':raw,'next':next_request})
out.mkdir(exist_ok=False)
with (out/'account-links.csv').open('x',encoding='utf-8-sig',newline='') as f:
w=csv.DictWriter(f,fieldnames=list(rows[0]));w.writeheader();w.writerows({k:safe(v) for k,v in r.items()} for r in rows)
evidence=[]
for i,source in enumerate(sources,1):
name='profile-%02d.json'%i;(out/name).write_bytes(source['raw'])
evidence.append({'source_index':i,'filename':name,'sha256':hashlib.sha256(source['raw']).hexdigest(),'request':entries[i-1],'link_state':source['row']['link_state']})
if source['next'] is not None:(out/('unexecuted-videos-%02d.json'%i)).write_text(json.dumps(source['next'],ensure_ascii=False,indent=2),encoding='utf-8')
(out/'manifest.json').write_bytes(manifest_bytes)
(out/'evidence.json').write_text(json.dumps({'sources':evidence,'manifest_sha256':hashlib.sha256(manifest_bytes).hexdigest(),'executed_calls':0,'weekly_monitoring_installed':False,'identity_basis':'recorded profile response; not corporate ownership or independent live verification'},ensure_ascii=False,indent=2),encoding='utf-8')
print(json.dumps({'accounts':len(rows),'linked_identifiers':sum(r['link_state']=='linked_identifier_returned' for r in rows),'executed_calls':0}))

account-links.csv 就是本地交付物。每一行通过 evidence.json 指向归档的原始资料,以及这份资料的请求和采集时间。每个 unexecuted-videos-*.json 文件是可选的下一步请求,不是已获取的作品记录。第一页视频用 last_buffer="",视频列表单独算预算;续页必须用实际返回的游标,并在获准的范围内进行。缺失或不支持的 finder 标识不会触发付费的同名搜索,也不会猜测转换。

十个新账号就是十次资料请求。从关联视频号读取的作品页另外计数。见 BeatAPI 价格页。

要每周同时跟踪公众号和关联视频号,还需要分别保存文章和视频的采集状态,以及调度器和经过测试的交付目标。link_accounts.py 不安装这些,不下载媒体,不合并两条时间线,也不发送提醒。evidence.json 里的哈希证明归档字节没有变化,不证明内容真实,也不核验响应来源。原件留在本地,分享时另做审核后的副本。

做同一家机构的周报时,把公众号文章和视频号作品分成两块。关联依据记在开头,每一块分别保留公众号 username、视频号 finder username 和采集日期。一条路线读取失败时,先交另一条路线已取得的内容,把失败项留在待补清单上。

怎样人工核对账号主体?

打开已核实公众号的公开资料。资料页显示主体名、认证说明或认证日期时,逐项抄录原文、账号来源和查看日期。需要确认中国大陆企业登记时,用完整主体名称或统一社会信用代码在国家企业信用信息公示系统检索。登记结果只证明这个主体的登记资料;要确定账号归属,还要让账号展示的主体与登记记录一致。同名、页面未展示或证据冲突时标记待核。主体成立日期、平台认证日期和账号注册日期分开记录。

想筛合作账号,怎样比较头条阅读和发文频率?

用文章目录取例如最近 28 天的可见文章,按账号和群发批次去重。比较头条时,先确认返回批次中 idx=1 对应首条文章,每个批次的头条只算一次。用标准互动统计取得头条文章的阅读快照。抽样时,每个账号使用同一窗口和同一抽样规则。

在表中记录「观察 28 天、发现群发批次 8 次、成功取得头条阅读 5/8」。频率写成「样本内每周约 2 次群发」;平均阅读按 5 篇有效的头条阅读数计算,并附上样本量和快照日期。真实的零保留,取不到的阅读数单独列出。列表没扫完时写「至少 8 批」。粉丝数和活跃粉丝数留空,除非号主另外提供注明日期和口径的报表。