mcpField
P
producthunt

producthunt

github.com/dylanfeltus营销与增长180231 次安装7 周前更新
代码仓库

关于 producthunt

producthunt 面向关注 Product Hunt 产品和发布动态的开发者与营销人员。它通过 GraphQL V2 API 按主题或日期浏览并获取帖子详情;按名称查找时可改用网页搜索。

主要功能

  1. 01按主题和日期浏览发布内容
  2. 02通过 slug 获取帖子详情
  3. 03查看投票数、评论和制作者
  4. 04查询用户和主题
  5. 05通过网页搜索补充产品名称查询

适用场景

  1. 01查找当天或本周发布的产品
  2. 02追踪某个类别的产品
  3. 03研究发布产品的反馈
  4. 04监测相似产品或竞争产品

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/dylanfeltus/skills --skill producthunt

安装后在 Claude Code 中输入/producthunt确认已加载。

附带文件README.md

详细介绍

Product Hunt 搜索与监控

通过 GraphQL V2 API 搜索产品、跟踪发布,并监控 Product Hunt 动态。

适用场景

  • 用户询问某个产品在 Product Hunt 上的发布情况或表现
  • 用户想查找某个类别中的热门产品
  • 用户想监控 Product Hunt 上的竞争对手或类似产品
  • 用户询问“今天/本周 Product Hunt 上发布了什么”
  • 用户想研究某个产品在 PH 上的反响

要求

需要 API 令牌。 Product Hunt API 需要身份验证,不过免费,设置大约只需 2 分钟。

获取令牌
  1. 前往 API 控制面板
  2. 创建一个应用(名称/URL 任意)
  3. 使用应用页面底部的 Developer Token(只读访问无需 OAuth 流程)
  4. 将令牌存储在环境变量中:PH_API_TOKEN

如果没有令牌,请改用 web_search,并使用 site:producthunt.com 查询。

主要限制:不支持文本搜索

Product Hunt API 不支持对帖子进行自由文本搜索。你可以按主题、日期浏览,或通过 slug 获取特定帖子,但不能搜索“AI 写作工具”并获取匹配的产品。

要按名称查找产品,请先使用 web_search:

web_search: site:producthunt.com/posts "product name"

然后使用搜索结果中的 slug 查询 API,获取完整详情(投票数、评论、创作者等)。

API 概览

  • 端点: https://api.producthunt.com/v2/api/graphql
  • 方法: POST
  • 身份验证: Authorization: Bearer {token}
  • 格式: GraphQL
  • 速率限制: 每 15 分钟约 900 次请求,每个查询的复杂度上限为 1000

查询方法

使用 exec 和 curl 发起 GraphQL 请求:

curl -s -X POST https://api.producthunt.com/v2/api/graphql \
  -H "Authorization: Bearer $PH_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "YOUR_GRAPHQL_QUERY"}'

常用查询

今日热门帖子
query {
  posts(order: VOTES, first: 10) {
    edges {
      node {
        id
        name
        tagline
        votesCount
        commentsCount
        url
        website
        createdAt
        makers {
          name
          username
        }
        topics {
          edges {
            node {
              name
            }
          }
        }
      }
    }
  }
}
按主题浏览帖子
query {
  posts(order: VOTES, first: 10, topic: "developer-tools") {
    edges {
      node {
        id
        name
        tagline
        votesCount
        url
        website
      }
    }
  }
}

请记住: 这是按主题浏览,并非文本搜索。要按名称查找特定产品,请使用 web_search 并查询 site:producthunt.com/posts "product name",然后通过 API 按 slug 查找帖子。

获取特定帖子
query {
  post(slug: "chatgpt") {
    id
    name
    tagline
    description
    votesCount
    commentsCount
    reviewsCount
    reviewsRating
    url
    website
    createdAt
    featuredAt
    makers {
      name
      username
      headline
    }
    topics {
      edges {
        node {
          name
          slug
        }
      }
    }
    comments(first: 5) {
      edges {
        node {
          body
          votesCount
          createdAt
          user {
            name
            username
          }
        }
      }
    }
  }
}
按主题获取帖子
query {
  topic(slug: "artificial-intelligence") {
    name
    postsCount
    posts(first: 10, order: VOTES) {
      edges {
        node {
          name
          tagline
          votesCount
          url
          createdAt
        }
      }
    }
  }
}
获取特定日期的帖子
query {
  posts(postedAfter: "2024-01-15T00:00:00Z", postedBefore: "2024-01-16T00:00:00Z", order: VOTES, first: 10) {
    edges {
      node {
        name
        tagline
        votesCount
        url
      }
    }
  }
}
查找用户
query {
  user(username: "rrhoover") {
    name
    username
    headline
    followersCount
    followingCount
    madePosts(first: 5) {
      edges {
        node {
          name
          tagline
          votesCount
          url
        }
      }
    }
  }
}

可用主题(常见 Slug)

  • artificial-intelligence、developer-tools、design-tools
  • productivity、marketing、saas、fintech
  • no-code、open-source、social-media
  • web-app、iphone、android、mac、chrome-extensions

要获取完整列表,请查询:

query { topics(first: 50, order: FOLLOWERS_COUNT) { edges { node { name slug followersCount } } } }

构造 Product Hunt 链接

  • 产品页面: https://www.producthunt.com/posts/{slug}
  • 用户资料: https://www.producthunt.com/@{username}
  • 主题页面: https://www.producthunt.com/topics/{slug}

后备方案:没有 API 令牌

如果没有 PH_API_TOKEN:

  1. 使用 web_search,查询类似以下内容:
    • site:producthunt.com/posts "product name"
    • site:producthunt.com "topic" launched
  2. 使用 web_fetch 获取特定 Product Hunt URL 的基本信息
  3. 告知用户,获取更丰富的数据(投票数、评论、创作者信息)需要 API 令牌

输出格式

### Product Hunt Results

1. **Product Name** — Tagline
   🔼 votes · 💬 comments · ⭐ rating
   By @maker_username
   Topics: AI, Developer Tools
   🔗 product_url
   🏠 website_url
   📅 launched_date

2. ...

错误处理

  • 401 Unauthorized: 令牌无效或已过期。检查 PH_API_TOKEN。
  • 429 Rate Limited: 等待 15 分钟,直到速率限制重置。
  • 超出复杂度限制: 减少字段数量或嵌套查询。移除 comments、topics 或 makers 子查询。
  • 未找到帖子: slug 可能有误。先尝试使用 web_search 搜索,确认准确的 slug。
  • 主题没有结果: 检查主题 slug;使用主题查询查找有效的 slug。

示例

示例 1:“今天 Product Hunt 上发布了什么?”

查询今天的帖子,按投票数排序,并展示前 10 个。

示例 2:“Linear 在 Product Hunt 上的表现如何?”
  1. 搜索:web_search "site:producthunt.com/posts linear"
  2. 从结果中获取 slug
  3. 查询:post(slug: "linear-5"),获取完整详情
示例 3:“展示本月 Product Hunt 上热门的 AI 工具”
  1. 按主题 artificial-intelligence 查询帖子,并设置日期筛选条件
  2. 按投票数排序,展示排名靠前的结果

数据源

Product Hunt API V2 — GraphQL API,需要免费的开发者令牌。

评论

支持 Markdown