Appearance
Search
GET /v1/reddit/search
Searches across all of Reddit for posts matching a query. Each post includes title, author, selftext, subreddit, score, ups, upvote_ratio, num_comments, created_utc, url, permalink, and is_video. Supports sort (relevance, new, top, comment_count), timeframe filtering, pagination via the after token, and a trim parameter for lighter responses.
Authentication
All requests require the x-api-key header. Get your key at scrapecreators.com.
Query Parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
query | string | yes | Search query | |
sort | enum(relevance, new, top, comment_count) | no | Sort by | relevance |
timeframe | enum(all, day, week, month, year) | no | Timeframe | all |
after | string | no | Used to paginate to next page | t3_1i8z28z |
trim | boolean | no | Set to true for a trimmed down version of the response | false |
Example Request
curl
bash
curl 'https://api.scrapecreators.com/v1/reddit/search?query=<query>' \
-H 'x-api-key: $SCRAPECREATORS_API_KEY'Node / TypeScript
js
const params = new URLSearchParams({ query: '...' });
const res = await fetch(`https://api.scrapecreators.com/v1/reddit/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/search',
headers={'x-api-key': os.environ['SCRAPECREATORS_API_KEY']},
params={'query': '...'},
)
r.raise_for_status()
print(r.json())CLI
bash
scrapecreators reddit search --helpExample Response
json
{
"success": true,
"posts": [
{
"id": "w63dgy",
"author": "Morgentau7",
"author_fullname": "t2_2hy2xjit",
"subreddit": "MadeMeSmile",
"title": "Player realizes that he nearly stole the dogs job",
"downs": 0,
"name": "t3_w63dgy",
"upvote_ratio": 0.97,
"ups": 220403,
"total_awards_received": 0,
"score": 220403,
"created": 1658580900,
"num_comments": 1246,
"url": "https://www.reddit.com/r/MadeMeSmile/comments/w63dgy/player_realizes_that_he_nearly_stole_the_dogs_job/",
"subreddit_subscribers": 11605207,
"is_video": true,
"created_utc": 1658580900
}
],
"after": "t3_1izmcgx"
}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. |