Reddit
Search Reddit posts
Searches public Reddit content and returns public post entries. A 503 with a Retry-After header means Reddit is temporarily throttling the request; wait that many seconds and retry. If source.type is redlib, public fields and credit weights are preserved.
get/reddit/search
Request
- Base URL: https://api.crawlora.net/api/v1
- URL: https://api.crawlora.net/api/v1/reddit/search
- Auth: API key in header x-api-key
Query parameters
qstring required
Search keywords
subredditstring
Restrict search to a subreddit name, without r/
sort'relevance' | 'hot' | 'new' | 'top' | 'comments'
Sort: relevance, hot, new, top, or comments
time'hour' | 'day' | 'week' | 'month' | 'year' | 'all'
Time window for top/comments sorts: hour, day, week, month, year, or all
limitinteger
Maximum posts, defaults to 25 and clamps to 100
afterstring
Reddit pagination token
Headers
x-api-keystring required
API key required
Response
OK
Example response
{
"code": 200,
"data": {
"pagination": {
"after": "t3_1abcxyz",
"limit": 25
},
"posts": [
{
"author": {
"name": "reddit_user",
"profile_url": "https://www.reddit.com/user/reddit_user/"
},
"created": "2024-04-19T00:00:00Z",
"created_utc": 1713484800,
"domain": "self.OpenAI",
"flair": "Discussion",
"id": "1abcxyz",
"name": "t3_1abcxyz",
"permalink": "https://www.reddit.com/r/OpenAI/comments/1abcxyz/openai_discussion_thread/",
"selftext": "Discussion body",
"source_feed_url": "https://www.reddit.com/r/OpenAI/.rss",
"subreddit": "OpenAI",
"thumbnail": "https://b.thumbs.redditmedia.com/example.jpg",
"title": "OpenAI discussion thread",
"url": "https://www.reddit.com/r/OpenAI/comments/1abcxyz/openai_discussion_thread/"
}
],
"query": "openai",
"sort": "relevance",
"source": {
"type": "rss",
"url": "https://www.reddit.com/r/OpenAI/.rss"
},
"subreddit": "OpenAI",
"time": "week"
},
"msg": "OK"
}Changes
No recorded changes to this operation across all 2 revisions of this API.