Reddit 技能
透過公開 JSON API 從 Reddit 取得貼文、留言、subreddit 資訊和使用者檔案。
先決條件
無需 API 金鑰! Reddit 的公開 JSON API 無需驗證即可運作。
快速檢查:
cd <skill_directory>
python3 scripts/get_posts.py python --limit 3
指令
所有指令都從技能目錄執行。
Subreddit 貼文
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
搜尋貼文
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 資訊
python3 scripts/get_subreddit.py python
python3 scripts/get_subreddit.py ClaudeAI
貼文與留言
python3 scripts/get_post.py abc123 # 透過 ID 取得貼文
python3 scripts/get_post.py abc123 --comments 50 # 取得更多留言
使用者檔案
python3 scripts/get_user.py spez
python3 scripts/get_user.py spez --posts 10 # 包含近期貼文
排序選項
| 排序 | 說明 | 時間選項 |
|---|---|---|
hot | 熱門貼文(預設) | - |
new | 最新貼文 | - |
top | 最高票 | 小時、天、週、月、年、全部 |
rising | 逐漸受到關注 | - |
controversial | 正反意見皆有 | 小時、天、週、月、年、全部 |
API 資訊
- 方法:公開 JSON API(無需驗證)
- 技巧:在任何 Reddit URL 後加上
.json - 速率限制:100 個請求/每分鐘
- 文件:https://www.reddit.com/dev/api


