Appearance
Subreddit Search
GET /v1/reddit/subreddit/search
Searches within a specific subreddit for posts, comments, and media matching a query. Returns posts with title, votes, num_comments, url, and created_at; comments with author, body, votes, and parent post info; and media with title, media_type, image dimensions, and gallery_count. Supports sort, timeframe filtering, and cursor-based pagination.
Authentication
All requests require the x-api-key header. Get your key at scrapecreators.com.
Query Parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
subreddit | string | yes | Subreddit name (e.g. 'Fitness', not 'r/Fitness' or a full URL) | |
query | string | no | Search query to find matching content | push ups |
sort | enum(relevance, hot, top, new, comments) | no | Sort order. For posts/media: relevance, hot, top, new, comments. For comments: relevance, top, new | |
timeframe | enum(all, year, month, week, day, hour) | no | Timeframe to filter results | |
cursor | string | no | Cursor to get more results. Get 'cursor' from previous response. | eyJjYW5kaWRhdGVzX3JldHVybmVkIjoi... |
Example Request
curl
bash
curl 'https://api.scrapecreators.com/v1/reddit/subreddit/search?subreddit=<subreddit>' \
-H 'x-api-key: $SCRAPECREATORS_API_KEY'Node / TypeScript
js
const params = new URLSearchParams({ subreddit: '...' });
const res = await fetch(`https://api.scrapecreators.com/v1/reddit/subreddit/search?${params}`, {
headers: { 'x-api-key': process.env.SCRAPECREATORS_API_KEY }
});
const data = await res.json();
console.log(data);Python
python
import os, requests
r = requests.get(
'https://api.scrapecreators.com/v1/reddit/subreddit/search',
headers={'x-api-key': os.environ['SCRAPECREATORS_API_KEY']},
params={'subreddit': '...'},
)
r.raise_for_status()
print(r.json())CLI
bash
scrapecreators reddit subreddit-search --helpExample Response
json
{
"posts": [
{
"id": "t3_8gmjrb",
"post_id": "t3_8gmjrb",
"title": "Is doing 50-100 pushups a day doing anything?",
"url": "https://www.reddit.com/r/Fitness/comments/8gmjrb/is_doing_50100_pushups_a_day_doing_anything/",
"permalink": "/r/Fitness/comments/8gmjrb/is_doing_50100_pushups_a_day_doing_anything/",
"nsfw": false,
"spoiler": false,
"is_crosspost": false,
"subreddit": {
"id": "t5_2qhx4",
"name": "Fitness",
"nsfw": false,
"quarantined": false,
"icon": "https://b.thumbs.redditmedia.com/Ted4KOMuRbaCYlDS55cTqjpVVZ2ENHKtYFbBFjI1i2o.png",
"banner": null,
"description": "A place for the pursuit of physical fitness goals.\n\nPlease see the r/Fitness Wiki and FAQ at https://thefitness.wiki for help with common questions.",
"weekly_visitors": 898726,
"weekly_contributions": 1827
},
"votes": 1414,
"num_comments": 582,
"created_at": "2018-05-03T01:09:17.620000+0000",
"created_at_iso": "2018-05-03T01:09:17.620Z",
"thumbnail": null,
"thumbnail_blurred": false,
"position": 0,
"relative_position": 0
}
],
"comments": [
{
"id": "t1_nxf7p27",
"post_id": "t3_1q2p898",
"parent_comment_id": null,
"is_reply_to_comment": false,
"author": "Philser23",
"author_avatar": null,
"author_nsfw": false,
"body": "On the 30th my girlfriend out of the blue decided her new year's resolution would be to start going to the gym. I was so excited since none of my partners ever shared the fitness hobby with me.",
"body_html": "<p>On the 30th my girlfriend out of the blue decided her new year's resolution would be to start going to the gym...</p>",
"images": [],
"votes": 123,
"url": "https://www.reddit.com/r/Fitness/comments/1q2p898/gym_story_saturday/nxf7p27/",
"permalink": "/r/Fitness/comments/1q2p898/gym_story_saturday/nxf7p27/",
"created_at": "2026-01-03T11:26:02.434000+0000",
"created_at_iso": "2026-01-03T11:26:02.434Z",
"post": {
"id": "t3_1q2p898",
"title": "Gym Story Saturday",
"url": "https://www.reddit.com/r/Fitness/comments/1q2p898/gym_story_saturday/",
"permalink": "/r/Fitness/comments/1q2p898/gym_story_saturday/",
"nsfw": false,
"spoiler": false,
"votes": 67,
"num_comments": 80,
"created_at": "2026-01-03T08:15:49.709000+0000",
"created_at_iso": "2026-01-03T08:15:49.709Z"
},
"subreddit": {
"id": "t5_2qhx4",
"name": "Fitness",
"nsfw": false,
"quarantined": false,
"icon": "https://b.thumbs.redditmedia.com/Ted4KOMuRbaCYlDS55cTqjpVVZ2ENHKtYFbBFjI1i2o.png"
},
"position": 0
}
],
"media": [
{
"id": "t3_geo4x",
"title": "Bodyweight training for really strong people. See on you're own what I mean with strong. (Not me)",
... (truncated)Credits
Most ScrapeCreators endpoints consume 1 credit per successful response. Some heavier endpoints (transcripts, AI-driven enrichment, ad detail lookups) may cost more. Check GET /v1/credit-balance for your remaining balance.
Errors
| Status | Meaning | Action |
|---|---|---|
| 200 | Success. | Use the JSON payload. |
| 400 | Invalid or missing parameter. | Verify required parameters and value format. |
| 401 | Missing or invalid x-api-key. | Pass a valid API key in the header. |
| 402 | Out of credits. | Top up at scrapecreators.com or wait for plan reset. |
| 404 | Resource not found or private. | Confirm the handle, URL, or id and that the resource is public. |
| 429 | Rate limited. | Backoff and retry with exponential delay. |
| 500 | Server error or upstream platform failure. | Retry with backoff; report persistent errors to support. |