接口说明

Facebook Comments API 获取 Facebook 评论数据,支持接口列出的分页、排序或筛选参数。

使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。

请求URL

POST https://scrapeapi.pangolinfo.com/api/v1/social/facebook-comments

请求头

参数名参数值类型说明
Content-Typeapplication/jsonstring数据格式
AuthorizationBearer xxxstring认证凭证

采集最长约75秒,客户端超时建议设为90秒。

请求参数

参数必填类型说明
targetYesstring帖子链接(不支持直接传 id)
optionsNoobject仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。

options 参数说明

参数必填类型说明
maxPagesNointeger本次请求翻几页,默认 1,最大 5,按实际返回条数计费,更多数据用返回的游标续取
默认值: 1
最小值: 1
最大值: 5
cursorNostring | null续取评论: 上次输出的 pagination.comments.cursor; 回复模式: 评论输出的 replyCursor, 或上次输出的 pagination.cursor; 首页不给时只在帖子首屏评论里查找
sortNostring评论排序: top (热门, 默认) / new (最新);可选值:top / new
可用值: [“top”, “new”]
commentIdNostring回复模式: 主评论 id (评论输出的 id)

仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。

每次默认1页,最多5页;页数必须为正整数,超过5按5处理。

提供非空commentId进入独立回复模式,按返回的直接回复计费;Facebook同时计入返回的嵌套回复。按本页cursor说明续取。

响应值

返回值类型说明
codeinteger状态码,0 表示成功
messagestring响应信息,成功时为 ok
pointCostnumber本次请求实际消耗的积点
dataobject返回数据,结构见下表
metaobject请求标识及耗时(毫秒)
billingobject计费条数、单价及规则版本

返回参数 data 说明

返回值类型说明
typestringcomments = 评论模式; replies = 回复模式 (传了 options.commentId)
可用值: [“comments”, “replies”]
commentsCountnumber | null评论模式: 评论总数
commentsobject[]评论模式: 评论, 与 facebook-post 同形
commentIdstring回复模式: 父评论 id
repliesobject[]回复模式: 回复, 与评论同形
paginationobject评论模式: {comments: {cursor, hasMore}}; 回复模式: {cursor, hasMore}

data.comments[] 字段说明

返回值类型说明
avatarstring | null评论者头像
nicknamestring | null评论者名字
profileUrlstring | null评论者主页
timeTextobject | null评论时间 (text 为 ISO)
contentstring | null评论内容
moodnumber | null评论的回应 (点赞) 数; 0 时为 null
idstring | null评论 id (base64); 回复模式传 options.commentId 用它
legacyIdstring | null评论数字 id
authorIdstring | null评论者 id (可能是 pfbid 加密 id)
authorTypestring | null评论者类型: User / Page
replyCountnumber回复数
urlstring | null评论链接
depthnumber层级: 0 顶层, 1 回复
parentIdstring | null父评论 id; 顶层为 null
replyCursorstring | null回复首页游标: 回复模式传 options.cursor (与 commentId 一起); 无回复为 null, 有时效

data.comments[].timeText 字段说明

返回值类型说明
textstring | null上游原始时间文本
valuenumber | null解析后的毫秒时间戳; 解析失败为 null

data.replies[] 字段说明

返回值类型说明
avatarstring | null评论者头像
nicknamestring | null评论者名字
profileUrlstring | null评论者主页
timeTextobject | null评论时间 (text 为 ISO)
contentstring | null评论内容
moodnumber | null评论的回应 (点赞) 数; 0 时为 null
idstring | null评论 id (base64); 回复模式传 options.commentId 用它
legacyIdstring | null评论数字 id
authorIdstring | null评论者 id (可能是 pfbid 加密 id)
authorTypestring | null评论者类型: User / Page
replyCountnumber回复数
urlstring | null评论链接
depthnumber层级: 0 顶层, 1 回复
parentIdstring | null父评论 id; 顶层为 null
replyCursorstring | null回复首页游标: 回复模式传 options.cursor (与 commentId 一起); 无回复为 null, 有时效

请求示例

curl --request POST \
  --url https://scrapeapi.pangolinfo.com/api/v1/social/facebook-comments \
  --header 'Authorization: Bearer YOUR_PANGOLINFO_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "target": "https://www.facebook.com/watch/?v=28751926967826750"
}'

返回示例

下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。

{
  "code": 0,
  "message": "ok",
  "pointCost": 1.6,
  "data": {
    "type": "comments",
    "commentsCount": 20,
    "comments": [
      {
        "avatar": "https://scontent-scl3-1.xx.fbcdn.net/v/t39.30808-1/830541597_10165061607287628_7626207140813021480_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx720x720&ctp=s32x32&_nc_ca...",
        "nickname": "Tony Gibson",
        "profileUrl": "https://www.facebook.com/tony.gibson.3154",
        "timeText": {
          "text": "2026-09-21T23:32:36.000Z",
          "value": 1790033556000
        },
        "content": "We bought one almost a year ago and it has been awesome running power tools it’s piece of mine knowing if the electric goes out it can be used for various th...",
        "mood": 3,
        "id": "Y29tbWVudDoxMDM4MDAzOTMyNTc1OTYwXzIzNTI1MTc5Njg2MTk5OTQ=",
        "legacyId": "2352517968619994",
        "authorId": "pfbid02QenCGVC6HrcBcPWrdqcURw1j1JQLi2uwkKbNZYxhcmPGjFvNVKzyz74jWjgkWj9ul",
        "authorType": "User",
        "replyCount": 0,
        "url": "https://www.facebook.com/reel/28751926967826750/?comment_id=2352517968619994",
        "depth": 0,
        "parentId": null,
        "replyCursor": null
      }
    ],
    "pagination": {
      "comments": {
        "cursor": "MToxNzkzOTU0MzA5OgF_hBcpGf3Wujq2Q812CnP0PqUwVRdBr8-CX6tXlSRKZ2xicokF-epTTuIYJk2_nhGoU5qTZbjHgHoLZmmC8y8owORnyBzmYWw870UPSrtovCXSfwjQyV7SXdzlPqA2Ma7ZJGihUAbtx...",
        "hasMore": true
      }
    }
  },
  "meta": {
    "requestId": "pg-audit-r1-facebook-comments-1793954306411882500",
    "durationMs": 7166
  },
  "billing": {
    "unitPrice": 0.8,
    "ruleVersion": "social-primary-v2",
    "billedCount": 2,
    "pointCost": 1.6
  }
}

积点消耗说明

每条一级评论及返回的嵌套回复消耗0.8积点;独立回复模式也计入返回的嵌套回复。

空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

在线调试