# Reddit 内容详情 API (reddit.post_detail)

- Canonical page: https://everyinfra.com/reddit-api/post_detail
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "reddit", "action": "post_detail", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

Reddit 内容详情按帖子 `url` 返回单个对象，读的是这一帖本身的元数据：标题 `title`、正文 `text`、作者、发帖的板块 `community`、点赞数 `like_count`、评论数 `comment_count` 和分类标签 `flair`；帖子带链接或图片时，还有 `domain`、`external_link`、`thumbnail_url` 和 `image_urls`。它回答「这一帖到底发了什么」，评论内容要读评论那一页。

这一页只读单帖，不接受排序和时间窗参数。`flair` 保留帖子分类标签的原文，同一板块里可以按它把帖子分组。要整理一批热帖，可以先用全站热帖那一页取列表，再用这一页逐帖补全。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=reddit&action=post_detail

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 具体 Reddit 帖子 URL，返回该单帖元数据；不接受 sort 或 date_range。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| community | 所属 subreddit 名称（不含 r/ 前缀）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| flair | 帖子的分类标签（flair）原文。 |
| domain | 帖子链接的域名（文字帖为 self.版块名 或 reddit.com）。 |
| external_link | 链接帖指向的站外地址。 |
| thumbnail_url | 缩略图链接，分辨率低于 image_url。 |
| image_urls | 帖子里的图片地址。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "reddit",
  "action": "post_detail",
  "params": {
    "url": "https://www.reddit.com/r/AskUS/comments/1uzedcq/is_coffee_really_a_daily_ritual_for_most_americans/"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "reddit",
        "action": "post_detail",
        "params": {
            "url": "https://www.reddit.com/r/AskUS/comments/1uzedcq/is_coffee_really_a_daily_ritual_for_most_americans/",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "reddit",
  "action": "post_detail",
  "results": {
    "id": "1uzedcq",
    "url": "https://www.reddit.com/r/AskUS/comments/1uzedcq/is_coffee_really_a_daily_ritual_for_most_americans/",
    "title": "Is coffee really a daily ritual for most Americans? ☕",
    "author_username": "•••",
    "community": "AskUS",
    "like_count": 0,
    "comment_count": 98,
    "posted_at": "2026-07-17T22:34:04+00:00",
    "platform": "reddit"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `title` 为什么有时是 null？

平台上没有标题概念的帖子，例如纯文本帖，`title` 就是 null，不是读取失败。这时帖子内容只在 `text` 里，做列表展示时可以截取 `text` 的开头代替标题。

### 怎么区分文字帖和链接帖？

看 `domain` 和 `external_link`：文字帖的 `domain` 写成 self.版块名 或 reddit.com，链接帖的 `external_link` 是它指向的站外地址。有图时图片地址在 `image_urls`，`thumbnail_url` 是缩略图，分辨率更低。

### 能用 `like_count` 算作者的 karma 吗？

不能。接口没有作者 karma 字段；Reddit 把 karma 描述为帖子和评论所得投票的近似反映，并说明 upvote 与 karma 不是一比一，所以 `like_count` 和 `comment_count` 都不能换算成账号 karma。这两个数是 null 时说明平台没给出，不能按 0 算。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=reddit
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
