# Product Hunt 产品详情 API

> 按链接取 Product Hunt 上的一个产品：名称、一句话介绍、简介、点赞数、评论数、评分、话题和发布时间。

网页版：https://okdata.online/zh/apis/producthunt/products/get/

- **接口**：`GET /v1/producthunt/products/get`
- **ID**：`producthunt.products.get`
- **价格**：$0.006/次
- **返回**：一个 Post 对象（`data.item`）
- **状态**：预览
- **适合**：选品定价、竞品监控

## 价格

每次调用 $0.006，返回一个结果。查 1,000 次共 $6.00。请求到了平台的查询，查不到或出错也照常计费；还没请求到平台就被拦下的不扣费。

## 参数

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| `url` | string | 是 |  | 产品的 Product Hunt 链接：https://www.producthunt.com/products/<slug>。（例：`https://www.producthunt.com/products/notion`） |
| `view` | string: brief / compact / standard / full | 否 | `standard` | 返回多少字段。brief：只给 ID、标题、正文前 100 字、链接、时间和主要数字，适合先扫一遍列表，再按 ID 取详情；compact 去掉空字段、长正文截到 500 字；full 会在 ext 里带上平台特有字段。 |
| `fields` | string[] | 否 |  | 只保留这些字段，按路径写（如 author.name），用来省 token。放在查询参数里时用逗号分隔。 |

cursor、view、fields 的用法见 [请求说明](https://okdata.online/zh/docs/requests/)。

## 返回字段

每一条都是一个 [Post](https://okdata.online/zh/docs/objects/post/)。

| 字段 | 类型 | 说明 |
|---|---|---|
| `id` | string | 内容在平台上的 ID。 |
| `url` | string | 内容链接。 |
| `type` | string | 内容类型。 |
| `title` | string \| null | 标题（视频、笔记、文章才有）。 |
| `text` | string | 文案、正文或简介，纯文本；文章为 Markdown。 |
| `lang` | string \| null | 语言代码，平台给出或检测得到。 |
| `published_at` | string \| null | 发布时间，ISO 8601，UTC；只有平台不给时间（wechat_mp.articles.metrics、wechat_channels.videos.metrics、youtube.channels.videos.list 取 Shorts 时）或某次回答里缺了时间（youtube.videos.get 偶尔会）时为 null，并列在 meta.unavailable 里。不会是空字符串。 |
| `author` | AccountRef | 发布者。 |
| `metrics` | Metrics | 抓取时的数据；平台不公开的为 null。 |
| `images` | string[] \| null | 图文内容的图片地址。 |
| `hashtags` | string[] \| null | 话题标签，不带 #。 |
| `ext` | object | 平台特有字段，只在 view=full 时返回。 |

## 请求示例

### cURL

```bash
curl -G "https://api.okdata.online/v1/producthunt/products/get" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'url=https://www.producthunt.com/products/notion'
```

### Python

```python
import os
import requests

resp = requests.get(
    "https://api.okdata.online/v1/producthunt/products/get",
    headers={"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"},
    params={"url": "https://www.producthunt.com/products/notion"},
    timeout=60,
)
body = resp.json()
if body["code"] != "ok":
    raise RuntimeError(f"{body['code']}: {body['message']} (charged: {body['charged']})")

row = body["data"]["item"]
print(row["id"], row["metrics"]["likes"], row["text"][:60])
print("cost: $" + body["meta"]["billing"]["amount"])
```

### TypeScript

```ts
const url = new URL('https://api.okdata.online/v1/producthunt/products/get');
url.searchParams.set('url', "https://www.producthunt.com/products/notion");

const res = await fetch(url, {
  headers: {
    Authorization: `Bearer ${process.env.OKDATA_API_KEY}`,
  },
});
const body = await res.json();
if (body.code !== 'ok') throw new Error(`${body.code}: ${body.message}`);

const row = body.data.item;
console.log(row.id, row.metrics.likes, row.text.slice(0, 60));
console.log('cost: $' + body.meta.billing.amount);
```

### MCP

```json
{
  "name": "call",
  "arguments": {
    "capability": "producthunt.products.get",
    "url": "https://www.producthunt.com/products/notion"
  }
}
```

或者对接好 MCP 的智能体直接说：

> 用「Product Hunt 产品详情」找出点赞最多的五条内容，附链接。

## 返回示例

```json
{
  "code": "ok",
  "request_id": "0f6c2a8e-4b1d-4e0a-9a51-3c7d2b9e1f20",
  "data": {
    "item": {
      "id": "trailkit",
      "url": "https://www.producthunt.com/products/trailkit",
      "type": "text",
      "title": "Trail Kit",
      "text": "Plan a two-night hike and pack the lightest kit",
      "lang": "en",
      "published_at": "2026-11-02T09:30:00Z",
      "author": {
        "id": "",
        "username": null,
        "name": null,
        "avatar_url": null,
        "followers": null,
        "verified": null
      },
      "metrics": {
        "views": null,
        "likes": 48200,
        "comments": 1312,
        "shares": null,
        "favorites": null,
        "reposts": null
      },
      "images": null,
      "hashtags": null
    }
  },
  "warnings": [],
  "meta": {
    "capability": "producthunt.products.get",
    "result_status": "complete",
    "billing": {
      "amount": "0.006",
      "currency": "USD",
      "balance_after": "9.994"
    },
    "unavailable": {
      "metrics.views": "platform",
      "metrics.shares": "platform",
      "metrics.favorites": "platform",
      "metrics.reposts": "platform"
    },
    "cached": false,
    "replayed": false,
    "fetched_at": "2026-11-11T08:00:00Z"
  }
}
```

## 错误

所有错误同一种结构：code、request_id、message 和 message_zh（每个 code 一句固定的话）、charged、retry、retry_after_seconds、param 和 docs_url，具体问题写在 problems 里。请求到了平台的调用出错（查不到、平台失败或超时）时，按这个接口的价格计一次费，charged 为 true，并给出 amount；参数错误这类还没请求到平台的错误不扣费。只有 settlement_unknown 的扣费结果要查询后才知道。完整列表：https://okdata.online/zh/docs/errors/

## 常见问题

### Product Hunt 产品详情接口多少钱？

每次调用 $0.006，返回一个结果。查 1,000 次共 $6.00。请求到了平台的查询，查不到或出错也照常计费；还没请求到平台就被拦下的不扣费。

### 可以直接传分享链接吗？

可以。把链接放进 url 参数，okdata 会从中解析出 ID，短链接也行。

### 需要Product Hunt账号、Cookie 或扫码登录吗？

不需要。只要带上 okdata 的 API key。返回的是Product Hunt上的公开数据，不会用到你自己的Product Hunt账号。

### 调用失败会扣费吗？

请求到了平台就会扣一次：返回为空、查不到、平台出错或超时，都按一次调用计费（按条计价的按 1 条），错误里 charged 为 true，并给出 amount。参数错误、余额不足这类还没请求到平台就被拦下的不扣费。

### Product Hunt不展示某个字段怎么办？

这个字段会是 null，meta.unavailable 里会列出它和原因：platform（平台本来就不展示）或 capability（我们暂时取不到）。

## Product Hunt的其他接口

- [Product Hunt 热门新品](https://okdata.online/zh/apis/producthunt/products/trending/)：$0.003/次 · 每页约 20 个商品
- [Product Hunt 产品评价](https://okdata.online/zh/apis/producthunt/products/reviews/list/)：$0.003/次 · 每页约 20 条评价

## 概要

- **简称**：Product Hunt 产品详情
- **英文名**：Product Hunt product details API
- **也叫**：Product Hunt 产品
- **分类**：[社交媒体](https://okdata.online/zh/categories/social/)
- **数据类型**：[商品详情接口](https://okdata.online/zh/roles/products-get/)
- **状态**：即将上线。已列出但还不能调用：调用会返回 capability_paused，不收费。
- **价格**：$0.006（约 ¥0.043） / 次 · 参数错误不扣费
- **返回**：一个 Post，放在 data.item 里
- **调用出错时**：照常计一次费。出错时我们这边先自动重试。请求到了平台的调用，出错也按一次计费；参数错误不扣费。

## 什么时候收费

- 返回了数据：$0.006，每次调用收一次
- 参数不合法、余额不足、接口暂停：不收费

| 情况 | 收费 |
|---|---|
| 单次最高扣费 | $0.006 |
| 空结果 | $0.006 |
| 查无此项（平台上没有） | $0.006 |
| 平台出错或超时 | $0.006 |
| 参数不合法、余额不足、接口暂停 | 不收费 |
| 24 小时内带同一个 Idempotency-Key 重发 | 直接返回保存的结果，不扣费 |

请求到了平台的调用，返回为空、查不到或出错也照常计费，收 $0.006；参数错误这类还没请求平台就被拦下的不扣费。

价格取自价目表版本 5975d8e8b43d9ecb。 [这个平台的全部价格](https://okdata.online/zh/pricing/producthunt/)

- 新账号送 $0.20 试用额度，不用绑卡。
- 查 1,000 次共 $6.00。

## 各视图返回的字段

“视图”一列是字段最早出现的 `view`：`compact` 只返回 compact 字段，`standard` 再加上 standard 字段，`full` 返回全部。默认是 `standard`。

- `compact`：`id`, `url`, `type`, `title`, `text`, `published_at`, `author`, `metrics`
- `standard`：`lang`, `images`, `hashtags`
- `full`：`ext`

## 这个接口给不了的

- `metrics.views`：平台不展示（为 null，列在 meta.unavailable 里）
- `metrics.shares`：平台不展示（为 null，列在 meta.unavailable 里）
- `metrics.favorites`：平台不展示（为 null，列在 meta.unavailable 里）
- `metrics.reposts`：平台不展示（为 null，列在 meta.unavailable 里）

## 这个接口的常见报错

| 状态码 | 代码 | 含义 | 是否扣费 | 能否重试 |
|---|---|---|---|---|
| 400 | `invalid_params` | 参数缺失、类型或取值不对，或者请求方法不对。problems 列出每一处问题，param 是第一个出错的参数。 | 否 | 修正后重试 |
| 401 | `unauthorized` | Key 缺失、格式不对、已撤销、已停用或已过期（知道原因时 reason 会写明）。 | 否 | 不要重试 |
| 402 | `insufficient_balance` | 余额（available）不够这次调用的最高费用（required）。 | 否 | 修正后重试 |
| 404 | `not_found` | 内容、账号或页面不存在或不公开。这次查询请求到了平台、且产生了费用，或者接口的 charge_when_not_found 大于 0 时，这个结果会计费：返回体里 charged 为 true，并给出 amount。 | 请求到了平台就扣一次 | 不要重试 |
| 429 | `rate_limited` | 账号这一分钟请求太多（reason: rate），或同时进行的调用太多（reason: concurrency）。 | 否 | 可以重试 |
| 500 | `settlement_unknown` | 数据已返回，但没能确认是否扣费。 | 查询后才知道 | 用同一个 Idempotency-Key 重试 |
| 502 | `fetch_failed` | 我们这边自动重试后，这次请求仍然失败了。如果请求到了平台、且这次请求产生了费用，就按接口价格计一次费（charged 为 true，并给出 amount）；否则不计费。 | 请求到了平台就扣一次 | 可以重试 |
| 503 | `capability_paused` | 这个接口暂时停用了，这次没有执行。 | 否 | 可以重试 |
| 504 | `timeout` | 数据没有及时返回。如果请求到了平台、且这次请求产生了费用，就按接口价格计一次费（charged 为 true，并给出 amount）；否则预扣退回。 | 请求到了平台就扣一次 | 可以重试 |

[全部错误码](https://okdata.online/zh/docs/errors/)

## 其他平台的同类数据

- [TikTok Shop 商品详情](https://okdata.online/zh/apis/tiktok/shop/products/get/)：$0.003/次
- [小红书商城商品详情](https://okdata.online/zh/apis/xiaohongshu/shop/products/get/)：$0.02/次
- [亚马逊商品详情](https://okdata.online/zh/apis/amazon/products/get/)：$0.015/次
- [速卖通商品详情](https://okdata.online/zh/apis/aliexpress/products/get/)（即将上线）：$0.002/次
- [淘宝商品详情](https://okdata.online/zh/apis/taobao/products/get/)：$0.043/次
- [1688 商品详情](https://okdata.online/zh/apis/alibaba_1688/products/get/)：$0.029/次
- [闲鱼商品详情](https://okdata.online/zh/apis/xianyu/products/get/)：$0.029/次
- [抖音电商商品详情](https://okdata.online/zh/apis/douyin_shop/products/get/)：$0.052/次
- [京东商品详情](https://okdata.online/zh/apis/jd/products/get/)：$0.115/次
- [Shopee 商品详情](https://okdata.online/zh/apis/shopee/products/get/)（即将上线）：$0.003/次
- [eBay 商品详情](https://okdata.online/zh/apis/ebay/products/get/)：$0.002/次
- [G2 软件详情](https://okdata.online/zh/apis/g2/products/get/)：$0.003/次
- [Walmart 商品详情](https://okdata.online/zh/apis/walmart/products/get/)：$0.003/次
- [Etsy 商品详情](https://okdata.online/zh/apis/etsy/products/get/)：$0.003/次
- [Temu 商品详情](https://okdata.online/zh/apis/temu/products/get/)：$0.005/次

[商品详情接口](https://okdata.online/zh/roles/products-get/)

## 即将上线

这个接口已经列出，但还不能调用：现在调用会返回 capability_paused，不收费。本页的参数、字段和价格就是它上线时的契约；什么时候上线，看运行状态页和更新日志。
