微信公众号获取文章详情
🔒
该接口需开通后调用暂未开放自助调用。联系销售为你的账号开通权限并发放调用 token。
根据文章链接获取标题、作者、阅读 / 点赞数据。
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
token | string | 是 | - | 你的访问令牌(通过 query 传递) |
url | string | 是 | - | 文章链接 |
代码示例
环境地址:示例中的
https://<your_endpoint>为占位符,请替换为客服为你分配的专属接入地址(详见快速开始)。
bash
curl -X POST 'https://<your_endpoint>/api/weixin-mp/article-detail-v1?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"url":"https://mp.weixin.qq.com/s/xxxx"}'python
import requests
resp = requests.post(
"https://<your_endpoint>/api/weixin-mp/article-detail-v1",
params={"token": "YOUR_TOKEN"},
json={
"url": "https://mp.weixin.qq.com/s/xxxx"
},
timeout=60,
)
print(resp.json())javascript
const resp = await fetch('https://<your_endpoint>/api/weixin-mp/article-detail-v1?token=YOUR_TOKEN', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"url":"https://mp.weixin.qq.com/s/xxxx"}),
})
console.log(await resp.json())响应结果示例
json
{
"code": 0,
"message": "ok",
"data": {
"title": "示例文章",
"author": "示例公众号",
"read_num": 100000,
"like_num": 2300
}
}json
{
"code": 303,
"message": "采集失败,请稍后重试",
"data": null
}