用途:通过 Product Hunt 官方 GraphQL API 检索内容,可获取帖子(posts)、主题(topics)、用户(users)和合集(collections)。当用户提到 Product Hunt、PH 时适用。
前置条件:需在 ~/.zshrc 中设置访问令牌: export PRODUCTHUNT_ACCESS_TOKEN="your_developer_token" 令牌获取地址:https://www.producthunt.com/v2/oauth/applications
快速检查:在技能目录下运行 python3 scripts/get_posts.py --limit 3
主要能力与用法(命令需在技能目录下运行): 帖子:python3 scripts/get_post.py chatgpt(按 slug)或 python3 scripts/get_post.py 12345(按 ID);python3 scripts/get_posts.py --limit 20 获取当日精选;--topic ai --limit 10 按主题;--after 2026-01-01 按日期;python3 scripts/get_post_comments.py POST_ID --limit 20 获取评论。 主题:python3 scripts/get_topic.py artificial-intelligence;python3 scripts/get_topics.py --query "AI" --limit 20 搜索;--limit 50 获取热门。 用户:python3 scripts/get_user.py rrhoover;python3 scripts/get_user_posts.py rrhoover --limit 20 获取用户帖子。 合集:python3 scripts/get_collection.py SLUG_OR_ID;python3 scripts/get_collections.py --featured --limit 20。
API 信息:端点 https://api.producthunt.com/v2/api/graphql;类型 GraphQL;速率限制 6250 复杂度积分/15 分钟;文档 https://api.producthunt.com/v2/docs。
限制:需自备开发者令牌,否则无法调用;仅覆盖上述公开查询能力,价格、具体返回字段等资料暂未提供。