How to get WeChat Search results by keyword
One endpoint does it: WeChat Search articles and videos. The worked example below is 2 calls and costs $0.0400 in all; a failed call is not charged.
You get what WeChat Search (搜一搜) shows for a keyword, page after page: Official Account articles and Channels videos mixed, each with its title or description, the account's name and the time it was posted; an article with its link, a video with its likes and saves.
Step 1: WeChat Search articles and videos
Search by query. type says whether an item is an article or a video. sort orders by relevance, newest or hottest, and published_within keeps only recent ones. For the next page, send page.next_cursor as cursor, until page.has_more is false.
curl -G "https://api.dataxapi.com/v1/wechat/posts/search" \ --data-urlencode "query=咖啡店开业" \ -H "Authorization: Bearer $DATAXAPI_API_KEY"
# pip install dataxapi from dataxapi import DataXAPI dx = DataXAPI() # reads DATAXAPI_API_KEY result = dx.wechat.posts.search(query="咖啡店开业") print(result["data"]["items"])
// npm i @dataxapi/sdk import { DataXAPI } from "@dataxapi/sdk"; const dx = new DataXAPI(); // reads DATAXAPI_API_KEY const result = await dx.wechat.posts.search({ query: "咖啡店开业" }); console.log(result.data.items);
dataxapi call wechat.posts.search 'query=咖啡店开业'{
"code": "ok",
"request_id": "f99e115c-779f-40c2-8f31-aa264bce80dd",
"data": {
"items": [
{
"id": "1565947629032858",
"url": null,
"type": "video",
"title": null,
"text": "咖啡店开业|第一次尝试就爱上了,清单放评论区",
"published_at": "2026-10-15T06:55:50.000Z",
"author": {
"name": "橘子汽水不加冰",
"avatar_url": "https://wx.qlogo.cn/mmhead/G9OFE9nvQizvdtoFhYPbPgJwNlPo1GOTzMZ7Yb1e/132"
},
"metrics": { "likes": 1, "favorites": 3 }
},
// … 19 more
]
},
"page": {
"next_cursor": "c1.qgwIcUU3N03dRsj5WCHQWiriygBg_3bRP0gIll8U",
"cursor_expires_at": "2026-10-17T11:16:20.000Z",
"has_more": true,
"returned": 20
},
"warnings": [],
"meta": {
"capability": "wechat.posts.search",
"result_status": "complete",
"fetched_at": "2026-10-17T10:16:20.000Z",
"cached": false,
"replayed": false,
"unavailable": {
"lang": "capability",
"author.id": "capability",
"author.username": "capability",
"author.verified": "capability",
"author.followers": "capability",
"metrics.comments": "capability",
"metrics.shares": "capability",
"metrics.views": "capability",
"metrics.reposts": "capability",
"images": "capability",
"hashtags": "capability",
"mentions": "capability",
"is_pinned": "capability",
"post_id": "platform",
"parent_id": "platform",
"root_id": "platform"
},
"billing": {
"amount": "0.02",
"currency": "USD",
"balance_after": "9.98"
}
}
}From a response recorded 2026-10-17 10:16 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.
WeChat Search articles and videos · $0.0200 / a call · Parameters, fields and errors on the endpoint's page →
What the example costs
two pages of results for one keyword
Prices are the prices in force when this page was built. A failed call costs nothing.
In your AI (MCP)
Connect DataXAPI to your AI client once. Then say what you want; the agent finds these endpoints, checks the price and calls them on your balance.
{
"capability": "wechat.posts.search",
"query": "咖啡店开业",
"idempotency_key": "<a new UUID>"
}Sign in to copy the setup prompt with your keyAbout the MCP server →
Good to know
- WeChat Search gives no account ID, only the account's name. To read an account's other articles, open one article's link with the article endpoint: its
author.idis the account's original ID. - A search that finds nothing returns an empty result, and an empty result is charged.
The whole script
The task above as one script that runs as it is: Python, the SDK, your key from DATAXAPI_API_KEY. It writes a CSV file and ends by printing what it called, fetched and was charged.
# pip install dataxapi # export DATAXAPI_API_KEY=dx_... (your key) import csv from decimal import Decimal from dataxapi import DataXAPI dx = DataXAPI() calls, fetched, charged = 0, 0, Decimal("0") def run(capability, params): """One call; counts it and what it was charged.""" global calls, charged result = dx.call(capability, params) calls += 1 charged += Decimal(str(result["meta"]["billing"]["amount"])) return result QUERY = "咖啡店开业" PAGES = 2 # WeChat Search results, articles and Channels videos mixed: type says which. rows, cursor = [], None for _ in range(PAGES): page = run("wechat.posts.search", {"query": QUERY, **({"cursor": cursor} if cursor else {})}) for item in page["data"]["items"]: rows.append([item.get("type"), item.get("published_at"), item["author"].get("name"), item.get("title"), item.get("url")]) cursor = page["page"]["next_cursor"] if not page["page"]["has_more"]: break fetched = len(rows) with open("wechat-search.csv", "w", newline="", encoding="utf-8") as file: csv.writer(file).writerows([["type", "published_at", "account", "title", "url"], *rows]) print(f"calls: {calls}, items: {fetched}, charged: ${charged}")
Run for real on 2026-10-29: 2 calls, 40 rows written, $0.0400 charged. A failed call is not charged.