For AI

How-to guides

How to get every video a WeChat Channels account has posted

Three endpoints, in this order: WeChat Channels account search (name to the v2_…@finder account ID), account profile, then account videos page by page. The worked example below is 6 calls and costs $0.12; a failed call is not charged.

Updated

The job: one WeChat Channels (视频号) account matters to you, maybe a competitor, maybe a creator you are thinking of paying, and you want its videos in a sheet. For each video you get the description, the time it went up, likes, comments, shares and saves, and its length. The profile adds what WeChat shows on the account page: name, signature, number of videos, IP location and the Official Account linked to it.

Before you start, know which ID you need. The 视频号 ID that the app and 视频号助手 display starts with sph and is short. The endpoints here do not take it. They take the account ID WeChat uses internally, a long string that starts with v2_ and ends with @finder, for example v2_060000231003b20faec8c353a18ebca650858991e19fab55aa5e12f6d5010f5e0eeaaafc3520@finder. None of the endpoints turns the first into the second, so you find the account by name (step 1) or read author.id from one of its videos.

Step by step

Step 1: find the account ID

Call WeChat Channels account search with the account's name as query. The search runs through WeChat Search, which usually returns just the one account whose name matches best, for $0.02. You get id (the v2_…@finder ID), name, bio, avatar_url and verified; with view=full, ext.verified_by names who verified it, which helps when several accounts share a name.

curl -G "https://api.okdata.online/v1/wechat_channels/users/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=新华社' \
  --data-urlencode 'view=full'

If you already have a share link to one of the account's videos, you can skip the search: WeChat Channels video detail returns the account ID in author.id.

Step 2: read the profile

Pass the ID to WeChat Channels account profile ($0.02). It returns name, bio (the signature), avatar_url, verified and posts, the number of videos. With view=full, ext adds ip_location, verified_reason, live_hours (total hours live) and linked_accounts, such as the Official Account tied to it. posts tells you how deep the list goes: divide by 15 for the number of pages.

curl -G "https://api.okdata.online/v1/wechat_channels/users/get" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'id=v2_060000231003b20faec8c353a18ebca650858991e19fab55aa5e12f6d5010f5e0eeaaafc3520@finder' \
  --data-urlencode 'view=full'

followers and likes are often null. WeChat hides them on many accounts, large media accounts among them, and meta.unavailable then marks them platform.

Step 3: page through the videos

WeChat Channels account videos takes the same id and returns the account's videos newest first, about 15 a page, for $0.02 per page. Each video has a numeric id, text, published_at and metrics.likes, metrics.comments, metrics.shares and metrics.favorites. With view=full you also get ext.duration_s and ext.location.

curl -G "https://api.okdata.online/v1/wechat_channels/users/videos/list" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'id=v2_060000231003b20faec8c353a18ebca650858991e19fab55aa5e12f6d5010f5e0eeaaafc3520@finder' \
  --data-urlencode 'view=full'

The video's url is not a page you can open. WeChat gives Channels videos no web page, so url is the video file itself, and that file is encrypted. The key to decrypt it is in ext.decode_key of the same answer (with view=full). For counting and comparing you never need the file.

For the next page, send page.next_cursor back as cursor, unchanged. On big accounts the list can run to thousands of videos, so decide in advance where to stop: a page count, or a date.

Step 4: put it together in Python

The script finds the account, prints the profile and writes videos to a CSV until it has read MAX_PAGES pages or reaches a page where every video is older than SINCE.

import csv
import os
import requests

API = "https://api.okdata.online"
HEADERS = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}
NAME = "新华社"
MAX_PAGES = 4                     # each page is one call, about 15 videos
SINCE = "2026-09-01T00:00:00Z"    # ignore videos older than this


def get(path, **params):
    body = requests.get(API + path, headers=HEADERS, params=params, timeout=60).json()
    if body["code"] != "ok":
        raise RuntimeError(f"{body['code']}: {body['message']} (charged: {body['charged']})")
    return body


found = get("/v1/wechat_channels/users/search", query=NAME)["data"]["items"]
if not found:
    raise SystemExit(f"No Channels account found for {NAME}")
account_id = found[0]["id"]

profile = get("/v1/wechat_channels/users/get", id=account_id, view="full")["data"]["item"]
print(profile["name"], "|", profile["posts"], "videos | followers:", profile["followers"])

with open("channels_videos.csv", "w", newline="", encoding="utf-8-sig") as f:
    out = csv.writer(f)
    out.writerow(["video_id", "published_at", "text", "likes", "comments", "shares", "favorites", "duration_s"])
    cursor = None
    for _ in range(MAX_PAGES):
        params = {"id": account_id, "view": "full", **({"cursor": cursor} if cursor else {})}
        body = get("/v1/wechat_channels/users/videos/list", **params)
        items = body["data"]["items"]
        for v in items:
            if v["published_at"] >= SINCE:
                m = v["metrics"]
                out.writerow([v["id"], v["published_at"], v["text"], m["likes"], m["comments"],
                              m["shares"], m["favorites"], v["ext"].get("duration_s")])
        if not items or all(v["published_at"] < SINCE for v in items) or not body["page"]["has_more"]:
            break
        cursor = body["page"]["next_cursor"]

Four pages is the worked example above. Twenty pages, about 300 videos, would be $0.40 for the list alone.

Good to know

  • Two IDs. sph… is the display ID; v2_…@finder is the one the endpoints take. Keep the v2_ ID once you have it, so later runs skip the search.
  • Look-alike names. Search matches on the name, so when a fan account or a namesake could come up first, check ext.verified_by and bio before going on.
  • The end of the list. On large accounts, page.has_more can stay true until a page comes back with no videos. Treat an empty page as the end too, as the script does.
  • No play counts. WeChat does not show plays for Channels videos, so metrics.views is null.
  • Hidden counts. Null followers or likes mean WeChat did not show them, not that they are zero.
  • Live streams. Replays of an account's live streams are a separate list: WeChat Channels live replays.
  • Retries and missing accounts. Send an Idempotency-Key header: the same request with the same key within 24 hours returns the stored answer with meta.replayed: true and no new charge. An ID that matches no account answers not_found, which is free.

For what people say under those videos, pass a video id to WeChat Channels video comments. For tracking several accounts every week, see competitor monitoring.

What the example costs

Find the account 新华社 by name, read its profile, then the 4 newest pages of its videos (about 60 videos)

EndpointCallsPriceSubtotal
WeChat Channels account search1$0.02$0.02
WeChat Channels account profile1$0.02$0.02
WeChat Channels account videos4$0.02$0.08
Total6$0.12

Prices in force when this page was built. A failed call costs nothing.

In your AI (MCP)

Connect the MCP server once, then say what you want. The agent finds these endpoints, reads their prices and calls them on your balance.

SayFind the WeChat Channels account 新华社, show me its profile, then list its newest 60 or so videos in a table: date, description, likes, comments, shares, saves and length.

What the agent sends to the call tool first
{
  "endpoint": "wechat_channels.users.search",
  "params": {
    "query": "央视新闻"
  },
  "idempotency_key": "<a new UUID>"
}

Set up the MCP server →

Connect once, then just ask.

Every new key comes with $0.10 to try it. One sentence connects your agent.

Start free
Connect your AI

Paste this into your agent

Read https://okdata.online/agents.md and set up okdata for me; my key is in the OKDATA_API_KEY environment variable.

Claude Code, Cursor, Codex and other agents that can open a link set themselves up from it.

MCP serverhttps://api.okdata.online/mcp