> Documentation index: https://docs.scrapier.io/llms.txt
> Auth: header `X-API-Key: <key>` · Base: https://api.scrapier.io/api/v2 · Synchronous; paginate with `cursor` ← `data.next_cursor`.

# Reddit Subreddit Search

Structured Reddit data: every input is optional. Cursor-paginated, 1 credit per successful call.

`GET|POST https://api.scrapier.io/api/v2/reddit-subreddit-search/` · 1 credit per successful call · Cursor-paginated

## Overview

Call `GET /api/v2/reddit-subreddit-search/`. The results are in `data.items`; send `data.next_cursor` back as `cursor` to get the next page. 9 optional parameters refine the call (see Parameters).

## Request

```bash
curl -G "https://api.scrapier.io/api/v2/reddit-subreddit-search/" \
  -H "X-API-Key: YOUR_API_KEY" \
  --max-time 210
```

```python
import requests

resp = requests.get(
    "https://api.scrapier.io/api/v2/reddit-subreddit-search/",
    headers={"X-API-Key": "YOUR_API_KEY"},
    params={},
    timeout=210,
)
body = resp.json()
if not resp.ok:
    raise RuntimeError(body.get("error") or body.get("detail"))

print(body["data"]["items"])
```

POST with a JSON body works too (same parameters; the body is merged over the query string).

## Parameters

> **Note:** No parameter is strictly required, but send at least the inputs shown in the example.

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `X-API-Key` (header) | string | yes | — | Your API key. |
| `subreddits` | string | no | `SelfDrivingCars` | Subreddit to search inside ("SelfDrivingCars", "r/SelfDrivingCars" or a reddit.com/r/<name> URL; a full /r/<name>/search/?q=..&sort=..&t=..&type=.. URL fills the empty options). EMPTY = all of Reddit. At least one of subreddits / queries on the first call; ignored when `cursor` is supplied. |
| `queries` | string | no | `waymo` | Search terms (Reddit syntax works). EMPTY = the subreddit's unfiltered list. ONE native Reddit search page per call (7 posts / ~9-10 comments / 7 media - Reddit ignores page-size params; source=api = 100-row Listing pages), rows in Reddit's order with flat id / title / score / num_comments / author / permalink / url (+ body for comments, media_urls for media) plus the full post (or comment) + computed blocks. Required on the first call (unless subreddits is given); ignored when `cursor` is supplied. |
| `cursor` | string | no | — | Pagination cursor returned in the previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When `next_cursor` is null, you have reached the last page. |
| `type` | string | no | `posts` | posts (default) \| comments \| media - Reddit's search tabs. One of: `posts`, `comments`, `media`. Locked in cursor. |
| `sort` | string | no | `relevance` | relevance (default) \| hot \| top \| new \| comments (comments type: relevance \| top \| new). One of: `relevance`, `hot`, `top`, `new`, `comments`. Locked in cursor. |
| `timeframe` | string | no | — | hour \| day \| week \| month \| year \| all (relevance / top / comments only). One of: `hour`, `day`, `week`, `month`, `year`, `all`. Locked in cursor. |
| `include_body` | boolean | no | `false` | true = hydrate every hit via oauth.reddit.com/api/info (selftext, upvote_ratio, flair, media, awards ...). Locked in cursor. |
| `source` | string | no | `auto` | auto (default) = the site's index (fresh guest sessions raced on a wall); when it stays walled the first page falls back and the walk continues on that index: posts+query -> api search, subreddit without query -> api listing, media -> api filtered to image/video/gallery, comments in a subreddit -> Arctic Shift archive (rows carry `source`, response `warning`). web = site index only; api = oauth.reddit.com Listing search (100 a page, `after` cursor, bodies included, posts only). Nothing able to serve the page -> HTTP 502 naming the cursor to retry. One of: `auto`, `web`, `api`. Locked in cursor. |
| `trim` | boolean | no | `true` | false = + every raw Reddit field of hydrated hits in the post / comment block. Locked in cursor. |
| `use_proxy` | boolean | no | `true` | Route the request through Scrapier's residential proxy pool. Default: `true`. Leave as is unless support tells you otherwise. |
| `raw_data` | boolean | no | `false` | When true, the response carries the full raw upstream payload(s) the scraper received (GraphQL / JSON API bodies, HTML, embedded JSON-LD -- exactly as the platform returned them) under `raw_responses`, in place of the formatted items. When false (default) you get the formatted output. Pagination (`cursor` / `next_cursor`) works the same in both modes. |

## Response

HTTP 200. Results are in `data.items`. Sample from the live catalog, arrays trimmed to 3 items.

```json
{
  "success": true,
  "data": {
    "subreddit": "SelfDrivingCars",
    "subreddit_scope": "SelfDrivingCars",
    "query": "waymo",
    "type": "posts",
    "source": "web",
    "sort": "top",
    "timeframe": "year",
    "page": 1,
    "page_size": 7,
    "items": [
      {
        "input_subreddit": "SelfDrivingCars",
        "keyword": "waymo",
        "subreddit_scope": "SelfDrivingCars",
        "type": "posts",
        "status": "ok",
        "position": 1,
        "id": "1rfu3mo",
        "name": "t3_1rfu3mo",
        "url": "https://www.reddit.com/r/SelfDrivingCars/comments/1rfu3mo/comical_multiwaymo_interaction_at_an_intersection/",
        "title": "Comical multi-Waymo interaction at an intersection",
        "score": 1708,
        "num_comments": 176,
        "author": "danlev",
        "subreddit": "SelfDrivingCars",
        "permalink": "/r/SelfDrivingCars/comments/1rfu3mo/comical_multiwaymo_interaction_at_an_intersection/",
        "published_at": "2026-02-27T02:18:35.407Z",
        "created_utc": 1772158715,
        "nsfw": false,
        "thumbnail_url": "https://external-preview.redd.it/...",
        "media_urls": null,
        "selftext": null,
        "hydrated": false,
        "sort": "top",
        "timeframe": "year",
        "source": "web",
        "post": {
          "id": "1rfu3mo",
          "name": "t3_1rfu3mo",
          "content": {
            "text": "Comical multi-Waymo interaction at an intersection",
            "...": "..."
          },
          "author": {
            "username": "danlev",
            "display_name": "t2_3z9p1",
            "...": "..."
          },
          "engagement": {
            "likes": 1708,
            "comments": 176,
            "...": "..."
          },
          "flags": {
            "nsfw": false,
            "spoiler": false,
            "deleted": false,
            "...": "..."
          },
          "published_at": "2026-02-27T02:18:35.407Z",
          "ext": {
            "subreddit": "SelfDrivingCars",
            "title": "...",
            "selftext": null,
            "...": "..."
          },
          "...": "(same shape as the v1 row)"
        },
        "computed": {
          "engagement_rate": null,
          "language": "en",
          "content_category": "other",
          "estimated_reach": null
        },
        "scraped_at": "2026-09-21T11:28:04.512Z"
      },
      {
        "position": 2,
        "id": "1tbaptd",
        "title": "Dolgov posts video of Waymo freeway crash detection",
        "score": 843,
        "num_comments": 96,
        "author": "versedaworst",
        "...": "(same shape as row 1)"
      },
      "... 5 more rows (positions 3-7: 1pmvror, 1vffpzj, 1q6vxwr, 1pem9ep, 1ohtvrt) ..."
    ],
    "note": null,
    "next_cursor": "eyJjIjoiZXlKallXNWthV1JoZEdWelgzSmxkSFZ5Ym1Wa0lqb2llMXdpYzJWamRHbHZibDh4WDNCcGNHVnNhVzVsWHpCZloyeHZZbUZzWDIxdlpHbG1hV1Z5YzF3aU9sd2lNVndpTEZ3aWMyVmpkR2x2Ymw4eFgzQnBjR1ZzYVc1bFh6RmZiRzlqWVd4ZmJXOWthV1pwWlhKelhDSTZYQ0l5WENJc1hDSnpaV04wYVc5dVh6SmZjR2x3Wld4cGJtVmZOMTl6WTI5d1pWOXpkMmwwWTJobGNsd2lPbHdpTUZ3aUxGd2ljMlZqZEdsdmJsOHlYM0JwY0dWc2FXNWxYemhmY0c5emRGOXpaV0Z5WTJoY0lqcGNJamRjSWl4Y0luTmxZM1JwYjI1Zk0xOXdhWEJsYkdsdVpWOHdYM05wWkdWaVlYSmZZMjl0YlhWdWFYUjVYMmx1Wm05Y0lqcGNJakJjSW4waUxDSmxlSEJsY21sbGJtTmxYM05sYkdWamRHbHZiaUk2SW5CdmMzUmZkMmwwYUY5amIyMXRkVzVwZEhsZmMybGtaV0poY2lJc0ltVjRjR1Z5YVdWdVkyVmZkbVZ5YzJsdmJpSTZJbVJsWm1GMWJIUWlMQ0p6WldOMGFXOXVYekpmY0dsd1pXeHBibVZmT0Y5d2IzTjBYM05sWVhKamFDSTZJamNpZlE9PSIsImxrIjp7InNvcnQiOiJ0b3AiLCJ0aW1lZnJhbWUiOiJ5ZWFyIn0sInAiOjEsInBvcyI6NywicSI6IndheW1vIiwicyI6WyJ0M18xcmZ1M21vIiwidDNfMXRiYXB0ZCIsInQzXzFwbXZyb3IiLCJ0M18xdmZmcHpqIiwidDNfMXE2dnh3ciIsInQzXzFwZW05ZXAiLCJ0M18xb2h0dnJ0Il0sInN1YiI6IlNlbGZEcml2aW5nQ2FycyJ9"
  }
}
```

## Response fields

| Field | Type | Example | Description |
|---|---|---|---|
| `subreddit` | string | `SelfDrivingCars` |  |
| `subreddit_scope` | string | `SelfDrivingCars` |  |
| `query` | string | `waymo` |  |
| `type` | string | `posts` |  |
| `source` | string | `web` |  |
| `sort` | string | `top` |  |
| `timeframe` | string | `year` |  |
| `page` | integer | `1` |  |
| `page_size` | integer | `7` |  |
| `items` | array | `[3 items]` | The results. |
| `note` | null | `null` |  |
| `next_cursor` | string | `eyJjIjoiZXlKallXNWthV1JoZEdWelgzSmxkSFZ5Ym1Wa…` | Pass back as `cursor` for the next page. `null` on the last page. |
| `items[].input_subreddit` | string | `SelfDrivingCars` |  |
| `items[].keyword` | string | `waymo` |  |
| `items[].subreddit_scope` | string | `SelfDrivingCars` |  |
| `items[].type` | string | `posts` |  |
| `items[].status` | string | `ok` |  |
| `items[].position` | integer | `1` |  |
| `items[].id` | string | `1rfu3mo` |  |
| `items[].name` | string | `t3_1rfu3mo` |  |
| `items[].url` | string | `https://www.reddit.com/r/SelfDrivingCars/comm…` |  |
| `items[].title` | string | `Comical multi-Waymo interaction at an interse…` |  |
| `items[].score` | integer | `1708` |  |
| `items[].num_comments` | integer | `176` |  |
| `items[].author` | string | `danlev` |  |
| `items[].subreddit` | string | `SelfDrivingCars` |  |
| `items[].permalink` | string | `/r/SelfDrivingCars/comments/1rfu3mo/comical_m…` |  |
| `items[].published_at` | string | `2026-02-27T02:18:35.407Z` |  |
| `items[].created_utc` | integer | `1772158715` |  |
| `items[].nsfw` | boolean | `false` |  |
| `items[].thumbnail_url` | string | `https://external-preview.redd.it/...` |  |
| `items[].media_urls` | null | `null` |  |
| `items[].selftext` | null | `null` |  |
| `items[].hydrated` | boolean | `false` |  |
| `items[].sort` | string | `top` |  |
| `items[].timeframe` | string | `year` |  |
| `items[].source` | string | `web` |  |
| `items[].post` | object | `{…}` |  |
| `items[].computed` | object | `{…}` |  |
| `items[].scraped_at` | string | `2026-09-21T11:28:04.512Z` |  |

## Pagination

Pass `data.next_cursor` back as `cursor` until it is `null`. Required inputs are ignored once a cursor is sent. Each page is one billed call.

```python
import requests

URL = "https://api.scrapier.io/api/v2/reddit-subreddit-search/"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}
params = {}
items = []

for _ in range(10):  # each page is one billed call
    resp = requests.get(URL, headers=HEADERS, params=params, timeout=210)
    resp.raise_for_status()
    data = resp.json()["data"]
    items.extend(data.get("items") or [])
    if not data.get("next_cursor"):  # None = last page
        break
    params = {"cursor": data["next_cursor"]}
```

## Errors

Failed calls are free. Branch on HTTP status; the message is in `error` (or `detail`). See https://docs.scrapier.io/errors.md

- **400** Bad input. The exact message varies by endpoint. `{"success":false,"error":"…"}`
- **402** Balance below the endpoint's price. `{"error":"Insufficient credits. Buy more to scrape more.","balance":1,"required":2}`
- **403** Invalid or unknown API key. `{"detail":"Authentication service unavailable or invalid API key."}`
- **429** Throttled — wait for Retry-After. `{"detail":"Request was throttled. Expected available in N seconds."}`
- **404** unknown slug · **503** busy (retry after `Retry-After`) · **5xx** upstream failure or timeout (retry with backoff).

## Notes

- Locked into the cursor: `type`, `sort`, `timeframe`, `include_body`, `source`, `trim`. Set them on the first call; later pages reuse them.

## Related

- [Reddit Comment Replies](https://docs.scrapier.io/api-reference/reddit/reddit-comment-replies.md): Structured Reddit data: send `urls`. Cursor-paginated, 1 credit per successful call.
- [Reddit Post Comments](https://docs.scrapier.io/api-reference/reddit/reddit-comments.md): Structured Reddit data: send `urls`. Cursor-paginated, 1 credit per successful call.
- [Reddit Post Search](https://docs.scrapier.io/api-reference/reddit/reddit-post-search.md): Structured Reddit data: send `queries`. Cursor-paginated, 1 credit per successful call.
- [Reddit Post Transcript](https://docs.scrapier.io/api-reference/reddit/reddit-post-transcript.md): Structured Reddit data: send `urls`. Single lookup, 1 credit per successful call.
