# Reddit 使用者帖子 API

> 使用者發過的帖子，從新到舊：標題、正文、社群、得分和評論數。

網頁版：https://okdata.online/zh/apis/reddit/users/posts/list/

- **介面**：`GET /v1/reddit/users/posts/list`
- **ID**：`reddit.users.posts.list`
- **價格**：$0.002/次 · 每頁約 25 條帖子
- **返回**：一頁約 25 條帖子（`data.items`，Post 物件）
- **狀態**：預覽
- **適合**：競品監控

## 價格

每次呼叫 $0.002，返回一頁，約 25 條帖子。抓 1,000 條帖子大約要 40 次呼叫，合計 $0.08。每翻一頁是一次單獨的呼叫。請求到了平台的呼叫，返回為空、查不到或出錯也照常計費；還沒請求到平台就被攔下的不扣費。

## 引數

| 引數名 | 型別 | 必填 | 預設值 | 說明 |
|---|---|---|---|---|
| `username` | string | 是 |  | 使用者名稱，帶不帶 u/ 都行。（例：`nasa`） |
| `cursor` | string | 否 |  | 上一次返回的 page.next_cursor，原樣傳回。每翻一頁都是一次單獨的呼叫。 |
| `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/reddit/users/posts/list" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'username=nasa'
```

### Python

```python
import os
import requests

resp = requests.get(
    "https://api.okdata.online/v1/reddit/users/posts/list",
    headers={"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"},
    params={"username": "nasa"},
    timeout=60,
)
body = resp.json()
if body["code"] != "ok":
    raise RuntimeError(f"{body['code']}: {body['message']} (charged: {body['charged']})")

for row in body["data"]["items"]:
    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/reddit/users/posts/list');
url.searchParams.set('username', "nasa");

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}`);

for (const row of body.data.items) {
  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": "reddit.users.posts.list",
    "username": "nasa"
  }
}
```

或者對接好 MCP 的智慧體直接說：

> 用「Reddit 使用者帖子」找出點贊最多的五條內容，附連結。

## 返回示例

```json
{
  "code": "ok",
  "request_id": "0f6c2a8e-4b1d-4e0a-9a51-3c7d2b9e1f20",
  "data": {
    "items": [
      {
        "id": "t3_1nnrvkr",
        "url": "https://www.reddit.com/r/CampingGear/comments/1nnrvkr/two_nights_one_backpack/",
        "type": "text",
        "title": "Two nights, one backpack: what I would pack again",
        "text": "Full list and weights in the comments.",
        "lang": "en",
        "published_at": "2026-11-02T09:30:00Z",
        "author": {
          "id": "t2_1dkvvygb",
          "username": "trailkit",
          "name": "trailkit",
          "avatar_url": "https://cdn.example.com/avatar/trailkit.jpg",
          "followers": null,
          "verified": true
        },
        "metrics": {
          "views": null,
          "likes": 48200,
          "comments": 1312,
          "shares": 2210,
          "favorites": null,
          "reposts": null
        },
        "images": null,
        "hashtags": null
      }
    ]
  },
  "page": {
    "next_cursor": "c1.k3Vq9TzR0bYw2LmXe8NdPa",
    "cursor_expires_at": "2026-11-12T08:00:00Z",
    "has_more": true,
    "returned": 1
  },
  "warnings": [],
  "meta": {
    "capability": "reddit.users.posts.list",
    "result_status": "complete",
    "billing": {
      "amount": "0.002",
      "currency": "USD",
      "balance_after": "9.998"
    },
    "unavailable": {
      "metrics.views": "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/

## 常見問題

### Reddit 使用者帖子介面多少錢？

每次呼叫 $0.002，返回一頁，約 25 條帖子。抓 1,000 條帖子大約要 40 次呼叫，合計 $0.08。每翻一頁是一次單獨的呼叫。請求到了平台的呼叫，返回為空、查不到或出錯也照常計費；還沒請求到平台就被攔下的不扣費。

### 怎麼翻頁？

把返回裡的 page.next_cursor 原樣作為 cursor 引數傳回去。page.has_more 為 false 時就沒有下一頁了。每一頁都是一次 $0.002 的呼叫。

### 需要Reddit帳號、Cookie 或掃碼登入嗎？

不需要。只要帶上 okdata 的 API key。返回的是Reddit上的公開資料，不會用到你自己的Reddit帳號。

### 呼叫失敗會扣費嗎？

請求到了平台就會扣一次：返回為空、查不到、平台出錯或超時，都按一次呼叫計費（按條計價的按 1 條），錯誤裡 charged 為 true，並給出 amount。引數錯誤、餘額不足這類還沒請求到平台就被攔下的不扣費。

### Reddit不展示某個欄位怎麼辦？

這個欄位會是 null，meta.unavailable 裡會列出它和原因：platform（平台本來就不展示）或 capability（我們暫時取不到）。

## Reddit的其他介面

- [Reddit 帖子搜尋](https://okdata.online/zh/apis/reddit/posts/search/)：$0.004/次 · 每頁約 25 條帖子
- [Reddit 帖子詳情](https://okdata.online/zh/apis/reddit/posts/get/)：$0.002/次
- [Reddit 帖子評論](https://okdata.online/zh/apis/reddit/posts/comments/list/)：$0.002/次 · 每頁約 10 條評論
- [Reddit 熱門帖子](https://okdata.online/zh/apis/reddit/popular/posts/list/)：$0.002/次 · 每頁約 10 條帖子
- [Reddit 社群帖子](https://okdata.online/zh/apis/reddit/subreddits/posts/list/)：$0.004/次 · 每頁約 25 條帖子
- [Reddit 社群資料](https://okdata.online/zh/apis/reddit/subreddits/get/)：$0.002/次
- [Reddit 趨勢搜尋](https://okdata.online/zh/apis/reddit/trends/list/)：$0.002/次 · 每頁約 6 條榜單
- [Reddit 使用者資料](https://okdata.online/zh/apis/reddit/users/get/)：$0.002/次
- [Reddit 使用者活躍社群](https://okdata.online/zh/apis/reddit/users/subreddits/list/)：$0.002/次 · 每頁約 30 個帳號
- [Reddit 影片字幕](https://okdata.online/zh/apis/reddit/posts/transcript/get/)：$0.004/次

## 概要

- **簡稱**：Reddit 使用者帖子
- **英文名**：Reddit user posts API
- **分類**：[社交媒體](https://okdata.online/zh/categories/social/)
- **資料型別**：[帳號作品列表介面](https://okdata.online/zh/roles/accounts-posts-list/)
- **狀態**：預覽。還可能調整，改動會提前公告。
- **價格**：$0.002（約 ¥0.014） / 次 · 引數錯誤不扣費
- **返回**：每頁約 25 條帖子，帶翻下一頁的游標
- **調用出錯時**：照常計一次費。出錯時我們這邊先自動重試。請求到了平台的呼叫，出錯也按一次計費；引數錯誤不扣費。

## 什麼時候收費

- 返回了資料：$0.002，每次呼叫收一次
- 引數不合法、餘額不足、介面暫停：不收費

| 情況 | 收費 |
|---|---|
| 每翻一頁 | 另算一次呼叫：$0.002 |
| 單次最高扣費 | $0.002 |
| 空結果 | $0.002 |
| 查無此項（平台上沒有） | $0.002 |
| 平台出錯或超時 | $0.002 |
| 引數不合法、餘額不足、介面暫停 | 不收費 |
| 24 小時內帶同一個 Idempotency-Key 重發 | 直接返回儲存的結果，不扣費 |

請求到了平台的呼叫，返回為空、查不到或出錯也照常計費，收 $0.002；引數錯誤這類還沒請求平台就被攔下的不扣費。

價格取自價目表版本 fb99dc8a88674793。 [這個平台的全部價格](https://okdata.online/zh/pricing/reddit/)

- 新帳號送 $0.20 試用額度，不用綁卡：夠調這個介面 100 次。
- 抓 1,000 條帖子約要 40 次呼叫，合計 $0.08。

## 已知限制

- 每頁約 25 條帖子，條數由平台決定，沒有每頁條數引數。
- 翻下一頁時把 `page.next_cursor` 作為 `cursor` 傳回。游標 24 小時內有效。`page.has_more` 為 false 時就沒有下一頁了。

## 各檢視返回的欄位

“檢視”一列是欄位最早出現的 `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.favorites`：平台不展示（為 null，列在 meta.unavailable 裡）
- `metrics.reposts`：平台不展示（為 null，列在 meta.unavailable 裡）

## 這個介面的常見報錯

| 狀態碼 | 程式碼 | 含義 | 是否扣費 | 能否重試 |
|---|---|---|---|---|
| 400 | `invalid_params` | 引數缺失、型別或取值不對，或者請求方法不對。problems 列出每一處問題，param 是第一個出錯的引數。 | 否 | 修正後重試 |
| 400 | `cursor_mismatch` | cursor 發到了別的介面，或者引數和它所在那一頁不一樣（view 和 fields 可以變）。 | 否 | 修正後重試 |
| 401 | `unauthorized` | Key 缺失、格式不對、已撤銷、已停用或已過期（知道原因時 reason 會寫明）。 | 否 | 不要重試 |
| 402 | `insufficient_balance` | 餘額（available）不夠這次呼叫的最高費用（required）。 | 否 | 修正後重試 |
| 404 | `not_found` | 內容、帳號或頁面不存在或不公開。這次查詢請求到了平台、且產生了費用，或者介面的 charge_when_not_found 大於 0 時，這個結果會計費：返回體裡 charged 為 true，並給出 amount。 | 請求到了平台就扣一次 | 不要重試 |
| 410 | `cursor_expired` | cursor 超過了這個介面的有效期（page.cursor_expires_at 寫了到期時間）。 | 否 | 不要重試 |
| 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/)

## 其他平台的同類資料

- [抖音帳號作品列表](https://okdata.online/zh/apis/douyin/users/videos/list/)：$0.002/次 · 每頁約 20 條影片
- [小紅書博主筆記列表](https://okdata.online/zh/apis/xiaohongshu/users/notes/list/)：$0.03/次 · 每頁約 20 篇筆記
- [公眾號歷史文章](https://okdata.online/zh/apis/wechat_mp/accounts/articles/list/)：$0.02/次 · 每頁約 10 篇文章
- [X 帳號帖子列表](https://okdata.online/zh/apis/x/users/posts/list/)：$0.002/次 · 每頁約 20 條帖子
- [Instagram 帳號帖子](https://okdata.online/zh/apis/instagram/users/posts/list/)：$0.004/次 · 每頁約 12 條帖子
- [快手帳號作品](https://okdata.online/zh/apis/kuaishou/users/videos/list/)：$0.02/次 · 每頁約 20 條影片
- [知乎使用者文章](https://okdata.online/zh/apis/zhihu/users/articles/list/)（即將上線）：$0.002/次 · 每頁約 20 篇文章
- [影片號帳號作品](https://okdata.online/zh/apis/wechat_channels/users/videos/list/)：$0.02/次 · 每頁約 15 條影片
- [微博使用者微博](https://okdata.online/zh/apis/weibo/users/posts/list/)：$0.002/次 · 每頁約 20 條帖子
- [B站使用者投稿](https://okdata.online/zh/apis/bilibili/users/videos/list/)：$0.002/次 · 每頁約 30 條影片
- [TikTok 帳號作品](https://okdata.online/zh/apis/tiktok/users/videos/list/)：$0.002/次 · 每頁約 10 條影片
- [西瓜影片創作者作品](https://okdata.online/zh/apis/xigua/users/videos/list/)：$0.002/次 · 每頁約 30 條影片
- [Bluesky 帳號發帖](https://okdata.online/zh/apis/bluesky/users/posts/list/)：$0.001/次 · 每頁約 30 條帖子
- [Threads 帳號帖子](https://okdata.online/zh/apis/threads/users/posts/list/)：$0.003/次 · 每頁約 25 條帖子
- [微博使用者影片](https://okdata.online/zh/apis/weibo/users/videos/list/)：$0.002/次 · 每頁約 20 條影片

[帳號作品列表介面](https://okdata.online/zh/roles/accounts-posts-list/)

## 在你的 AI 裡用

> 先讀 https://okdata.online/zh/apis/reddit/users/posts/list.md，再用 okdata 幫我調這個介面，key 在環境變數 OKDATA_API_KEY 裡。用「Reddit 使用者帖子」找出點贊最多的五條內容，附連結。

## 用到這個介面的問答

- [Reddit 不再批新的 API 應用了，還有能給 Claude 或 Cursor 用的 Reddit MCP 服務嗎？](https://okdata.online/zh/answers/reddit-mcp-server-claude/): 有，但不是大多數 README 裡那種。GitHub 上的 Reddit MCP 服務一般要用你自己註冊的 Reddit 應用的 client ID 和 secret 去調 Reddit 的 Data API，而 Reddit 從 2026 年 10 月 31 日起不再受理新的 API 申請。okdata 的 MCP 服務（https://api.okdata.online/mcp）不需要 Reddit 應用：在 Claude 里加成自定義聯結器，或者寫進 Cursor 的 mcp.json，智慧體就能搜 Reddit（每頁約 25 條，$0.004）、讀帖子下的評論（每頁 $0.002），也能看任意版塊的熱門、最新和最高分帖子。把這週 5 個 subreddit 裡提到你產品的帖子都找出來，再讀討論最多的 10 個帖子下的評論，約 $0.076。
