Reddit
Reddit Works API
获取 Reddit 账号或频道的作品列表。
接口说明
Reddit Works 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”] |
| limit | No | integer | 每页条数, 默认 / 最大 100 默认值: 100 最小值: 1 最大值: 100 |
| after | No | string | null | 续取作品: 上次输出的 pagination.after |
仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。
每次只取一页,用返回游标续取。
响应值
| 返回值 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,0 表示成功 |
| message | string | 响应信息,成功时为 ok |
| pointCost | number | 本次请求实际消耗的积点 |
| data | object | 返回数据,结构见下表 |
| meta | object | 请求标识及耗时(毫秒) |
| billing | object | 计费条数、单价及规则版本 |
返回参数 data 说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| type | string | Type 可用值: [“works”] |
| works | object[] | 作品 |
| pagination | object | Pagination |
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 计费说明。

