Reddit
Reddit Home API
获取 Reddit 主页资料及首屏作品数据。
接口说明
Reddit Home API 获取 Reddit 主页资料及首屏作品数据。
使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。
请求URL
请求头
| 参数名 | 参数值 | 类型 | 说明 |
|---|---|---|---|
| Content-Type | application/json | string | 数据格式 |
| Authorization | Bearer xxx | string | 认证凭证 |
采集最长约75秒,客户端超时建议设为90秒。
请求参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| target | Yes | string | 主页链接; 也可直接传用户名 (可带 u/) |
| options | No | object | 仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。 |
options 参数说明
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| tab | No | string | 作品类型, 默认按 URL 或 overview;可选值:submitted / comments / overview 可用值: [“submitted”, “comments”, “overview”] |
仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。
附带作品限一页,最多10条。
响应值
| 返回值 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,0 表示成功 |
| message | string | 响应信息,成功时为 ok |
| pointCost | number | 本次请求实际消耗的积点 |
| data | object | 返回数据,结构见下表 |
| meta | object | 请求标识及耗时(毫秒) |
| billing | object | 计费条数、单价及规则版本 |
返回参数 data 说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| type | string | Type 可用值: [“home”] |
| user | object | User |
| works | object[] | 作品 (帖子 / 评论, 按时间倒序) |
| pagination | object | Pagination |
data.user 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| accountId | string | null | 用户名 (兼容旧键; 数字 id 见 id36) |
| userId | string | null | 用户名 (同 accountId) |
| id36 | string | null | 用户 id (t2_ 后面那段) |
| username | string | null | 个人版块名, 如 u_spez; 没有个人版块时为用户名 |
| nickname | string | null | 显示名; 没有时用用户名 |
| accountName | string | null | 用户名 |
| profileUrl | string | 主页链接 |
| avatar | string | null | 头像 |
| banner | string | null | 横幅图 |
| bio | string | null | 简介 |
| isVerified | boolean | null | 邮箱是否已验证; 取不到为 null |
| isSuspended | boolean | null | 是否被封禁; 取不到为 null |
| isDeleted | boolean | null | 是否已注销; 取不到为 null |
| postsCount | number | null | 发帖总数 |
| commentsCount | number | null | 评论总数 |
| contributions | number | 发帖 + 评论总数 (贡献数接口失败时没有这个键) |
| linkKarma | number | null | 发帖 karma |
| commentKarma | number | null | 评论 karma |
| totalKarma | number | null | 总 karma |
| contribution | number | null | 评论 karma (兼容旧键) |
| merits | number | null | 发帖 karma (兼容旧键) |
| registerTime | object | null | 注册时间 |
| targetUrl | string | 请求的链接 |
data.user.registerTime 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| text | string | ISO (只精确到天) |
| timestamp | number | 毫秒时间戳 |
data.works[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| workId | string | null | 作品 id (帖子 t3_ / 评论 t1_) |
| workType | string | 作品类型 可用值: [“post”, “comment”] |
| type | string | 同 workType 可用值: [“post”, “comment”] |
| id36 | string | 短 id |
| authorId | string | null | 作者 id (t2_) |
| url | string | null | 链接 |
| content | string | null | 帖子: 正文, 没有时用标题; 评论: 评论内容 |
| score | number | null | 得分 |
| likes | number | null | 得分 (同 score) |
| createdUtc | number | null | 发布时间秒级时间戳 |
| createdISO | string | null | 发布时间 ISO |
| subreddit | string | null | 子版块名 |
| subredditPrefixed | string | null | 带前缀的子版块名, 如 r/pics |
| stickied | boolean | 是否置顶 |
| title | string | null | 仅帖子: 标题 |
| selftext | string | null | 仅帖子: 正文 |
| comments | number | null | 仅帖子: 评论数 |
| domain | string | null | 仅帖子: 链接域名 |
| thumbnail | string | null | 仅帖子: 缩略图 |
| isSelf | boolean | 仅帖子: 是否自帖 |
| isVideo | boolean | 仅帖子: 是否视频 |
| over18 | boolean | 仅帖子: 是否 NSFW |
| spoiler | boolean | 仅帖子: 是否剧透 |
| flair | string | null | 仅帖子: 标签 |
| upvoteRatio | number | null | 仅帖子: 好评率 |
| body | string | null | 仅评论: 评论内容 |
| linkId | string | null | 仅评论: 所在帖子 id (t3_) |
| linkTitle | string | null | 仅评论: 所在帖子标题 |
| linkPermalink | string | null | 仅评论: 所在帖子链接 |
| isSubmitter | boolean | 仅评论: 是否楼主 |
| distinguished | string | null | 仅评论: 特殊身份标记 (moderator / admin) |
| controversiality | number | null | 仅评论: 是否有争议 (0 / 1) |
data.pagination 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| after | string | null | 下一页游标, 传回 options.after 续取 |
| hasMore | boolean | 是否还有更多 |
请求示例
返回示例
下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。
积点消耗说明
每份主页资料消耗 0.8 积点,附带作品免费。
空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

