Reddit
Reddit Community API
获取 Reddit 社区帖子列表,支持排序、时间范围和分页参数。
接口说明
Reddit Community API 获取 Reddit 社区帖子列表,支持排序、时间范围和分页参数。
使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。
请求URL
请求头
| 参数名 | 参数值 | 类型 | 说明 |
|---|---|---|---|
| Content-Type | application/json | string | 数据格式 |
| Authorization | Bearer xxx | string | 认证凭证 |
采集最长约75秒,客户端超时建议设为90秒。
请求参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| target | Yes | string | 子版块链接; 也可直接传子版块名 (可带 r/) |
| options | No | object | 仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。 |
options 参数说明
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| sort | No | string | 排序, 默认按 URL 或 hot;可选值:hot / new / top / rising / controversial 可用值: [“hot”, “new”, “top”, “rising”, “controversial”] |
| t | No | string | top / controversial 的时间范围;可选值:hour / day / week / month / year / all 可用值: [“hour”, “day”, “week”, “month”, “year”, “all”] |
| limit | No | integer | 每页条数, 默认 25, 最大 100 默认值: 25 最小值: 1 最大值: 100 |
| after | No | string | null | 续页: 上次输出的 pagination.after |
| includeCommunity | No | boolean | 拉子版块卡片, 默认 true |
仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。
每次只取一页,用返回游标续取。
响应值
| 返回值 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,0 表示成功 |
| message | string | 响应信息,成功时为 ok |
| pointCost | number | 本次请求实际消耗的积点 |
| data | object | 返回数据,结构见下表 |
| meta | object | 请求标识及耗时(毫秒) |
| billing | object | 计费条数、单价及规则版本 |
返回参数 data 说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| type | string | Type 可用值: [“community”] |
| subreddit | string | 子版块名 |
| sort | string | 排序: hot / new / top / rising / controversial |
| community | object | null | 子版块摘要; 拉取失败为 null |
| posts | object[] | 含完整帖子字段的子版块帖子列表 |
| count | number | 本次返回条数 |
| pagination | object | Pagination |
data.community 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| url | string | 子版块链接 |
| name | string | 子版块名 |
| desc | string | null | 简介 |
| weeklyVisitors | number | null | 周访客数 |
| weeklyContributions | number | null | 周贡献数 (发帖 + 评论) |
| subredditId | string | null | 子版块 id (t5_) |
data.posts[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| title | string | null | 标题 |
| captionText | string | 正文 (Markdown); 链接帖为空串 |
| publishedAt | object | null | 发布时间 (text 为 ISO) |
| likes | number | null | 得分 (赞 - 踩) |
| commentsCount | number | null | 评论数 |
| video | object | null | Reddit 托管视频; 非视频帖为 null |
| redditPostId | string | 帖子 id (t3_) |
| id36 | string | null | 帖子短 id (链接里那段) |
| url | string | null | 帖子链接 |
| linkUrl | string | null | 帖子指向的链接 (自帖为帖子本身) |
| domain | string | null | 链接域名 (自帖为 self.<子版块>) |
| subreddit | string | null | 子版块名 |
| flair | string | null | 帖子标签 (flair) |
| ups | number | null | 赞数 |
| upvoteRatio | number | null | 好评率 (0 ~ 1) |
| numCrossposts | number | null | 被交叉转发次数 |
| editedAt | object | null | 最后编辑时间; 没编辑过 text / value 为 null |
| isSelf | boolean | 是否自帖 (纯文字) |
| isVideo | boolean | 是否视频帖 |
| over18 | boolean | 是否 NSFW |
| spoiler | boolean | 是否剧透 |
| stickied | boolean | 是否置顶 |
| locked | boolean | 是否锁定 (禁止评论) |
| archived | boolean | 是否已归档 (不能投票 / 评论) |
| distinguished | string | null | 特殊身份标记: moderator / admin; 普通为 null |
| postHint | string | null | 内容类型提示: self / link / image / hosted:video … |
| thumbnail | string | null | 缩略图 |
| previewImage | string | null | 预览大图 |
| redditVideo | object | null | 视频原始信息; 非视频帖为 null |
| gallery | object[] | 图集帖的图片; 非图集为空 |
| content | string | null | 正文; 没有为 null |
| poster | object | 作者 |
data.posts[].publishedAt 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| text | string | null | 上游原始时间文本 |
| value | number | null | 解析后的毫秒时间戳; 解析失败为 null |
data.posts[].video 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| src | string | null | 视频地址 (HLS 优先) |
| preview | string | null | 预览图 |
| poster | string | null | 封面 |
data.posts[].editedAt 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| text | string | null | 上游原始时间文本 |
| value | number | null | 解析后的毫秒时间戳; 解析失败为 null |
data.posts[].redditVideo 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| hlsUrl | string | HLS 地址 |
| fallbackUrl | string | MP4 地址 (无声) |
| dashUrl | string | DASH 地址 |
| width | number | 宽 |
| height | number | 高 |
| duration | number | 时长 (秒) |
data.posts[].gallery[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| url | string | 图片链接 |
| width | number | null | 宽 |
| height | number | null | 高 |
| caption | string | null | 图注 |
data.posts[].poster 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| nickname | string | null | 作者用户名 |
| profileUrl | string | null | 作者主页 |
| id | string | null | 作者 id (t2_) |
data.pagination 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| after | string | null | 下一页游标, 传回 options.after 续取 |
| hasMore | boolean | 是否还有更多 |
请求示例
返回示例
下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。
积点消耗说明
每条主体结果消耗 0.8 积点。
空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

