Reddit Subreddit Search
Structured Reddit data: every input is optional. Cursor-paginated, 1 credit per successful call.
Overview
Section titled “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
Section titled “Request”curl -G "https://api.scrapier.io/api/v2/reddit-subreddit-search/" \ -H "X-API-Key: YOUR_API_KEY" \ --max-time 210const params = new URLSearchParams({});
const res = await fetch(`https://api.scrapier.io/api/v2/reddit-subreddit-search/?${params}`, { headers: { "X-API-Key": "YOUR_API_KEY" }, signal: AbortSignal.timeout(210_000),});const body = await res.json();if (!res.ok) throw new Error(body.error ?? body.detail ?? `HTTP ${res.status}`);
console.log(body.data.items);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"])curl -X POST "https://api.scrapier.io/api/v2/reddit-subreddit-search/" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{}' \ --max-time 210Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
X-API-Key header | string | yes | — | Your API key from the dashboard. |
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. postscommentsmedia locked in cursor |
sort | string | no | relevance | relevance (default) | hot | top | new | comments (comments type: relevance | top | new). relevancehottopnewcomments locked in cursor |
timeframe | string | no | — | hour | day | week | month | year | all (relevance / top / comments only). hourdayweekmonthyearall 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.autowebapi locked in cursor |
trim | boolean | no | true | false = + every raw Reddit field of hydrated hits in the post / comment block. locked in cursor |
Advanced
| Name | Type | Default | Description |
|---|---|---|---|
use_proxy | boolean | true | Route the request through Scrapier's residential proxy pool. Default: true. Leave as is unless support tells you otherwise. |
raw_data | boolean | 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
Section titled “Response”{ "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" }}Bad input. The exact message varies by endpoint.
{ "success": false, "error": "…"}Balance below the endpoint’s price.
{ "error": "Insufficient credits. Buy more to scrape more.", "balance": 1, "required": 2}Invalid or unknown API key.
{ "detail": "Authentication service unavailable or invalid API key."}Throttled — wait for Retry-After.
{ "detail": "Request was throttled. Expected available in N seconds."}Sample from the live catalog; arrays trimmed to 3 items. Results are in data.items.
Response fields
Section titled “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
Section titled “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. More in Pagination.
const url = "https://api.scrapier.io/api/v2/reddit-subreddit-search/";let params = {};const items = [];
for (let page = 0; page < 10; page++) { // each page is one billed call const res = await fetch(`${url}?${new URLSearchParams(params)}`, { headers: { "X-API-Key": "YOUR_API_KEY" }, signal: AbortSignal.timeout(210_000), }); const body = await res.json(); if (!res.ok) throw new Error(body.error ?? body.detail ?? `HTTP ${res.status}`); const data = body.data; items.push(...(data.items ?? [])); if (!data.next_cursor) break; // null = last page params = { cursor: data.next_cursor };}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
Section titled “Errors”Failed calls are free. Branch on the HTTP status and read the message from error (or detail). Full details in Errors.
| Status | Meaning | Retry? | Charged? |
|---|---|---|---|
400 | Bad or missing input. | No — fix the params | No |
401 / 403 | Missing, invalid or revoked API key. | No — fix the key | No |
402 | Out of credits (body has balance). | No — top up | No |
404 | Unknown endpoint slug. | No — check the slug | No |
429 / 503 | Busy or throttled. | Yes — after Retry-After | No |
5xx | Target site or upstream failure, or timeout. | Yes — with backoff | No |
- Locked into the cursor:
type,sort,timeframe,include_body,source,trim. Set them on the first call; later pages reuse them.
Related
Section titled “Related”- Reddit Comment Replies — Structured Reddit data: send
urls. Cursor-paginated, 1 credit per successful call. - Reddit Post Comments — Structured Reddit data: send
urls. Cursor-paginated, 1 credit per successful call. - Reddit Post Search — Structured Reddit data: send
queries. Cursor-paginated, 1 credit per successful call. - Reddit Post Transcript — Structured Reddit data: send
urls. Single lookup, 1 credit per successful call.