# Reddit 用户活跃的社区 API (reddit.user_subreddits)

- Canonical page: [https://everyinfra.com/reddit-api/user_subreddits](https://everyinfra.com/reddit-api/user_subreddits?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "reddit", "action": "user_subreddits", "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=user_subreddits

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | Reddit 用户名，spez、u/spez 或个人主页链接都可以；返回这个用户个人页上显示的活跃社区。 |
| limit | integer (1–) | no | not declared | 这次调用最多返回的条数，整数，至少为 1；不传按默认值，实际返回可能少于这个数。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| community | 所属 subreddit 名称（不含 r/ 前缀）。 |
| community_id | 社区的 ID（t5_ 开头）。 |
| url | 该记录在原平台上的可访问链接。 |
| description | 简介或描述，通常比 text 短。 |
| member_count | 社区的成员数。 |
| icon_url | 社区图标或成就图标的图片地址。 |
| 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": "user_subreddits",
  "params": {
    "username": "Andromeda321"
  }
}'
```

```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": "user_subreddits",
        "params": {
            "username": "Andromeda321",
        },
    },
    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": "user_subreddits",
  "results": [
    {
      "community": …,
      "community_id": …,
      "url": …,
      "description": …,
      "member_count": …,
      "icon_url": …,
      "platform": …
    }
  ],
  "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
