SuperAPI AI 工具集

reddit-scraper

编程与开发

查看项目

更新于 10-16 01:39

技能介绍

用途:通过 Apify 的 parseforge/reddit-posts-scraper actor 抓取并搜索 Reddit 帖子与评论,适合查找讨论、追踪竞品提及、监控产品反馈和发现用户痛点。

主要能力:支持指定一个或多个子版块(逗号分隔)、关键词过滤(OR 逻辑)、时间范围(--days)、排序(hot/top/new/rising)、top 排序的时间窗口(hour/day/week/month/year/all)、每版块最大帖子数,以及 JSON 或人类可读 summary 输出。脚本会为每个子版块构建完整 Reddit URL,调用 Apify REST API,轮询运行完成后获取数据集,再做客户端关键词与日期过滤,并按 score 降序排序。

使用方式:需设置 APIFY_API_TOKEN 环境变量(或 --token),并安装依赖 pip install requests。示例:python3 skills/reddit-scraper/scripts/search_reddit.py --subreddit growthhacking --days 7 --sort top --time week;多版块示例:--subreddit "growthhacking,gtmengineering";关键词示例:--keywords "Langfuse,Arize,Langsmith";summary 输出:--output summary。直接调用 API 时必填 startUrls(完整 Reddit URL)、maxPostCount、scrollTimeout、searchType 和 proxyConfiguration(useApifyProxy 为 true),排序与时间由 URL 路径控制。

适用场景:竞品追踪、痛点发现、品牌监控等。

限制:小流量子版块用 --sort hot 可能返回零结果,建议改用 --sort top --time week 或 month;展示结果时应始终附带原帖 URL。详细 API 配置、令牌设置与速率限制见 references/apify-config.md。