帖子评论
使用游标分页获取指定Facebook帖子ID的评论。用于查看与已知公开帖子相关的讨论或继续浏览后续评论页面。
参数
| 参数 | 必填 | 类型 | 说明 | 示例 | 可选值 |
|---|---|---|---|---|---|
post_id |
必填 | string | Facebook帖子的唯一标识符。 | 2330555311111867 |
— |
cursor |
可选 | string | 用于获取下一组评论的分页游标。 | — | — |
代码示例
curl -G "https://api.mofa-ai.com/v1/facebook/get_post_comments_v1" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'post_id=2330555311111867'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/facebook/get_post_comments_v1",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"post_id": "2330555311111867",
},
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/facebook/get_post_comments_v1");
url.search = new URLSearchParams({
post_id: "2330555311111867",
});
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 试用额度。
响应示例
采集于 2026-11-08,耗时 1958 ms · 请求参数 {"post_id": "2330555311111867"}
JSON
{
"success": true,
"code": 0,
"message": "success",
"request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
"endpoint": "facebook.get_post_comments_v1",
"cost_usd": 0.04,
"data": {
"code": 0,
"data": {
"cursor": null,
"results": []
},
"message": null,
"requestId": "0b2dc06236a641ae8a133a8e40f16586",
"recordTime": "2026-11-08T08:00:20.648233871",
"requestParams": {
"body": null,
"query": {
"postId": "2330555311111867"
}
}
}
}