Reddit API
子版、貼文與用戶個人檔案。
- 子版排序:
hot(預設)、new、top、rising - 搜尋排序:
relevance(預設)、hot、top、new、comments - 每次請求最多回傳 100 篇貼文
- NSFW 子版可存取但會在回應中標記
- 私人子版無法存取
子版
GET /reddit/subreddits/:name — 2 點數
取得子版資訊。
| 參數 | 類型 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
name | string | 是 | — | 子版名稱 |
cURL
curl -H "x-api-key: sk_byc_xxx" \
https://api.bycrawl.com/reddit/subreddits/programming回應
{
"name": "programming",
"title": "programming",
"description": "Computer Programming",
"subscribers": 6847410,
"activeUsers": null,
"createdAt": "2006-02-28T18:19:29.000Z",
"isNsfw": false,
"icon": "https://...",
"banner": ""
}GET /reddit/subreddits/:name/posts — 2 點數
取得子版的貼文。
| 參數 | 類型 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
name | string | 是 | — | 子版名稱 |
sort | string | 否 | hot | hot、new、top、rising |
t | string | 否 | all | 時間篩選(sort=top 時使用):hour、day、week、month、year、all |
count | integer | 否 | 25 | 貼文數量(最多 100) |
after | string | 否 | — | 上次回應的分頁游標 |
cURL
curl -H "x-api-key: sk_byc_xxx" \
"https://api.bycrawl.com/reddit/subreddits/programming/posts?sort=top&count=10"回應
{
"posts": [
{
"id": "1qoxwdt",
"title": "State of the Subreddit (January 2027): Mo...",
"author": "ketralnis",
"subreddit": "programming",
"score": 113,
"upvoteRatio": 0.94,
"commentCount": 78,
"createdAt": "2026-01-28T01:54:14.000Z",
"url": "https://www.reddit.com/r/programming/comments/1qoxwdt/...",
"permalink": "https://www.reddit.com/r/programming/comments/1qoxwdt/...",
"selftext": "tl;dr: mods applications and minor rules ch...",
"media": []
}
// ... 更多貼文
],
"after": "t3_1rn5az3"
}貼文
GET /reddit/posts/:postId — 2 點數
依 ID 取得單一 Reddit 貼文。
| 參數 | 類型 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
postId | string | 是 | — | Reddit 貼文 ID |
cURL
curl -H "x-api-key: sk_byc_xxx" \
https://api.bycrawl.com/reddit/posts/1qoxwdt回應
{
"id": "1qoxwdt",
"title": "State of the Subreddit (January 2027): Mo...",
"author": "ketralnis",
"subreddit": "programming",
"score": 113,
"upvoteRatio": 0.94,
"commentCount": 78,
"createdAt": "2026-01-28T01:54:14.000Z",
"url": "https://www.reddit.com/r/programming/comments/1qoxwdt/...",
"permalink": "https://www.reddit.com/r/programming/comments/1qoxwdt/...",
"selftext": "tl;dr: mods applications and minor rules ch...",
"media": []
}GET /reddit/posts/search?q=xxx — 2 點數
搜尋 Reddit 貼文。
| 參數 | 類型 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
q | string | 是 | — | 搜尋關鍵字 |
sort | string | 否 | relevance | relevance、hot、top、new、comments |
t | string | 否 | all | 時間篩選(sort=top 時使用):hour、day、week、month、year、all |
count | integer | 否 | 25 | 結果數量(最多 100) |
after | string | 否 | — | 上次回應的分頁游標 |
cURL
curl -H "x-api-key: sk_byc_xxx" \
"https://api.bycrawl.com/reddit/posts/search?q=bitcoin&count=5"回應
{
"posts": [
{
"id": "1rciij4",
"title": "Bitcoin is a trap",
"author": "tururururur134",
"subreddit": "Buttcoin",
"score": 123,
"upvoteRatio": 0.89,
"commentCount": 141,
"createdAt": "2026-02-23T14:13:05.000Z",
"url": "https://www.reddit.com/r/Buttcoin/comments/1rciij4/...",
"permalink": "https://www.reddit.com/r/Buttcoin/comments/1rciij4/...",
"selftext": "Bitcoin is a speculative and volatile trap...",
"media": []
}
// ... 更多貼文
],
"after": "t3_1r262za"
}用戶
GET /reddit/users/:username — 2 點數
取得 Reddit 用戶個人檔案。
| 參數 | 類型 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
username | string | 是 | — | Reddit 用戶名稱 |
cURL
curl -H "x-api-key: sk_byc_xxx" \
https://api.bycrawl.com/reddit/users/spez回應
{
"name": "spez",
"id": "1w72",
"createdAt": "2005-06-06T04:00:00.000Z",
"linkKarma": 181185,
"commentKarma": 754451,
"totalKarma": 935636,
"icon": "https://...",
"isGold": true,
"isMod": true
}GET /reddit/users/:username/posts — 2 點數
取得 Reddit 用戶發布的貼文。
| 參數 | 類型 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
username | string | 是 | — | Reddit 用戶名稱 |
sort | string | 否 | new | new、hot、top |
t | string | 否 | all | 時間篩選(sort=top 時使用):hour、day、week、month、year、all |
count | integer | 否 | 25 | 貼文數量(最多 100) |
after | string | 否 | — | 上次回應的分頁游標 |
cURL
curl -H "x-api-key: sk_byc_xxx" \
"https://api.bycrawl.com/reddit/users/spez/posts?sort=top&count=10"回應
{
"posts": [
{
"id": "1qoxwdt",
"title": "State of the Subreddit (January 2027): Mo...",
"author": "spez",
"subreddit": "reddit",
"score": 113,
"upvoteRatio": 0.94,
"commentCount": 78,
"createdAt": "2026-01-28T01:54:14.000Z",
"url": "https://www.reddit.com/r/reddit/comments/1qoxwdt/...",
"permalink": "https://www.reddit.com/r/reddit/comments/1qoxwdt/...",
"selftext": "...",
"media": []
}
// ... more posts
],
"after": "t3_1rn5az3"
}