Reddit 帖子评论
获取Reddit帖子的评论,支持分页令牌。用于审查帖子的讨论或继续查看已知帖子的其他评论结果。
GET
/v1/reddit/get_post_comments_v1
$0.02
- 价格
- $0.02 / 次成功调用,失败不收费
- 接口 ID
reddit.get_post_comments_v1
参数
-
post_idstring 必填Reddit帖子的唯一标识符。
示例
t3_1b6hz3d -
cursorstring 可选下一页结果的分页令牌。
代码示例
curl -G "https://api.mofa-ai.com/v1/reddit/get_post_comments_v1" \
-H "Authorization: Bearer $MOFA_API_KEY" \
--data-urlencode 'post_id=t3_1b6hz3d'
import os
import requests
resp = requests.get(
"https://api.mofa-ai.com/v1/reddit/get_post_comments_v1",
headers={"Authorization": f"Bearer {os.environ['MOFA_API_KEY']}"},
params={
"post_id": "t3_1b6hz3d",
},
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/reddit/get_post_comments_v1");
url.search = new URLSearchParams({
post_id: "t3_1b6hz3d",
});
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);
响应示例
请求参数 {"post_id": "t3_1b6hz3d"}
JSON
{
"success": true,
"code": 0,
"message": "success",
"request_id": "req_5f1c2a9be04d7c3a81f6e2d0",
"endpoint": "reddit.get_post_comments_v1",
"cost_usd": 0.02,
"data": {
"code": 0,
"data": {
"postInfoById": {
"id": "t3_1b6hz3d",
"title": "Pierre Palmade, l'humoriste devenu infréquentable",
"subreddit": {
"id": "t5_2xnq1",
"name": "Guadeloupe",
"moderation": {
"isShowCommentRemovalReasonPrompt": true
},
"prefixedName": "r/Guadeloupe",
"isQuarantined": false,
"tippingStatus": null,
"allowedMediaInComments": [
"STATIC",
"ANIMATED",
"… +1"
]
},
"__typename": "SubredditPost",
"commentCount": 0,
"commentForest": {
"trees": [],
"pageInfo": {
"hasNextPage": false,
"commentCount": null
},
"__typename": "CommentForest"
}
}
},
"message": null,
"requestId": "3771045317264a5b9fb223574f9bab2a",
"recordTime": "2026-11-08T08:00:21.390946458",
"requestParams": {
"body": null,
"query": {
"postId": "t3_1b6hz3d"
}
}
}
}
在线试用
登录后可以在这里直接调用此接口,按价格从余额扣费,失败不收费。新账户赠送 $0.50 试用额度。