Cross-Platform Search
Searches recent content across news, Weibo, WeChat, Zhihu, Douyin, Xiaohongshu, Bilibili, and Kuaishou with source and time filters. Use it to monitor a topic across multiple platforms.
Parameters
| Name | Required | Type | Description | Example | Allowed values |
|---|---|---|---|---|---|
keyword |
Optional | string | Search query string. Supports these five syntax forms: - AND (&&): A && B matches content containing both A and B. - OR (||): A || B matches content containing A or B. - Exclusion (-): -A matches content that does not contain A. - Parentheses (): (A && B) || C matches content containing C, or both A and B. - English double quotes (""): "A" disables tokenization and requires an exact match for A. | 咖啡 |
— |
source |
Optional | string | Target social media platform for search filtering. Available Values: - `ALL`: All platforms - `NEWS`: News - `WEIBO`: Sina Weibo - `WEIXIN`: Weixin (WeChat) - `ZHIHU`: Zhihu - `DOUYIN`: Douyin (TikTok China) - `XIAOHONGSHU`: Xiaohongshu (Little Red Book) - `BILIBILI`: Bilibili - `KUAISHOU`: Kuaishou | ALL |
ALLNEWSWEIBOWEIXINZHIHUDOUYINXIAOHONGSHUBILIBILIKUAISHOU |
start |
Optional | string | Start time of the search period (yyyy-MM-dd HH:mm:ss). Required for initial request. | — | — |
end |
Optional | string | End time of the search period (yyyy-MM-dd HH:mm:ss). Required for initial request. | — | — |
next_cursor |
Optional | string | Pagination cursor provided by the 'nextCursor' field in the previous response. | — | — |
Code samples
curl -G "https://api.mofa-ai.com/v1/search/search_v1" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'keyword=咖啡' \
--data-urlencode 'source=ALL'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/search/search_v1",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"keyword": "咖啡",
"source": "ALL",
},
timeout=60,
)
body = resp.json()
if body["success"]:
print(body["cost_usd"], body["data"])
else:
print(body["error"], body["message"])
const url = new URL("https://api.mofa-ai.com/v1/search/search_v1");
url.search = new URLSearchParams({
keyword: "咖啡",
source: "ALL",
});
const resp = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MOFA_API_KEY}` },
});
const body = await resp.json();
if (body.success) console.log(body.cost_usd, body.data);
else console.error(body.error, body.message);
Try it
Sign in to call this endpoint from this page. Successful calls are billed to your balance, failed calls are free, and new accounts get $0.50 of trial credit.
Example response
There is no example response for this endpoint yet.