互联网的首页
- 认证方式
- OAuth
- HTTPS
- Yes
- CORS
- Unknown
- 分类
- 社交
- 文档 / URL
- https://www.reddit.com/dev/api
简介
Reddit 的 API 提供全站帖子、评论、子版块和用户数据。官方路径是 OAuth(在 reddit.com/prefs/apps 注册应用 → client id/secret)。遗留的无密钥 .json 端点仍存在,但对非浏览器流量越来越受限。
2026-08 实测:公开的
www.reddit.com/r/.../hot.json端点从数据中心/云 IP 返回 HTTP 403(即使带浏览器 User-Agent)。请使用官方 OAuth API 获得可靠访问。
快速开始
官方 OAuth 流程(script 类型):
# 1. 获取令牌(script 应用):
curl -X POST "https://www.reddit.com/api/v1/access_token" \
-u "CLIENT_ID:SECRET" \
-d "grant_type=client_credentials"
# 2. 使用令牌:
curl "https://oauth.reddit.com/r/programming/hot?limit=5" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "User-Agent: my-app/1.0 by /u/yourname"
用户账号 OAuth(以用户身份读写):授权 → code → token → https://oauth.reddit.com/api/v1/me。
认证方式
- OAuth 必需(客户端凭证或授权码流程)。
- 描述性
User-Agent是强制的——Reddit 会拦截通用代理。 - 列表的 “OAuth” 标记是准确的。
速率限制与注意事项
- OAuth 应用:每个 OAuth client ID 100 次请求/分钟。
- 始终发送唯一
User-Agent(<平台>:<应用>:<版本> (by /u/<用户名>))。 .json端点(给任意 reddit URL 加.json)在住宅 IP 可能可用,但数据中心 IP 会被拦截(实测 403)。- 通过
after/before列表参数分页。
常见问题
Reddit API 免费吗? 是的——OAuth 访问免费,有限流(100 次/分钟)。
为什么 .json 端点返回 403? Reddit 会拦截数据中心/云 IP 访问遗留的无密钥端点——请用 OAuth。
如何获取 client id? reddit.com/prefs/apps → 创建 “script” 应用。
社交 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| 4chan Simple image-based bulletin board dedicated to a variety of topics | No auth | Yes | Yes | ↗ |
| Ayrshare Social media APIs to post, get analytics, and manage multiple users social media accounts | API Key | Yes | Yes | ↗ |
| aztro Daily horoscope info for yesterday, today, and tomorrow | No auth | Yes | Unknown | ↗ |
| Blogger The Blogger APIs allows client applications to view and update Blogger content | OAuth | Yes | Unknown | ↗ |
| Bluesky Decentralized social networking via the AT protocol | No auth | Yes | Yes | ↗ |