Facebook
Facebook Search API
按关键词搜索 Facebook 内容,返回搜索结果及对应信息。
接口说明
Facebook Search API 按关键词搜索 Facebook 内容,返回搜索结果及对应信息。
使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。
请求URL
请求头
| 参数名 | 参数值 | 类型 | 说明 |
|---|---|---|---|
| Content-Type | application/json | string | 数据格式 |
| Authorization | Bearer xxx | string | 认证凭证 |
采集最长约75秒,客户端超时建议设为90秒。
请求参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| target | Yes | string | 搜索关键词 |
| options | No | object | 仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。 |
options 参数说明
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| maxPages | No | integer | 本次请求翻几页,默认 1,最大 5,按实际返回条数计费,更多数据用返回的游标续取 默认值: 1 最小值: 1 最大值: 5 |
| cursor | No | string | null | 续取: 上次输出的 pagination.cursor; null + hasMore 表示从首屏重取 |
| sort | No | string | 排序: relevance (相关性, 默认) / recent (最新);可选值:relevance / recent 可用值: [“relevance”, “recent”] |
| timeRange | No | string | 发布时间: all (不限) / day (今天) / week (本周) / month (本月); 未传保留 URL 筛选;可选值:all / day / week / month 可用值: [“all”, “day”, “week”, “month”] |
仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。
每次默认1页,最多5页;页数必须为正整数,超过5按5处理。
只搜索视频。
响应值
| 返回值 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,0 表示成功 |
| message | string | 响应信息,成功时为 ok |
| pointCost | number | 本次请求实际消耗的积点 |
| data | object | 返回数据,结构见下表 |
| meta | object | 请求标识及耗时(毫秒) |
| billing | object | 计费条数、单价及规则版本 |
返回参数 data 说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| query | string | 搜索关键词 |
| items | object[] | 视频搜索结果; grid 缺少的字段为 null |
| pagination | object | Pagination |
data.items[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| videoId | string | 视频 id |
| postId | string | null | 帖子 id |
| storyId | string | null | Story id |
| role | string | null | 搜索结果角色 |
| url | string | null | 视频链接 |
| message | string | null | 正文 |
| owner | object | Owner |
| publishedAt | object | null | 发布时间; grid 只有相对时间原文, 毫秒为 null |
| relativeTimeText | string | null | 相对时间 / 浏览量原文 |
| durationMs | number | null | 视频时长, 毫秒 |
| width | number | null | 宽 |
| height | number | null | 高 |
| thumbnailUrl | string | null | 封面 |
| reactionCount | number | null | 回应数 |
| commentCount | number | null | 评论数 |
| shareCount | number | null | 分享数 |
| viewCount | number | null | 观看数 |
data.items[].owner 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| id | string | null | 作者 id |
| name | string | null | 作者名字 |
| type | string | null | 作者类型 |
data.items[].publishedAt 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| text | string | null | 上游原始时间文本 |
| value | number | null | 解析后的毫秒时间戳; 解析失败为 null |
data.pagination 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| cursor | string | null | 传回 options.cursor; null + hasMore 表示重取首屏, 可能重复 |
| hasMore | boolean | 是否可续取 |
请求示例
返回示例
下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。
积点消耗说明
每条主体结果消耗 0.8 积点。
空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

