# Reddit Subreddit posts API (reddit.subreddit_posts)

- Canonical page: https://everyinfra.com/en/reddit-api/subreddit_posts
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "reddit", "action": "subreddit_posts", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 10, max 100 per call
- 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=subreddit_posts

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| subreddit | not declared | yes | not declared | Specifies the target subreddit for `subreddit_posts`, such as `python` or a full subreddit URL. For subreddit names that start with `r`, pass the full `/r/subreddit/` URL and check the result. |
| date_range | enum: all_time / past_day / past_hour / past_month / past_week / past_year | no | not declared | Filters posts by time range for subreddit and user listings. Allowed values are `all_time`, `past_hour`, `past_day`, `past_week`, `past_month`, and `past_year`. Whether filtering applies depends on the result set when using fixed post URLs or unsupported sort orders. This cannot be used to filter comments by date. |
| sort | enum: newest / popular / relevance / rising / top | no | not declared | Orders Reddit post listings by `newest`, `popular`, `relevance`, `rising`, or `top`. The `post_detail` and `comments` actions do not accept `sort`. |
| limit | integer (1–100) | no | 10 | The most rows to return in this call, an integer from 1 to 100. The default applies when you leave it out, and a call can return fewer rows. Larger values return 422 before any charge. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| url | Link to the record on the platform. |
| title | Title. null when the platform has no titles (for example text-only posts). |
| text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
| author_username | Author's username (@handle), usually usable in URLs. |
| community | platform-native meaning |
| like_count | Likes. null means the platform or this capability does not disclose it; it is not 0. |
| comment_count | Comments. null means not disclosed, not 0. |
| posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
| flair | platform-native meaning |
| domain | platform-native meaning |
| external_link | platform-native meaning |
| thumbnail_url | Thumbnail link, lower resolution than image_url. |
| image_urls | Array of image links in the platform's display order; absent when there are no images. |
| platform | Source platform identifier, the same as platform in the request (for example 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": "subreddit_posts",
  "params": {
    "subreddit": "python"
  }
}'
```

```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": "subreddit_posts",
        "params": {
            "subreddit": "python",
        },
    },
    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; the list keeps the first 2 of 10. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "reddit",
  "action": "subreddit_posts",
  "results": [
    {
      "id": "1wq79hw",
      "url": "https://www.reddit.com/r/Python/comments/1wq79hw/image_upload_file_type_verification_on_fastapi/",
      "title": "Image upload file type verification on FastAPI",
      "author_username": "•••",
      "community": "Python",
      "like_count": 17,
      "comment_count": 14,
      "posted_at": "2026-09-25T20:38:54.239000+00:00",
      "platform": "reddit"
    },
    {
      "id": "1wqbw40",
      "url": "https://www.reddit.com/r/Python/comments/1wqbw40/saturday_daily_thread_resource_request_and/",
      "title": "Saturday Daily Thread: Resource Request and Sharing! Daily Thread",
      "author_username": "•••",
      "community": "Python",
      "like_count": 5,
      "comment_count": 0,
      "posted_at": "2026-09-26T00:00:08.837000+00:00",
      "platform": "reddit"
    }
  ],
  "count": 10,
  "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
