Search Reddit Posts Globally or by Subreddit
Search Reddit posts globally or restrict to a subreddit, mirrors the Posts tab on reddit.com search. Supports sort, timeframe, NSFW filter, and pagination.
/api/reddit/search$0.002 / callSearch posts globally or restrict to a subreddit. Mirrors the "Posts" tab on reddit.com search.
Choosing a search endpoint
Reddit splits search across tabs, and so do we. Each endpoint returns a different object, so pick by what you want back rather than by what you are searching for.
| Endpoint | Returns | Use it when |
|---|---|---|
/api/reddit/search (this page) | Posts | You want posts, optionally restricted to one subreddit with subreddit= |
/api/reddit/search/media | Posts with media | You only want image, video, or gallery posts and you want the media_url |
/api/reddit/search/communities | Subreddits | You are looking for a place, not a post |
/api/reddit/search/users | Accounts | You have a name and need the account behind it |
Only this endpoint takes a subreddit parameter. The others search site-wide.
To confine a media search to one subreddit, put Reddit's subreddit: operator in
the query instead, as shown on the
Search Media page.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Search query |
subreddit | string | No | Restrict to a subreddit |
sort | string | No | relevance | new | hot | top | comments. Defaults to relevance when omitted, matching Reddit's own default. Pass sort=new explicitly for a reverse-chronological feed. An unrecognised value returns 400. |
t | string | No | hour | day | week | month | year | all. An unrecognised value returns 400. |
nsfw | boolean | No | true to include NSFW (Safe Search off) |
limit | number | No | Number of posts to return, 1-100 (default 25) |
after | string | No | Pagination cursor. Pass back the after value from the previous response exactly as issued; it is opaque and carries your paging depth. See Pagination depth. |
min_score | number | No | Keep only posts with score >= this. Applied to the returned page (see Advanced filters). |
max_score | number | No | Keep only posts with score <= this. |
min_comments | number | No | Keep only posts with comment count >= this. |
max_comments | number | No | Keep only posts with comment count <= this. |
is_video | boolean | No | true = only video posts, false = only non-video. |
is_self | boolean | No | true = only self/text posts, false = only link posts. |
over_18 | boolean | No | Filter the page by the NSFW flag. Distinct from nsfw, which controls whether NSFW posts are included in the search at all. |
locked | boolean | No | Filter by the locked flag. |
stickied | boolean | No | Filter by the stickied flag. |
spoiler | boolean | No | Filter by the spoiler flag. |
contest_mode | boolean | No | Filter by the contest_mode flag. |
sort_type | string | No | Re-sort the filtered page (descending): score | num_comments | created. |
Advanced filters
Reddit's search cannot filter on score, comment count, media type, or post flags server-side, so those filters are applied to the page the search returns (the same model as pullpush). A filter can therefore return far fewer than limit results per page, so when any filter is passed the response adds a meta object with completeness counts and you paginate with after for more:
"meta": { "fetched": 25, "returned": 3, "filtered_out": 22, "filters": { "min_score": 500 } }fetched is how many the page held, returned how many passed your filters, filtered_out the difference. When no filter is passed the response keeps the plain { posts, after } shape.
Sort and freshness
sort=relevance (and sort=top) blend text match with a post's score, so on a broad or long-lived query the highest-upvoted posts can outrank the closest matches. The t time window bounds which posts are eligible and it does apply to relevance on search. When you omit t, Reddit defaults to all, which lets old viral posts surface. Pass a bounded window such as t=week or t=month to keep a relevance search recent and on-topic, or use sort=new for a strict reverse-chronological feed.
Example
curl -H "Authorization: Bearer $TOKEN" \
"https://api.redditapis.com/api/reddit/search?q=twitter+api+alternative&sort=relevance&t=all"const response = await fetch(
"https://api.redditapis.com/api/reddit/search?q=twitter+api+alternative&sort=relevance&t=all",
{ headers: { Authorization: "Bearer TOKEN" } }
);import requests
response = requests.get(
"https://api.redditapis.com/api/reddit/search",
params={"q": "twitter api alternative", "sort": "relevance", "t": "all"},
headers={"Authorization": "Bearer TOKEN"},
)Response Shape
Same shape as /api/reddit/posts, posts: [...] + after cursor. See that page for the per-post field reference (upvotes, comments, link_url, is_crosspost, crosspost_origin, etc.).
When after comes back empty
An empty cursor means there is no next page to ask for. It does not always mean
you have every post: Reddit often stops serving a busy listing long before it
runs out. Paging r/all on 2026-08-14 stopped after 400 posts covering about a
minute of a feed that plainly holds more.
The response tells you which happened. When after is null it also carries
listing_status, which reads complete, truncated or unknown. Only
complete means you have everything; treat the other two as a partial answer
and widen your search rather than stopping. The full field list and what to do
about each answer is in Pagination depth.
Independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by Reddit, Inc.
Home Feed
Fetch your own Reddit front page over HTTP with your session cookies. Six sorts, cursor pagination, and the same post shape as every other listing.
Top Posts
Get the top posts in any subreddit for a timeframe, day, week, month, year, or all-time. Alias for /api/reddit/posts with sort=top, with cursor pagination.
