# Reddit 批量查帖子 API (reddit.posts_batch)

- Canonical page: [https://everyinfra.com/reddit-api/posts_batch](https://everyinfra.com/reddit-api/posts_batch?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "reddit", "action": "posts_batch", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Billing unit: each element in `urls` counts as one call; the number of elements you send sets the charge
- Returns: list
- Mode: sync only; everything it returns (every target of a batch, or every SKU of a product) is read in one call, and "mode": "async" returns 422 before any charge

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| urls | not declared | yes | not declared | 要查的 Reddit 帖子链接，数组，一次最多 20 个，不收逗号分隔的字符串；同一个帖子只能出现一次。每项是帖子链接（含 /comments/帖子ID/）或 redd.it 短链，不收 /s/ 开头的分享短链。按帖子个数计费；没查到的不收费，列在响应的 missed 里。 |
| limit | integer (1–) | no | not declared | 这次调用最多返回的条数，整数，至少为 1；不传按默认值，实际返回可能少于这个数。 |

## 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）。 |
| input | 这一行对应你传的哪一项，原样带回：posts_batch 是 urls 里的一项，comments_lookup 是 comment_urls 里的一项。 |

## 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": "posts_batch",
  "params": {
    "urls": [
      "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": "posts_batch",
        "params": {
            "urls": [
                "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

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "reddit",
  "action": "posts_batch",
  "results": [
    {
      "id": …,
      "url": …,
      "title": …,
      "text": …,
      "author_username": …,
      "community": …,
      "like_count": …,
      "comment_count": …,
      "posted_at": …,
      "flair": …,
      "domain": …,
      "external_link": …,
      "thumbnail_url": …,
      "image_urls": …,
      "platform": …,
      "input": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## 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
