接口说明

Facebook Search API 按关键词搜索 Facebook 内容,返回搜索结果及对应信息。

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

请求URL

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

请求头

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

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

请求参数

参数必填类型说明
targetYesstring搜索关键词
optionsNoobject仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。

options 参数说明

参数必填类型说明
maxPagesNointeger本次请求翻几页,默认 1,最大 5,按实际返回条数计费,更多数据用返回的游标续取
默认值: 1
最小值: 1
最大值: 5
cursorNostring | null续取: 上次输出的 pagination.cursor; null + hasMore 表示从首屏重取
sortNostring排序: relevance (相关性, 默认) / recent (最新);可选值:relevance / recent
可用值: [“relevance”, “recent”]
timeRangeNostring发布时间: all (不限) / day (今天) / week (本周) / month (本月); 未传保留 URL 筛选;可选值:all / day / week / month
可用值: [“all”, “day”, “week”, “month”]

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

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

只搜索视频。

响应值

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

返回参数 data 说明

返回值类型说明
querystring搜索关键词
itemsobject[]视频搜索结果; grid 缺少的字段为 null
paginationobjectPagination

data.items[] 字段说明

返回值类型说明
videoIdstring视频 id
postIdstring | null帖子 id
storyIdstring | nullStory id
rolestring | null搜索结果角色
urlstring | null视频链接
messagestring | null正文
ownerobjectOwner
publishedAtobject | null发布时间; grid 只有相对时间原文, 毫秒为 null
relativeTimeTextstring | null相对时间 / 浏览量原文
durationMsnumber | null视频时长, 毫秒
widthnumber | null宽
heightnumber | null高
thumbnailUrlstring | null封面
reactionCountnumber | null回应数
commentCountnumber | null评论数
shareCountnumber | null分享数
viewCountnumber | null观看数

data.items[].owner 字段说明

返回值类型说明
idstring | null作者 id
namestring | null作者名字
typestring | null作者类型

data.items[].publishedAt 字段说明

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

data.pagination 字段说明

返回值类型说明
cursorstring | null传回 options.cursor; null + hasMore 表示重取首屏, 可能重复
hasMoreboolean是否可续取

请求示例

curl --request POST \
  --url https://scrapeapi.pangolinfo.com/api/v1/social/facebook-search \
  --header 'Authorization: Bearer YOUR_PANGOLINFO_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "target": "cat"
}'

返回示例

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

{
  "code": 0,
  "message": "ok",
  "pointCost": 4.0,
  "data": {
    "query": "cat",
    "items": [
      {
        "videoId": "2209432039635892",
        "postId": "122193904496842774",
        "storyId": "UzpfSTYxNTc1MjgzMjI1ODYxOlZLOjIyMDk0MzIwMzk2MzU4OTI=",
        "role": "VIDEOS_MBR_ENGAGEMENT",
        "url": "https://www.facebook.com/reel/2209432039635892/",
        "message": "“To the world you may be one person, but to one person you may be the world” 🐈‍⬛🐈💖\n.\nBoth Baba and Yaga are very cuddly in general; however, sometimes Baba g...",
        "owner": {
          "id": "61575283225861",
          "name": "BabaYaga Cat",
          "type": "User"
        },
        "publishedAt": {
          "text": "2026-11-04T12:10:12.000Z",
          "value": 1793794212000
        },
        "relativeTimeText": null,
        "durationMs": 30400,
        "width": 1080,
        "height": 1920,
        "thumbnailUrl": "https://scontent.fdxb2-1.fna.fbcdn.net/v/t51.82787-10/879428335_17936933163417778_8617318399828117111_n.jpg?stp=dst-jpg_tt6&cstp=mx720x1280&ctp=s960x960&_nc_...",
        "reactionCount": 6613,
        "commentCount": 139,
        "shareCount": 117,
        "viewCount": 24479
      }
    ],
    "pagination": {
      "cursor": null,
      "hasMore": true
    }
  },
  "meta": {
    "requestId": "pg-audit-r1-facebook-search-1793954265337132700",
    "durationMs": 22047
  },
  "billing": {
    "unitPrice": 0.8,
    "ruleVersion": "social-primary-v2",
    "billedCount": 5,
    "pointCost": 4.0
  }
}

积点消耗说明

每条主体结果消耗 0.8 积点。

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

在线调试