Posts matching q across Reddit or inside one subreddit: title, author, subreddit, score, comments, created time, link and a matched snippet when Reddit shows one. 25 posts per page, paged with next_page_token. Billed 1 request per page, plus 1 per post detailed with with_details=true (a post whose details fail is free). For image and video posts with their media use /media/search.
HTTP Request
GET /post/search
Cost (in requests): 1 per page; +1 per post with with_details. Every successful answer reports its cost in data.billed_requests.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
q | string | Yes | - | Search text. Reddit search operators are supported: author:spez, subreddit:python, title:beginner, site:github.com (link domain), url:https://example.com/page (posts linking to that URL), self:yes (text posts only) / self:no (link and media posts only), "exact phrase" (word forms are matched loosely, so "learning python" also matches “learn python”), and -word to exclude a word. Combine them freely, for example python site:github.com -django. Inside a subreddit search, flair:Showcase narrows the results to one flair. OR is not supported (all words are required), selftext: is not reliable, and nsfw: has no effect (results are always safe-for-work). |
subreddit | string | No | - | Restrict to one community (verified scope, echoed in resolved_filters). |
page_token | string | No | - | Opaque page token from a previous response’s next_page_token. Omit for the first page. |
per_page | integer | No | 25 | Results per page, 1–25 (default 25). One page is billed 1 request. |
sort | string | No | new | Default new (newest first, the same order on every call). Also relevance (not stable between calls), hot, top, comments. Allowed: relevance, hot, top, new, comments. |
time | string | No | default | Only with sort=top, relevance or comments: limits results to posts from the last hour / day / week / month / year (all = no limit). Ignored by new. default (the default) = no window chosen: Reddit applies its own; the only value accepted with sort=new. Allowed: default, hour, day, week, month, year, all. |
flair | string | No | - | Only posts with this flair (the tag a subreddit puts on posts, e.g. Discussion). Exact text as listed by /subreddit/flairs; needs subreddit. |
domain | string | No | - | Only link posts pointing to this website, e.g. github.com: just the site name, no https:// and no page. For one exact page use /post/by-url; for every post linking to a site use /domain/posts. |
min_score | integer | No | - | Only posts with at least this net score. Checked on the posts of this page only, so a page can hold fewer than per_page; scanned_count (present when a filter is used) says how many were checked. |
min_comments | integer | No | - | Only posts with at least this many comments. Checked on the posts of this page only, so a page can hold fewer than per_page; scanned_count (present when a filter is used) says how many were checked. |
posted_after | string | No | - | Only items created at or after this time: an ISO 8601 date (2026-01-01, the start of that day, UTC), a datetime (2026-01-01T18:00:00Z) or epoch seconds. Reddit has no date filter: the posts are read newest first and filtered here, so this reaches about the newest 1,000 posts of a listing; for older days of all of Reddit use /post/archive. With a date range the call reads up to max_pages search pages to find matching posts; each search page is billed 1 request; sort=new stops early once past posted_after. For relevant posts from the last week use sort=relevance with time=week, which costs nothing extra. |
posted_before | string | No | - | Only items created at or before this time, same formats as posted_after (a bare date includes that whole day). Must not be earlier than posted_after. With a date range the call reads up to max_pages search pages to find matching posts; each search page is billed 1 request; sort=new stops early once past posted_after. For relevant posts from the last week use sort=relevance with time=week, which costs nothing extra. |
max_pages | integer | No | - | Most search pages one call reads to find posts in the posted_after / posted_before range, 1–40 (default 8). With a date range the call reads up to max_pages search pages to find matching posts; each search page is billed 1 request; sort=new stops early once past posted_after. For relevant posts from the last week use sort=relevance with time=week, which costs nothing extra. |
include_nsfw | boolean | No | true | Default true: adult content included; pass false to exclude it (on searches the NSFW posts found are only those inside SFW communities: Reddit keeps its search SFW). |
with_details | boolean | No | false | Adds these fields per post (left out without it): upvote_ratio, flair, body_text, body_media, media, poll, subreddit_type, author_flair, author_type, author_avatar_url, is_author_nsfw, is_brand_affiliate, distinguished, is_locked, is_archived, is_stickied, crossposts_count, shares_count, removed_by, removal_category, thumbnail_width, thumbnail_height. Billed: +1 request per post detailed (a post whose details fail is free). |
include_html | boolean | No | false | Adds body_html (the rendered HTML body) to every post and comment. Default: left out; body_text carries the same text. |
translate_to | string | No | none | Reddit’s own machine translation of the returned titles, bodies and snippets into this language (default none: original language). Availability varies by post and page: check is_translated on each row. See the allowed values in the API overview
. |
Response
Real response to GET /post/search?q=fastapi&subreddit=python&per_page=5 (arrays trimmed to 2 items, long texts cut with …).
| |
Response Fields
| Field | Type | Description |
|---|---|---|
status | boolean | true when the request succeeded |
request_id | string | Unique request identifier |
data | object | Search page. |
data.results | array of objects | Matching posts, deduped by id. |
data.results[].post_id | string | Post fullname, e.g. t3_z1c9z. |
data.results[].title | string | Post title; null when Reddit shows only its removal placeholder ([ Removed by moderator ]…). |
data.results[].type | string | text, link, image, gif, gallery, video, poll, crosspost, embed, game. A text post with inline images is text (its images in body_media). Only with with_details=true on /post/batch and /answers. |
data.results[].permalink | string | Reddit path, e.g. /r/IAmA/comments/z1c9z/i_am_barack_obama/ (Reddit’s relative value; post_url is the same thread as a full link). Either form can be passed back as url. |
data.results[].post_url | string | Absolute link of the post’s Reddit thread (https://www.reddit.com + permalink), ready to open. |
data.results[].url | string | Where the post points (Reddit’s own url): the outside page for link posts, the image or video file for media posts (https://i.redd.it/…, https://v.redd.it/…), the original post for crossposts, the thread itself for text posts. The post’s own thread is post_url. |
data.results[].domain | string | Link domain (arstechnica.com). For a text post Reddit fills the placeholder self.{subreddit}, which is not a link domain: /domain/posts refuses it; list text posts with /subreddit/posts?post_type=text. |
data.results[].subreddit | string | Subreddit name without r/. |
data.results[].subreddit_id | string | Subreddit id (t5_…). |
data.results[].subreddit_type | string | Community type: public, restricted, private, user (a post on a profile)…; null when this endpoint does not carry it. Only with with_details=true on /post/batch and /answers (always on /post/search). Left out on /subreddit/posts, /feed/best, /feed/popular, /feed/games, /content/stories, /content/viral-media, /media/search, /user/activity and /user/insights. |
data.results[].subreddit_icon_url | string | Community icon URL; null when this endpoint does not carry it. Only with with_details=true on /post/batch, /domain/posts and /answers. Left out on /subreddit/posts, /feed/best, /feed/popular, /feed/games, /content/stories, /content/viral-media, /media/search, /user/activity, /user/insights and /subreddit/multi-posts. |
data.results[].is_subreddit_nsfw | boolean | The community is 18+ (a post can be safe for work in an 18+ community); null when this endpoint does not carry it. Only with with_details=true on /post/batch, /domain/posts and /answers. Left out on /subreddit/multi-posts. |
data.results[].is_subreddit_quarantined | boolean | The community is quarantined; null when this endpoint does not carry it. Only with with_details=true on /post/batch, /domain/posts and /answers. Left out on /subreddit/posts, /feed/best, /feed/popular, /feed/games, /content/stories, /content/viral-media, /media/search, /user/activity, /user/insights and /subreddit/multi-posts. |
data.results[].author | string | Author username; [deleted] is reported as null with is_author_deleted true. Only with with_details=true on /post/batch and /answers. |
data.results[].is_author_deleted | boolean | The author’s account is deleted (the post may remain). |
data.results[].author_id | string | Author account id (t2_…). Only with with_details=true on /post/batch and /answers. |
data.results[].flair | object | Post flair. Only with with_details=true on /post/batch and /answers (always on /post/search). On the listing-card routes (/subreddit/posts, the feeds, /content/*, /user/activity and /user/insights posts) it holds text and background_color only. |
data.results[].flair.text | string | Flair text (emoji shortcodes kept, e.g. :phx-2: Suns). |
data.results[].flair.rich_text | array of objects | Rich-text flair as parts in display order (text, and emoji with their image URL); null for a plain-text flair or when this endpoint does not carry it. |
data.results[].flair.rich_text[].type | string | text or emoji. |
data.results[].flair.rich_text[].text | string | The text, or the emoji’s short code (e.g. :nba-1:). |
data.results[].flair.rich_text[].url | string / null | Emoji image URL (emoji parts only). |
data.results[].flair.background_color | string | Hex background colour (#0079D3) or null when the flair has no colour. |
data.results[].flair.text_color | string | light or dark text on the flair pill. |
data.results[].flair.flair_id | string | Flair template id, the same as flair_id on /subreddit/flairs. A reference id, not an input of this API; null when this endpoint does not carry it. |
data.results[].score | integer | Net upvotes at fetch time. |
data.results[].comments_count | integer | Comment count reported by Reddit. |
data.results[].crossposts_count | integer / null | Number of crossposts; null when Reddit sends no count (it sends none, not 0, for most posts never crossposted) or this endpoint does not carry it. Only with with_details=true on /post/batch and /answers (always on /post/search). Left out on /subreddit/posts, /feed/best, /feed/popular, /feed/games, /content/stories, /content/viral-media, /media/search, /user/activity and /user/insights. On the /post/crossposts source_post: Reddit’s total of crossposts of the post. |
data.results[].created_at | string | ISO-8601 UTC creation time, microsecond precision. Left out on /media/search and on /answers without with_details. |
data.results[].is_nsfw | boolean | Marked NSFW. |
data.results[].is_spoiler | boolean | Marked spoiler. Only with with_details=true on /post/batch and /answers. |
data.results[].is_stickied | boolean | Pinned in the feed (feeds and listings only). Only with with_details=true on /post/batch and /answers (always on /post/search). Left out on /media/search. |
data.results[].is_locked | boolean | Comments locked. Only with with_details=true on /post/batch and /answers (always on /post/search). Left out on /media/search. |
data.results[].is_archived | boolean | Archived (no new votes or comments). Only with with_details=true on the routes that have it (always on /post/search). Left out on /media/search. |
data.results[].is_crosspost | boolean | The post is a crosspost. Only with with_details=true on the routes that have it. Left out on /media/search. |
data.results[].crosspost_parent_id | string / null | Id of the original post (t3_…) this crosspost shares; null unless is_crosspost and the endpoint carries it. Pass it to /post/details. Only with with_details=true on /post/batch and /answers (always on /post/search). |
data.results[].crosspost_parent_subreddit | string / null | Subreddit of the original post, without r/; null unless is_crosspost. Only with with_details=true on /post/batch and /answers (always on /post/search). |
data.results[].position | integer | Rank in the feed or the search results, 1-based and counted across pages (feeds keep Reddit’s gaps where ads were). |
data.results[].thumbnail_url | string | Thumbnail URL. |
data.results[].media | object | Images, video renditions, gallery, embed. Only with with_details=true on the routes that have it (always on /post/search). |
data.results[].media.type | string / null | Media kind: image, video, gif, gallery, embed or null. |
data.results[].media.preview_url | string | Largest still preview URL. |
data.results[].media.preview_width | integer | Preview pixel width. |
data.results[].media.preview_height | integer | Preview pixel height. |
data.results[].media.preview_variants | array of objects | Every size Reddit renders of the preview image, smallest first; empty when this endpoint does not carry them. |
data.results[].media.preview_variants[].size | string | thumbnail (108 px wide), compact, medium (320), large (640), extra_large (1080) or full (the original size). |
data.results[].media.preview_variants[].url | string | Image URL at that size. |
data.results[].media.preview_variants[].width | integer | Pixel width. |
data.results[].media.preview_variants[].height | integer | Pixel height. |
data.results[].media.alt_text | string / null | Image description the author set for screen readers; null when none. |
data.results[].media.hls_url | string / null | HLS playlist (.m3u8) for hosted video. |
data.results[].media.video_url | string / null | Player URL of a third-party embed (YouTube, Streamable…), or the downloadable MP4 of a Reddit-hosted video (signed, expires within about a day). Null when the source of the route does not carry it (a hosted video on a listing card: use renditions). |
data.results[].media.poster_url | string / null | Video poster image. |
data.results[].media.captions_url | string / null | WebVTT captions URL when available. |
data.results[].media.duration_seconds | integer / null | Video duration in seconds. |
data.results[].media.width | integer / null | Video pixel width (a hosted video’s full size, or the embed player’s size). |
data.results[].media.height | integer / null | Video pixel height (a hosted video’s full size, or the embed player’s size). |
data.results[].media.renditions | array | MP4 renditions with bitrate and size (hosted video only). |
data.results[].media.embed_html | string / null | oEmbed iframe HTML for third-party embeds (YouTube, Streamable…). |
data.results[].media.embed_provider | string / null | Embed provider name, e.g. YouTube or Streamable; null on Reddit-hosted media. |
data.results[].media.gallery | array | Gallery images in page order. |
data.has_next_page | boolean | More results available. |
data.next_page_token | string | Token for the next page; null at the end. |
data.resolved_filters | object | Scope and sort as applied. |
data.resolved_filters.subreddit | object | Subreddit scope as applied; source: not_found when the community does not exist. |
data.resolved_filters.subreddit.input | string | What the caller sent. |
data.resolved_filters.subreddit.resolved | string | What was applied on Reddit (null when not applied). |
data.resolved_filters.subreddit.source | string | param (applied as given), default, not_found (the value does not exist on Reddit), private / banned / quarantined (a community in the scope that cannot be read: skipped), or not_available (translate_to only: Reddit had no translated listing, the rows are served in their original language). |
data.resolved_filters.sort | object | Sort as applied. |
data.resolved_filters.sort.input | string / null | What the caller sent. |
data.resolved_filters.sort.resolved | string | What was applied on Reddit (null when not applied). |
data.resolved_filters.sort.source | string | param (applied as given), default, not_found (the value does not exist on Reddit), private / banned / quarantined (a community in the scope that cannot be read: skipped), or not_available (translate_to only: Reddit had no translated listing, the rows are served in their original language). |
data.resolved_filters.time | object / null | Time window as applied. |
data.billed_requests | integer | Requests billed for this call (also sent as Requests in the X-RapidAPI-Billing header when it is not RapidAPI’s default of 1). |
request_params | object | Echo of the parameters you sent |
Error Responses
Invalid input returns HTTP 400, not billed. error is a plain string that names the parameter:
| |
| Status Code | Cause | Description |
|---|---|---|
| 400 | Invalid or missing parameter | Plain-English message per field. Not billed |
200 with status: false | Item not available | error.code is not_found, deleted (post removed or deleted). data is null. Billed 1 request |
| 503 | Reddit temporarily unreachable | "error": "Service temporarily unavailable". Not billed, retry later |
200 with status: false | Bad page token | error.code is invalid_page_token: pass next_page_token from the previous answer unchanged |
Code Examples
| |
| |
| |
Related Endpoints
- Post Details : Post details by id or URL
- Post Top Comments : Top comments and awards of a post