Reddit
Reddit Search API
按关键词搜索 Reddit 内容,返回搜索结果及对应信息。
接口说明
Reddit Search API 按关键词搜索 Reddit 内容,返回搜索结果及对应信息。
使用 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 |
| subreddit | No | string | 子版块名 (不带 r/) |
| sort | No | string | relevance (默认) / hot / top / new / comments |
| t | No | string | 时间范围: hour / day / week / month / year / all |
| includeOver18 | No | boolean | 包含 NSFW, 默认 false |
| after | No | string | null | 续页: 原样传入 pagination.after 的游标 |
| since | No | string | number | 只要该时间之后发布的帖子: ISO 日期 (2026-10-01) 或秒 / 毫秒时间戳; 没传 t 时自动用覆盖它的最小时间窗 |
| until | No | string | number | 只要该时间之前发布的帖子, 格式同 since |
仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。
每次默认1页,最多5页;页数必须为正整数,超过5按5处理。
只搜索帖子;content是搜索摘要而非完整正文,content/snippetId可能为null。
响应值
| 返回值 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,0 表示成功 |
| message | string | 响应信息,成功时为 ok |
| pointCost | number | 本次请求实际消耗的积点 |
| data | object | 返回数据,结构见下表 |
| meta | object | 请求标识及耗时(毫秒) |
| billing | object | 计费条数、单价及规则版本 |
返回参数 data 说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| posts | object[] | 仅返回当前搜索 HTML 支持的字段; 含已有缩略图、预览图和图集 |
| count | number | 本次返回条数 |
| pagination | object | Pagination |
data.posts[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| title | string | null | 标题 |
| publishedAt | object | null | 发布时间 (text 为 ISO) |
| likes | number | null | 得分 (赞 - 踩) |
| commentsCount | number | null | 评论数 |
| redditPostId | string | 帖子 id (t3_) |
| id36 | string | null | 帖子短 id (链接里那段) |
| url | string | null | 帖子链接 |
| subreddit | string | null | 子版块名 |
| over18 | boolean | 是否 NSFW |
| spoiler | boolean | 是否剧透 |
| thumbnail | string | null | 缩略图 |
| previewImage | string | null | 预览大图 |
| gallery | object[] | 搜索页已有的图集图片 |
| content | string | null | 搜索摘要 (并非完整正文) |
| snippetId | string | null | 搜索命中摘要 id |
| subredditId | string | null | 子版块 id (t5_) |
| safeSearch | string | null | 搜索安全状态 (上游原值) |
| structureType | string | null | 搜索结果结构类型 (上游原值) |
| subredditNsfw | boolean | null | 子版块是否 NSFW; 与帖子 over18 分开 |
| subredditQuarantined | boolean | null | 子版块是否被隔离 |
| actionInfo | object | null | 选定摘要来源的事件信息 |
| poster | object | 作者 |
data.posts[].publishedAt 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| text | string | null | 上游原始时间文本 |
| value | number | null | 解析后的毫秒时间戳; 解析失败为 null |
data.posts[].gallery[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| url | string | 图片链接 |
| width | number | null | 宽 |
| height | number | null | 高 |
data.posts[].actionInfo 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| position | number | null | 结果位置 |
| relativePosition | number | null | 相对位置 |
| type | string | null | 事件类型 |
data.posts[].poster 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| nickname | string | null | 作者用户名 |
| profileUrl | string | null | 作者主页 |
| id | string | null | 作者 id (t2_) |
data.pagination 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| after | string | null | Base64 编码的搜索续页游标, 原样传回 options.after |
| hasMore | boolean | 是否还有更多 |
请求示例
返回示例
下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。
积点消耗说明
每条主体结果消耗 0.8 积点。
空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

