GET /post/search

Post Search

Search posts (site-wide or in one subreddit). Reddit Scraper API endpoint /post/search: parameters, JSON response fields and code examples.

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

ParameterTypeRequiredDefaultDescription
qstringYes-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).
subredditstringNo-Restrict to one community (verified scope, echoed in resolved_filters).
page_tokenstringNo-Opaque page token from a previous response’s next_page_token. Omit for the first page.
per_pageintegerNo25Results per page, 1–25 (default 25). One page is billed 1 request.
sortstringNonewDefault new (newest first, the same order on every call). Also relevance (not stable between calls), hot, top, comments. Allowed: relevance, hot, top, new, comments.
timestringNodefaultOnly 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.
flairstringNo-Only posts with this flair (the tag a subreddit puts on posts, e.g. Discussion). Exact text as listed by /subreddit/flairs; needs subreddit.
domainstringNo-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_scoreintegerNo-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_commentsintegerNo-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_afterstringNo-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_beforestringNo-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_pagesintegerNo-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_nsfwbooleanNotrueDefault 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_detailsbooleanNofalseAdds 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_htmlbooleanNofalseAdds body_html (the rendered HTML body) to every post and comment. Default: left out; body_text carries the same text.
translate_tostringNononeReddit’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 …).

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
{
  "status": true,
  "request_id": "8d0897de-fde5-2a7d-5b3d-1cd7dbc3",
  "data": {
    "results": [
      {
        "post_id": "t3_1xm7oif",
        "title": "FastAPI Cloud is now generally available",
        "type": "text",
        "permalink": "/r/Python/comments/1xm7oif/fastapi_cloud_is_now_generally_available/",
        "post_url": "https://www.reddit.com/r/Python/comments/1xm7oif/fastapi_cloud_is_now_generally_available/",
        "url": "https://www.reddit.com/r/Python/comments/1xm7oif/fastapi_cloud_is_now_generally_available/",
        "domain": "self.Python",
        "subreddit": "Python",
        "subreddit_id": "t5_2qh0y",
        "subreddit_type": "public",
        "subreddit_icon_url": "https://styles.redditmedia.com/t5_2qh0y/styles/communityIcon_lctik80p96tg1.png?width=64&frame=1&auto=webp&s=92baaacc951d52b5071629852df033d53cafa5ec",
        "is_subreddit_nsfw": false,
        "is_subreddit_quarantined": false,
        "author": "tiangolo",
        "is_author_deleted": false,
        "author_id": "t2_26a8xfuu",
        "flair": {
          "text": "News",
          "rich_text": [
            {
              "type": "text",
              "text": "News",
              "url": null
            }
          ],
          "background_color": "#7193FF",
          "text_color": "light",
          "flair_id": "0ad780a0-1c5e-11ea-978c-0ee7bacb2bff"
        },
        "score": 115,
        "comments_count": 15,
        "crossposts_count": null,
        "created_at": "2026-11-02T19:57:30.676000+00:00",
        "is_nsfw": false,
        "is_spoiler": false,
        "is_stickied": false,
        "is_locked": false,
        "is_archived": false,
        "is_crosspost": false,
        "crosspost_parent_id": null,
        "crosspost_parent_subreddit": null,
        "position": 1,
        "thumbnail_url": "https://external-preview.redd.it/fastapi-cloud-is-now-generally-available-v0-KLZ6R5EW72h0IiS6rt9ZP7XKeb06RwwiTZPraC2LfSg.png?width=108&crop=smart&auto=webp&s=282375ef2e2b9691c2758c75c7772be424d3014a",
        "media": {
          "type": null,
          "preview_url": "https://external-preview.redd.it/fastapi-cloud-is-now-generally-available-v0-KLZ6R5EW72h0IiS6rt9ZP7XKeb06RwwiTZPraC2LfSg.png?width=1080&crop=smart&auto=webp&s=44f0f0e1d921b0889a918fe2d562d67379069644",
          "preview_width": 1080,
          "preview_height": 567,
          "preview_variants": [
            {
              "size": "thumbnail",
              "url": "https://external-preview.redd.it/fastapi-cloud-is-now-generally-available-v0-KLZ6R5EW72h0IiS6rt9ZP7XKeb06RwwiTZPraC2LfSg.png?width=108&crop=smart&auto=webp&s=282375ef2e2b9691c2758c75c7772be424d3014a",
              "width": 108,
              "height": 56
            },
            {
              "size": "compact",
              "url": "https://external-preview.redd.it/fastapi-cloud-is-now-generally-available-v0-KLZ6R5EW72h0IiS6rt9ZP7XKeb06RwwiTZPraC2LfSg.png?width=216&crop=smart&auto=webp&s=e9369945c766e0c5d7b8ee8e0b21535d90927142",
              "width": 216,
              "height": 113
            }
          ],
          "alt_text": null,
          "hls_url": null,
          "video_url": null,
          "poster_url": null,
          "captions_url": null,
          "duration_seconds": null,
          "width": null,
          "height": null,
          "renditions": [],
          "embed_html": null,
          "embed_provider": null,
          "gallery": []
        }
      },
      {
        "post_id": "t3_1xj761j",
        "title": "My AsyncAPI Conf 2026 talk: keeping WebSocket APIs honest with a code-first approach in Python",
        "type": "text",
        "permalink": "/r/Python/comments/1xj761j/my_asyncapi_conf_2026_talk_keeping_websocket_apis/",
        "post_url": "https://www.reddit.com/r/Python/comments/1xj761j/my_asyncapi_conf_2026_talk_keeping_websocket_apis/",
        "url": "https://www.reddit.com/r/Python/comments/1xj761j/my_asyncapi_conf_2026_talk_keeping_websocket_apis/",
        "domain": "self.Python",
        "subreddit": "Python",
        "subreddit_id": "t5_2qh0y",
        "subreddit_type": "public",
        "subreddit_icon_url": "https://styles.redditmedia.com/t5_2qh0y/styles/communityIcon_lctik80p96tg1.png?width=64&frame=1&auto=webp&s=92baaacc951d52b5071629852df033d53cafa5ec",
        "is_subreddit_nsfw": false,
        "is_subreddit_quarantined": false,
        "author": "huygl99",
        "is_author_deleted": false,
        "author_id": "t2_1t7c3gzabc",
        "flair": {
          "text": "Resource",
          "rich_text": [
            {
              "type": "text",
              "text": "Resource",
              "url": null
            }
          ],
          "background_color": "#DDBD37",
          "text_color": "light",
          "flair_id": "f9716fb2-4113-11ea-a3f1-0ef51f60f757"
        },
        "score": 18,
        "comments_count": 0,
        "crossposts_count": null,
        "created_at": "2026-10-30T05:40:13.650000+00:00",
        "is_nsfw": false,
        "is_spoiler": false,
        "is_stickied": false,
        "is_locked": false,
        "is_archived": false,
        "is_crosspost": false,
        "crosspost_parent_id": null,
        "crosspost_parent_subreddit": null,
        "position": 2,
        "thumbnail_url": "https://external-preview.redd.it/my-asyncapi-conf-2026-talk-keeping-websocket-apis-honest-v0-HD7qc6exrBhJFlOlhgCo6ta3E-AxbmWXz-2DHgkXaus.jpeg?width=108&crop=smart&auto=webp&s=04bb95199e20a595a1bd9eb18d022c40b43fec67",
        "media": {
          "type": null,
          "preview_url": "https://external-preview.redd.it/my-asyncapi-conf-2026-talk-keeping-websocket-apis-honest-v0-HD7qc6exrBhJFlOlhgCo6ta3E-AxbmWXz-2DHgkXaus.jpeg?auto=webp&s=3869d2ce92e8cb2e04a3354c123bc9b91a357151",
          "preview_width": 480,
          "preview_height": 360,
          "preview_variants": [
            {
              "size": "thumbnail",
              "url": "https://external-preview.redd.it/my-asyncapi-conf-2026-talk-keeping-websocket-apis-honest-v0-HD7qc6exrBhJFlOlhgCo6ta3E-AxbmWXz-2DHgkXaus.jpeg?width=108&crop=smart&auto=webp&s=04bb95199e20a595a1bd9eb18d022c40b43fec67",
              "width": 108,
              "height": 81
            },
            {
              "size": "compact",
              "url": "https://external-preview.redd.it/my-asyncapi-conf-2026-talk-keeping-websocket-apis-honest-v0-HD7qc6exrBhJFlOlhgCo6ta3E-AxbmWXz-2DHgkXaus.jpeg?width=216&crop=smart&auto=webp&s=935e308ca998ebd89621354771b3fb5293f5c4f3",
              "width": 216,
              "height": 162
            }
          ],
          "alt_text": null,
          "hls_url": null,
          "video_url": null,
          "poster_url": null,
          "captions_url": null,
          "duration_seconds": null,
          "width": null,
          "height": null,
          "renditions": [],
          "embed_html": null,
          "embed_provider": null,
          "gallery": []
        }
      }
    ],
    "has_next_page": true,
    "next_page_token": "eyJ2IjoxLCJraW5kIjoicG9zdF9zZWFyY2giLCJmcCI6IjdjM2RiNWZiYjYiLCJ0cyI6MTc5NTU1MzY3OCwidSI6ImV5SmpZVzVrYVdSaGRHVnpYM0psZEhWeWJtVmtJam9pZTF3aWMyVmpkR2x2Ymw4eFgzQnBjR1ZzYVc1bFh6QmZaMnh2WW1Gc1gyMXZaR2xtYVdWeWMxd2lPbHdpTVZ3aUxGd2ljMlZqZEdsdmJsOHhY…",
    "resolved_filters": {
      "subreddit": {
        "input": "python",
        "resolved": "Python",
        "source": "param"
      },
      "sort": {
        "input": null,
        "resolved": "new",
        "source": "default"
      },
      "time": null
    },
    "billed_requests": 1
  },
  "request_params": {
    "q": "fastapi",
    "subreddit": "python",
    "per_page": "5"
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue when the request succeeded
request_idstringUnique request identifier
dataobjectSearch page.
data.resultsarray of objectsMatching posts, deduped by id.
data.results[].post_idstringPost fullname, e.g. t3_z1c9z.
data.results[].titlestringPost title; null when Reddit shows only its removal placeholder ([ Removed by moderator ]…).
data.results[].typestringtext, 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[].permalinkstringReddit 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_urlstringAbsolute link of the post’s Reddit thread (https://www.reddit.com + permalink), ready to open.
data.results[].urlstringWhere 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[].domainstringLink 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[].subredditstringSubreddit name without r/.
data.results[].subreddit_idstringSubreddit id (t5_…).
data.results[].subreddit_typestringCommunity 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_urlstringCommunity 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_nsfwbooleanThe 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_quarantinedbooleanThe 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[].authorstringAuthor 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_deletedbooleanThe author’s account is deleted (the post may remain).
data.results[].author_idstringAuthor account id (t2_…). Only with with_details=true on /post/batch and /answers.
data.results[].flairobjectPost 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.textstringFlair text (emoji shortcodes kept, e.g. :phx-2: Suns).
data.results[].flair.rich_textarray of objectsRich-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[].typestringtext or emoji.
data.results[].flair.rich_text[].textstringThe text, or the emoji’s short code (e.g. :nba-1:).
data.results[].flair.rich_text[].urlstring / nullEmoji image URL (emoji parts only).
data.results[].flair.background_colorstringHex background colour (#0079D3) or null when the flair has no colour.
data.results[].flair.text_colorstringlight or dark text on the flair pill.
data.results[].flair.flair_idstringFlair 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[].scoreintegerNet upvotes at fetch time.
data.results[].comments_countintegerComment count reported by Reddit.
data.results[].crossposts_countinteger / nullNumber 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_atstringISO-8601 UTC creation time, microsecond precision. Left out on /media/search and on /answers without with_details.
data.results[].is_nsfwbooleanMarked NSFW.
data.results[].is_spoilerbooleanMarked spoiler. Only with with_details=true on /post/batch and /answers.
data.results[].is_stickiedbooleanPinned 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_lockedbooleanComments locked. Only with with_details=true on /post/batch and /answers (always on /post/search). Left out on /media/search.
data.results[].is_archivedbooleanArchived (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_crosspostbooleanThe post is a crosspost. Only with with_details=true on the routes that have it. Left out on /media/search.
data.results[].crosspost_parent_idstring / nullId 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_subredditstring / nullSubreddit 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[].positionintegerRank in the feed or the search results, 1-based and counted across pages (feeds keep Reddit’s gaps where ads were).
data.results[].thumbnail_urlstringThumbnail URL.
data.results[].mediaobjectImages, video renditions, gallery, embed. Only with with_details=true on the routes that have it (always on /post/search).
data.results[].media.typestring / nullMedia kind: image, video, gif, gallery, embed or null.
data.results[].media.preview_urlstringLargest still preview URL.
data.results[].media.preview_widthintegerPreview pixel width.
data.results[].media.preview_heightintegerPreview pixel height.
data.results[].media.preview_variantsarray of objectsEvery size Reddit renders of the preview image, smallest first; empty when this endpoint does not carry them.
data.results[].media.preview_variants[].sizestringthumbnail (108 px wide), compact, medium (320), large (640), extra_large (1080) or full (the original size).
data.results[].media.preview_variants[].urlstringImage URL at that size.
data.results[].media.preview_variants[].widthintegerPixel width.
data.results[].media.preview_variants[].heightintegerPixel height.
data.results[].media.alt_textstring / nullImage description the author set for screen readers; null when none.
data.results[].media.hls_urlstring / nullHLS playlist (.m3u8) for hosted video.
data.results[].media.video_urlstring / nullPlayer 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_urlstring / nullVideo poster image.
data.results[].media.captions_urlstring / nullWebVTT captions URL when available.
data.results[].media.duration_secondsinteger / nullVideo duration in seconds.
data.results[].media.widthinteger / nullVideo pixel width (a hosted video’s full size, or the embed player’s size).
data.results[].media.heightinteger / nullVideo pixel height (a hosted video’s full size, or the embed player’s size).
data.results[].media.renditionsarrayMP4 renditions with bitrate and size (hosted video only).
data.results[].media.embed_htmlstring / nulloEmbed iframe HTML for third-party embeds (YouTube, Streamable…).
data.results[].media.embed_providerstring / nullEmbed provider name, e.g. YouTube or Streamable; null on Reddit-hosted media.
data.results[].media.galleryarrayGallery images in page order.
data.has_next_pagebooleanMore results available.
data.next_page_tokenstringToken for the next page; null at the end.
data.resolved_filtersobjectScope and sort as applied.
data.resolved_filters.subredditobjectSubreddit scope as applied; source: not_found when the community does not exist.
data.resolved_filters.subreddit.inputstringWhat the caller sent.
data.resolved_filters.subreddit.resolvedstringWhat was applied on Reddit (null when not applied).
data.resolved_filters.subreddit.sourcestringparam (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.sortobjectSort as applied.
data.resolved_filters.sort.inputstring / nullWhat the caller sent.
data.resolved_filters.sort.resolvedstringWhat was applied on Reddit (null when not applied).
data.resolved_filters.sort.sourcestringparam (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.timeobject / nullTime window as applied.
data.billed_requestsintegerRequests billed for this call (also sent as Requests in the X-RapidAPI-Billing header when it is not RapidAPI’s default of 1).
request_paramsobjectEcho of the parameters you sent

Error Responses

Invalid input returns HTTP 400, not billed. error is a plain string that names the parameter:

1
{ "status": false, "request_id": "99a1e6cd-2e57-9e8f-4e44-2dea7f6d", "error": "Invalid parameter 'post_id': must be a post id such as z1c9z or t3_z1c9z", "request_params": { "post_id": "!!" } }
Status CodeCauseDescription
400Invalid or missing parameterPlain-English message per field. Not billed
200 with status: falseItem not availableerror.code is not_found, deleted (post removed or deleted). data is null. Billed 1 request
503Reddit temporarily unreachable"error": "Service temporarily unavailable". Not billed, retry later
200 with status: falseBad page tokenerror.code is invalid_page_token: pass next_page_token from the previous answer unchanged

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
import requests

url = "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/post/search"

params = {
    "q": "fastapi",
    "subreddit": "python",
    "per_page": "5",
}

headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=params)
data = response.json()["data"]

for item in data["results"]:
    print(item["title"], item["subreddit"])
print("Billed requests:", data["billed_requests"])
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
const url = "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/post/search";

const params = new URLSearchParams({
  q: "fastapi",
  subreddit: "python",
  per_page: "5",
});

const response = await fetch(`${url}?${params}`, {
  headers: {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com"
  }
});

const { data } = await response.json();
data.results.forEach((item) => console.log(item.title, item.subreddit));
1
2
3
4
5
6
curl -G "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/post/search" \
  --data-urlencode "q=fastapi" \
  --data-urlencode "subreddit=python" \
  --data-urlencode "per_page=5" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com"
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI