# Reddit 按链接查评论 API (reddit.comments_lookup)

- Canonical page: [https://everyinfra.com/reddit-api/comments_lookup](https://everyinfra.com/reddit-api/comments_lookup?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "reddit", "action": "comments_lookup", "params": {...}}
- Price: $0.000792 per call ($0.79 per 1,000 requests); failed calls and empty results are not charged
- Returns: list
- Mode: sync; add "mode": "async" for slow tasks

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| comment_urls | not declared | yes | not declared | 要查的 Reddit 评论链接，数组，一次最多 20 条，不收逗号分隔的字符串；同一条评论只能出现一次。每项是评论自己的链接（comments 返回的每条评论的 url，形如 …/comments/帖子ID/comment/评论ID/），只给评论 ID 不行。按次计费，不按条数；没读到的评论不在结果里，一条都没读到时不收费。 |
| limit | integer (1–) | no | not declared | 这次调用最多返回的条数，整数，至少为 1；不传按默认值，实际返回可能少于这个数。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| community | 所属 subreddit 名称（不含 r/ 前缀）。 |
| url | 该记录在原平台上的可访问链接。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| post_title | 评论所在帖子的标题（user_comments、comments_lookup；painpoint 的 pain_comment 行）。 |
| post_url | 评论所在帖子的链接（comments_lookup）。 |
| 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": "comments_lookup",
  "params": {
    "comment_urls": [
      "https://www.reddit.com/r/pics/comments/1xwxo1e/comment/19sogasefdc5g/"
    ]
  }
}'
```

```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": "comments_lookup",
        "params": {
            "comment_urls": [
                "https://www.reddit.com/r/pics/comments/1xwxo1e/comment/19sogasefdc5g/",
            ],
        },
    },
    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": "comments_lookup",
  "results": [
    {
      "id": …,
      "text": …,
      "author_username": …,
      "like_count": …,
      "community": …,
      "url": …,
      "posted_at": …,
      "platform": …,
      "post_title": …,
      "post_url": …,
      "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
