接口说明

Reddit Community API 获取 Reddit 社区帖子列表,支持排序、时间范围和分页参数。

使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。

请求URL

POST https://scrapeapi.pangolinfo.com/api/v1/social/reddit-community

请求头

参数名参数值类型说明
Content-Typeapplication/jsonstring数据格式
AuthorizationBearer xxxstring认证凭证

采集最长约75秒,客户端超时建议设为90秒。

请求参数

参数必填类型说明
targetYesstring子版块链接; 也可直接传子版块名 (可带 r/)
optionsNoobject仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。

options 参数说明

参数必填类型说明
sortNostring排序, 默认按 URL 或 hot;可选值:hot / new / top / rising / controversial
可用值: [“hot”, “new”, “top”, “rising”, “controversial”]
tNostringtop / controversial 的时间范围;可选值:hour / day / week / month / year / all
可用值: [“hour”, “day”, “week”, “month”, “year”, “all”]
limitNointeger每页条数, 默认 25, 最大 100
默认值: 25
最小值: 1
最大值: 100
afterNostring | null续页: 上次输出的 pagination.after
includeCommunityNoboolean拉子版块卡片, 默认 true

仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。

每次只取一页,用返回游标续取。

响应值

返回值类型说明
codeinteger状态码,0 表示成功
messagestring响应信息,成功时为 ok
pointCostnumber本次请求实际消耗的积点
dataobject返回数据,结构见下表
metaobject请求标识及耗时(毫秒)
billingobject计费条数、单价及规则版本

返回参数 data 说明

返回值类型说明
typestringType
可用值: [“community”]
subredditstring子版块名
sortstring排序: hot / new / top / rising / controversial
communityobject | null子版块摘要; 拉取失败为 null
postsobject[]含完整帖子字段的子版块帖子列表
countnumber本次返回条数
paginationobjectPagination

data.community 字段说明

返回值类型说明
urlstring子版块链接
namestring子版块名
descstring | null简介
weeklyVisitorsnumber | null周访客数
weeklyContributionsnumber | null周贡献数 (发帖 + 评论)
subredditIdstring | null子版块 id (t5_)

data.posts[] 字段说明

返回值类型说明
titlestring | null标题
captionTextstring正文 (Markdown); 链接帖为空串
publishedAtobject | null发布时间 (text 为 ISO)
likesnumber | null得分 (赞 - 踩)
commentsCountnumber | null评论数
videoobject | nullReddit 托管视频; 非视频帖为 null
redditPostIdstring帖子 id (t3_)
id36string | null帖子短 id (链接里那段)
urlstring | null帖子链接
linkUrlstring | null帖子指向的链接 (自帖为帖子本身)
domainstring | null链接域名 (自帖为 self.<子版块>)
subredditstring | null子版块名
flairstring | null帖子标签 (flair)
upsnumber | null赞数
upvoteRationumber | null好评率 (0 ~ 1)
numCrosspostsnumber | null被交叉转发次数
editedAtobject | null最后编辑时间; 没编辑过 text / value 为 null
isSelfboolean是否自帖 (纯文字)
isVideoboolean是否视频帖
over18boolean是否 NSFW
spoilerboolean是否剧透
stickiedboolean是否置顶
lockedboolean是否锁定 (禁止评论)
archivedboolean是否已归档 (不能投票 / 评论)
distinguishedstring | null特殊身份标记: moderator / admin; 普通为 null
postHintstring | null内容类型提示: self / link / image / hosted:video …
thumbnailstring | null缩略图
previewImagestring | null预览大图
redditVideoobject | null视频原始信息; 非视频帖为 null
galleryobject[]图集帖的图片; 非图集为空
contentstring | null正文; 没有为 null
posterobject作者

data.posts[].publishedAt 字段说明

返回值类型说明
textstring | null上游原始时间文本
valuenumber | null解析后的毫秒时间戳; 解析失败为 null

data.posts[].video 字段说明

返回值类型说明
srcstring | null视频地址 (HLS 优先)
previewstring | null预览图
posterstring | null封面

data.posts[].editedAt 字段说明

返回值类型说明
textstring | null上游原始时间文本
valuenumber | null解析后的毫秒时间戳; 解析失败为 null

data.posts[].redditVideo 字段说明

返回值类型说明
hlsUrlstringHLS 地址
fallbackUrlstringMP4 地址 (无声)
dashUrlstringDASH 地址
widthnumber宽
heightnumber高
durationnumber时长 (秒)

data.posts[].gallery[] 字段说明

返回值类型说明
urlstring图片链接
widthnumber | null宽
heightnumber | null高
captionstring | null图注

data.posts[].poster 字段说明

返回值类型说明
nicknamestring | null作者用户名
profileUrlstring | null作者主页
idstring | null作者 id (t2_)

data.pagination 字段说明

返回值类型说明
afterstring | null下一页游标, 传回 options.after 续取
hasMoreboolean是否还有更多

请求示例

curl --request POST \
  --url https://scrapeapi.pangolinfo.com/api/v1/social/reddit-community \
  --header 'Authorization: Bearer YOUR_PANGOLINFO_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "target": "https://www.reddit.com/r/programming/"
}'

返回示例

下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。

{
  "code": 0,
  "message": "ok",
  "pointCost": 4.0,
  "data": {
    "type": "community",
    "subreddit": "programming",
    "sort": "hot",
    "community": {
      "url": "https://www.reddit.com/r/programming/",
      "name": "programming",
      "desc": "Computer Programming",
      "weeklyVisitors": 215999,
      "weeklyContributions": 1608,
      "subredditId": "t5_2fwo"
    },
    "posts": [
      {
        "title": "openssh on musl linux has been letting people into password-less accounts since 2016",
        "captionText": "",
        "publishedAt": {
          "text": "2026-11-05T14:04:10.000Z",
          "value": 1793887450000
        },
        "likes": 531,
        "commentsCount": 74,
        "video": null,
        "redditPostId": "t3_1xojg3s",
        "id36": "1xojg3s",
        "url": "https://www.reddit.com/r/programming/comments/1xojg3s/openssh_on_musl_linux_has_been_letting_people/",
        "linkUrl": "https://sshhole.com/",
        "domain": "sshhole.com",
        "subreddit": "programming",
        "flair": null,
        "ups": 531,
        "upvoteRatio": 0.95,
        "numCrossposts": 1,
        "editedAt": {
          "text": null,
          "value": null
        },
        "isSelf": false,
        "isVideo": false,
        "over18": false,
        "spoiler": false,
        "stickied": false,
        "locked": false,
        "archived": false,
        "distinguished": null,
        "postHint": null,
        "thumbnail": null,
        "previewImage": null,
        "redditVideo": null,
        "gallery": [],
        "content": null,
        "poster": {
          "nickname": "ThisMachineIs4",
          "profileUrl": "https://www.reddit.com/user/ThisMachineIs4/",
          "id": "t2_cra0r"
        }
      }
    ],
    "count": 5,
    "pagination": {
      "after": null,
      "hasMore": true
    }
  },
  "meta": {
    "requestId": "pg-audit-r1-reddit-community-1793954309070149600",
    "durationMs": 4092
  },
  "billing": {
    "unitPrice": 0.8,
    "ruleVersion": "social-primary-v2",
    "billedCount": 5,
    "pointCost": 4.0
  }
}

积点消耗说明

每条主体结果消耗 0.8 积点。

空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

在线调试