reddit-api

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Reddit API

Reddit API

Reddit data on demand: cross-subreddit post search, subreddit and user search, subreddit info and feeds, single posts with full comment trees, sitewide best/hot/new/top feeds, and user profiles/posts/comments — one plain HTTP GET per call, paid as you go. No OAuth app registration, no client ID/secret pair, no Reddit API rate-limit tier.
Base URL:
https://reddit.fetcher.sh
按需获取Reddit数据:跨subreddit帖子搜索、subreddit与用户搜索、subreddit信息及帖子流、带完整评论树的单条帖子、全站最佳/热门/最新/置顶帖子流,以及用户资料/帖子/评论——每次调用仅需一个简单的HTTP GET请求,按需付费。无需注册OAuth应用,无需客户端ID/密钥对,不受Reddit API速率限制层级约束。
基础URL:
https://reddit.fetcher.sh

Authentication

认证

Two ways to pay, same data — full mechanics in the
fetcher
skill
:
bash
undefined
两种付费方式,获取相同数据——完整机制请查看
fetcher
技能
bash
undefined

1. Prepaid credits (recommended — get a key at https://fetcher.sh/topup

1. 预付费额度(推荐——可在https://fetcher.sh/topup获取密钥

or via POST /api/credits/topup, see the fetcher skill)

或通过POST /api/credits/topup,详情见fetcher技能)

export FETCHER_API_KEY="bby_live_xxxxxxxxxxxx" curl -H "Authorization: Bearer $FETCHER_API_KEY"
"https://reddit.fetcher.sh/api/search/post?keyword=hello"
export FETCHER_API_KEY="bby_live_xxxxxxxxxxxx" curl -H "Authorization: Bearer $FETCHER_API_KEY"
"https://reddit.fetcher.sh/api/search/post?keyword=hello"

2. x402 pay-per-call — omit the header; a GET with no payment returns 402

2. x402按调用付费——省略请求头;未付费的GET请求会返回402状态码

with machine-readable payment requirements (USDC on Base, Polygon,

并附带机器可读的付费要求(支持在Base、Polygon、

Arbitrum, Monad, or Solana). @x402/fetch signs and retries automatically.

Arbitrum、Monad或Solana链上使用USDC支付)。@x402/fetch会自动签名并重试请求。


Every response is `{ "status": number, "message": string, "data": ... }`; the
HTTP status mirrors `status`.

每个响应格式均为`{ "status": number, "message": string, "data": ... }`;HTTP状态码与`status`字段一致。

Endpoints (15 — all GET, $0.002/call)

接口(共15个——均为GET请求,每次调用$0.002)

EndpointWhat it returns
/api/search/post
Posts across every subreddit matching a keyword
/api/search/subreddit
Subreddits matching a keyword
/api/search/user
Users matching a keyword
/api/subreddit/{name}
A subreddit's info
/api/subreddit/{name}/posts
A subreddit's post feed
/api/post/{id}
A single post
/api/post/{id}/comments
A post's comment tree
/api/post/{id}/comments/{commentId}/replies
Replies to a comment
/api/posts/hot
Sitewide hot feed
/api/posts/new
Sitewide new feed
/api/posts/top
Sitewide top feed
/api/posts/best
Sitewide best feed
/api/user/{username}
A user's profile
/api/user/{username}/posts
A user's posts
/api/user/{username}/comments
A user's comments
{id}
/
{name}
/
{username}
are path parameters. Optional
sort
/
cursor
reorder and paginate;
keyword
(search) is required where it appears.
接口返回内容
/api/search/post
所有subreddit中匹配关键词的帖子
/api/search/subreddit
匹配关键词的subreddit
/api/search/user
匹配关键词的用户
/api/subreddit/{name}
某个subreddit的信息
/api/subreddit/{name}/posts
某个subreddit的帖子流
/api/post/{id}
单条帖子
/api/post/{id}/comments
某条帖子的评论树
/api/post/{id}/comments/{commentId}/replies
某条评论的回复
/api/posts/hot
全站热门帖子流
/api/posts/new
全站最新帖子流
/api/posts/top
全站置顶帖子流
/api/posts/best
全站最佳帖子流
/api/user/{username}
用户资料
/api/user/{username}/posts
用户发布的帖子
/api/user/{username}/comments
用户发布的评论
{id}
/
{name}
/
{username}
为路径参数。可选参数
sort
/
cursor
用于重新排序和分页;搜索接口中
keyword
为必填参数。

Scenarios

使用场景

Top posts about a topic, across every subreddit:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=ai agents" -G \
  --data-urlencode "sort=top" \
  "https://reddit.fetcher.sh/api/search/post"
Most discussed (highest comment count):
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=stablecoin payments" -G \
  --data-urlencode "sort=comments" \
  "https://reddit.fetcher.sh/api/search/post"
Newest first:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=x402" -G \
  --data-urlencode "sort=new" \
  "https://reddit.fetcher.sh/api/search/post"
Other
sort
values for
/api/search/post
:
relevance
,
hot
.
Search subreddits or users by keyword:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=machine learning" -G \
  "https://reddit.fetcher.sh/api/search/subreddit"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=spez" -G \
  "https://reddit.fetcher.sh/api/search/user"
A subreddit's info, then its hot/new/top feed:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/subreddit/MachineLearning"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "sort=top" -G \
  "https://reddit.fetcher.sh/api/subreddit/MachineLearning/posts"
A single post, its comment tree, and replies to one comment:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/post/1abcde2"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "sort=top" -G \
  "https://reddit.fetcher.sh/api/post/1abcde2/comments"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/post/1abcde2/comments/fghij3k/replies"
Sitewide feeds:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/posts/hot"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/posts/best"
A user's profile, posts, and comments:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/user/spez"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "sort=new" -G \
  "https://reddit.fetcher.sh/api/user/spez/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "sort=top" -G \
  "https://reddit.fetcher.sh/api/user/spez/comments"
跨所有subreddit获取某主题的置顶帖子:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=ai agents" -G \
  --data-urlencode "sort=top" \
  "https://reddit.fetcher.sh/api/search/post"
获取讨论量最高(评论数最多)的帖子:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=stablecoin payments" -G \
  --data-urlencode "sort=comments" \
  "https://reddit.fetcher.sh/api/search/post"
按最新排序:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=x402" -G \
  --data-urlencode "sort=new" \
  "https://reddit.fetcher.sh/api/search/post"
/api/search/post
接口的其他
sort
取值:
relevance
(相关性)、
hot
(热度)。
按关键词搜索subreddit或用户:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=machine learning" -G \
  "https://reddit.fetcher.sh/api/search/subreddit"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "keyword=spez" -G \
  "https://reddit.fetcher.sh/api/search/user"
获取某subreddit的信息,以及其热门/最新/置顶帖子流:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/subreddit/MachineLearning"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "sort=top" -G \
  "https://reddit.fetcher.sh/api/subreddit/MachineLearning/posts"
获取单条帖子、其评论树,以及某条评论的回复:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/post/1abcde2"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "sort=top" -G \
  "https://reddit.fetcher.sh/api/post/1abcde2/comments"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/post/1abcde2/comments/fghij3k/replies"
全站帖子流:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/posts/hot"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/posts/best"
获取用户资料、帖子及评论:
bash
curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  "https://reddit.fetcher.sh/api/user/spez"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "sort=new" -G \
  "https://reddit.fetcher.sh/api/user/spez/posts"

curl -H "Authorization: Bearer $FETCHER_API_KEY" \
  --data-urlencode "sort=top" -G \
  "https://reddit.fetcher.sh/api/user/spez/comments"

MCP

MCP

json
{
  "mcpServers": {
    "reddit": {
      "url": "https://reddit.fetcher.sh/mcp",
      "headers": { "Authorization": "Bearer bby_live_..." }
    }
  }
}
Free:
search_endpoints
,
describe_endpoint
,
check_balance
. Paid:
fetch_data
(any endpoint above),
topup_credits
, plus the named shortcut
reddit_search_post
. Drop the
headers
block to pay per call with x402 instead — see the
fetcher
skill
for the full flow.
json
{
  "mcpServers": {
    "reddit": {
      "url": "https://reddit.fetcher.sh/mcp",
      "headers": { "Authorization": "Bearer bby_live_..." }
    }
  }
}
免费接口:
search_endpoints
describe_endpoint
check_balance
。付费接口:
fetch_data
(上述任意接口)、
topup_credits
,以及命名快捷方式
reddit_search_post
。若要使用x402按调用付费,可删除
headers
块——完整流程请查看
fetcher
技能

Errors

错误码

  • 400
    — missing/invalid parameter (message names it)
  • 401
    — unknown or rotated key
  • 402
    — payment required (x402 challenge) or
    topup_required
    (credits exhausted)
  • 404
    — not a priced path
  • No rate limits; no refunds on upstream failures (settlement precedes delivery)
  • 400
    —— 参数缺失/无效(消息中会指明具体参数)
  • 401
    —— 密钥未知或已过期
  • 402
    —— 需要付费(x402验证)或
    topup_required
    (额度耗尽)
  • 404
    —— 路径未定价
  • 无速率限制;上游请求失败不予退款(结算优先于交付)

Reference

参考链接