账户历史文章
获取由 ghid 或文章URL标识的微信公众号的历史文章,带有来自上一页的偏移游标。用于通过游标分页继续浏览账号的文章存档。
参数
| 参数 | 必填 | 类型 | 说明 | 示例 | 可选值 |
|---|---|---|---|---|---|
ghid |
可选 | string | 微信公众号原始标识符,使用微信返回的 gh_ 前缀。使用 ghid 或 url 之一。 | — | — |
url |
可选 | string | 用于识别公众号并获取历史文章的微信公众号文章URL。请使用ghid或url之一。 | — | — |
offset |
可选 | string | PagingInfo.Offset 由上一次响应返回的偏移游标。第一页时留空。对于此 POST 接口,请以 application/x-www-form-urlencoded 格式在请求体中发送。 | — | — |
代码示例
curl "https://api.mofa-ai.com/v1/weixin/get_account_history_articles_v2" \
-H "Authorization: Bearer $MOFA_API_KEY"
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/weixin/get_account_history_articles_v2",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
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/weixin/get_account_history_articles_v2");
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);
在线试用
登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。
响应示例
这个接口暂无响应示例。