reddit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Reddit Skill

Reddit Skill

Get posts, comments, subreddit info, and user profiles from Reddit via the public JSON API.
通过公开JSON API从Reddit获取帖子、评论、子版块信息和用户资料。

Prerequisites

前提条件

No API key required! Reddit's public JSON API works without authentication.
Quick Check:
bash
cd <skill_directory>
python3 scripts/get_posts.py python --limit 3
无需API密钥! Reddit的公开JSON API无需认证即可使用。
快速验证:
bash
cd <skill_directory>
python3 scripts/get_posts.py python --limit 3

Commands

命令

All commands run from the skill directory.
所有命令均在skill目录下运行。

Subreddit Posts

子版块帖子

bash
python3 scripts/get_posts.py python --limit 20           # Hot posts (default)
python3 scripts/get_posts.py python --sort new --limit 20
python3 scripts/get_posts.py python --sort top --time week
python3 scripts/get_posts.py python --sort top --time all --limit 10
bash
python3 scripts/get_posts.py python --limit 20           # 热门帖子(默认)
python3 scripts/get_posts.py python --sort new --limit 20
python3 scripts/get_posts.py python --sort top --time week
python3 scripts/get_posts.py python --sort top --time all --limit 10

Search Posts

搜索帖子

bash
python3 scripts/search_posts.py "AI agent" --limit 20
python3 scripts/search_posts.py "MCP server" --subreddit ClaudeAI --limit 10
python3 scripts/search_posts.py "async python" --sort top --time year
bash
python3 scripts/search_posts.py "AI agent" --limit 20
python3 scripts/search_posts.py "MCP server" --subreddit ClaudeAI --limit 10
python3 scripts/search_posts.py "async python" --sort top --time year

Subreddit Info

子版块信息

bash
python3 scripts/get_subreddit.py python
python3 scripts/get_subreddit.py ClaudeAI
bash
python3 scripts/get_subreddit.py python
python3 scripts/get_subreddit.py ClaudeAI

Post & Comments

帖子与评论

bash
python3 scripts/get_post.py abc123                       # Get post by ID
python3 scripts/get_post.py abc123 --comments 50         # With more comments
bash
python3 scripts/get_post.py abc123                       # 通过ID获取帖子
python3 scripts/get_post.py abc123 --comments 50         # 获取更多评论

User Profile

用户资料

bash
python3 scripts/get_user.py spez
python3 scripts/get_user.py spez --posts 10              # Include recent posts
bash
python3 scripts/get_user.py spez
python3 scripts/get_user.py spez --posts 10              # 包含近期帖子

Sort Options

排序选项

SortDescriptionTime Options
hot
Trending posts (default)-
new
Latest posts-
top
Highest votedhour, day, week, month, year, all
rising
Gaining traction-
controversial
Mixed voteshour, day, week, month, year, all
排序方式描述时间选项
hot
热门帖子(默认)-
new
最新帖子-
top
最高投票小时, 天, 周, 月, 年, 全部
rising
热度上升-
controversial
争议性小时, 天, 周, 月, 年, 全部

API Info

API信息

  • 方式:公开JSON API(无需认证)
  • 小技巧:在任意Reddit URL后添加
    .json
  • 请求限制:100次请求/分钟
  • 文档https://www.reddit.com/dev/api