GET /media/search

Media Search

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

Image and video posts matching q, each with a media block: preview image and, for videos, the HLS playlist, poster and MP4 renditions (signed URLs that expire within hours). Up to 25 posts per page, paged with next_page_token; with_details=true adds the full post card (created time, upvote ratio, body…). Billed 1 request per page, +1 per post detailed. It is /post/search restricted to image and video posts.

HTTP Request

GET /media/search

Cost (in requests): 1 per page; +1 per post detailed. Every successful answer reports its cost in data.billed_requests.

Parameters

ParameterTypeRequiredDefaultDescription
qstringYes-Search query.
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.
media_typestringNoallKeep only video, image, gif or gallery posts of this page (same price). all (default) = no filter, every kind.
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 the full post card per post: these keys (left out without it) created_at, upvote_ratio, body_text, subreddit_type, subreddit_icon_url, is_subreddit_quarantined, author_type, author_avatar_url, is_author_nsfw, is_brand_affiliate, is_locked, is_archived, is_stickied, is_crosspost, crossposts_count, shares_count, and fills flair, author_flair, body_media, poll, distinguished, removed_by, removal_category. A post whose details could not be read in time keeps the basic card. Billed: +1 request per post detailed.
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 /media/search?q=cat&per_page=10&time=month&sort=top&media_type=video (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
{
  "status": true,
  "request_id": "d86b4bf7-6df4-aff5-b060-c6102484",
  "data": {
    "results": [
      {
        "post_id": "t3_1xwjmov",
        "title": "This is why big cats can’t be pets",
        "type": "video",
        "permalink": "/r/BeAmazed/comments/1xwjmov/this_is_why_big_cats_cant_be_pets/",
        "post_url": "https://www.reddit.com/r/BeAmazed/comments/1xwjmov/this_is_why_big_cats_cant_be_pets/",
        "url": "https://www.reddit.com/r/BeAmazed/comments/1xwjmov/this_is_why_big_cats_cant_be_pets/",
        "domain": "v.redd.it",
        "subreddit": "BeAmazed",
        "subreddit_id": "t5_363r3",
        "is_subreddit_nsfw": false,
        "author": "Super-Stevie117",
        "is_author_deleted": false,
        "author_id": "t2_2ihktxvolc",
        "author_flair": null,
        "flair": null,
        "score": 99857,
        "comments_count": 2916,
        "is_nsfw": false,
        "is_spoiler": false,
        "crosspost_parent_id": null,
        "crosspost_parent_subreddit": null,
        "distinguished": null,
        "removed_by": null,
        "removal_category": null,
        "position": 5,
        "thumbnail_url": "https://external-preview.redd.it/this-is-why-big-cats-cant-be-pets-v0-MWhsaTljMzdwbzFpMZbc6Dgu4nbDe9tZfY8Yptv0YJHJTs8GtKz96Zb-hH_L.png?format=pjpg&auto=webp&s=a478c638eaf464e9cd1667bf5921278d3ec5c174",
        "thumbnail_width": null,
        "thumbnail_height": null,
        "body_media": [],
        "poll": null,
        "media": {
          "type": "video",
          "preview_url": "https://external-preview.redd.it/this-is-why-big-cats-cant-be-pets-v0-MWhsaTljMzdwbzFpMZbc6Dgu4nbDe9tZfY8Yptv0YJHJTs8GtKz96Zb-hH_L.png?format=pjpg&auto=webp&s=a478c638eaf464e9cd1667bf5921278d3ec5c174",
          "preview_width": null,
          "preview_height": null,
          "preview_variants": [],
          "alt_text": null,
          "hls_url": "https://v.redd.it/l90b1ub7po1i1/HLSPlaylist.m3u8?f=hd%2CsubsAll%2ChlsSpecOrder&v=1&a=1798146058%2CZjc3NThiOGI1NmJjMTZmMjFhY2NiODNkYWU4YjMxMDBkNjNmZmFkMWVlN2E0OGM2MmVmOTgzM2U3M2I0NWEwYg%3D%3D",
          "video_url": null,
          "poster_url": "https://external-preview.redd.it/this-is-why-big-cats-cant-be-pets-v0-MWhsaTljMzdwbzFpMZbc6Dgu4nbDe9tZfY8Yptv0YJHJTs8GtKz96Zb-hH_L.png?format=pjpg&auto=webp&s=a478c638eaf464e9cd1667bf5921278d3ec5c174",
          "captions_url": null,
          "duration_seconds": 110,
          "width": 1080,
          "height": 1920,
          "renditions": [
            {
              "url": "https://packaged-media.redd.it/l90b1ub7po1i1/pb/m2-res_392p.mp4?m=DASHPlaylist.mpd&c=wh_ben_en&var=sgpssan&v=1&e=1795572000&s=b45e501fae7322d18ccb89479aa68c1582d7f5a7",
              "width": 220,
              "height": 392,
              "bitrate_bps": 260072,
              "codec": "h264"
            },
            {
              "url": "https://packaged-media.redd.it/l90b1ub7po1i1/pb/m2-res_480p.mp4?m=DASHPlaylist.mpd&c=wh_ben_en&var=sgpssan&v=1&e=1795572000&s=495a42bd01172514dbdea7cabdb14c7c9a38648e",
              "width": 270,
              "height": 480,
              "bitrate_bps": 452280,
              "codec": "h264"
            }
          ],
          "embed_html": null,
          "embed_provider": null,
          "gallery": []
        }
      },
      {
        "post_id": "t3_1xwvdol",
        "title": "So… are you a cat person or a dog person?",
        "type": "video",
        "permalink": "/r/MadeMeSmile/comments/1xwvdol/so_are_you_a_cat_person_or_a_dog_person/",
        "post_url": "https://www.reddit.com/r/MadeMeSmile/comments/1xwvdol/so_are_you_a_cat_person_or_a_dog_person/",
        "url": "https://www.reddit.com/r/MadeMeSmile/comments/1xwvdol/so_are_you_a_cat_person_or_a_dog_person/",
        "domain": "v.redd.it",
        "subreddit": "MadeMeSmile",
        "subreddit_id": "t5_2uqcm",
        "is_subreddit_nsfw": false,
        "author": "drlouies",
        "is_author_deleted": false,
        "author_id": "t2_ir2xf",
        "author_flair": null,
        "flair": null,
        "score": 84132,
        "comments_count": 537,
        "is_nsfw": false,
        "is_spoiler": false,
        "crosspost_parent_id": null,
        "crosspost_parent_subreddit": null,
        "distinguished": null,
        "removed_by": null,
        "removal_category": null,
        "position": 8,
        "thumbnail_url": "https://external-preview.redd.it/so-are-you-a-cat-person-or-a-dog-person-v0-dGN4ZnFvdTAyczFpMbvneNdr2JySo0gJC6Cb913U-fkGxg5X3TeoEBvQJ0uf.png?format=pjpg&auto=webp&s=08ec131f20cb14fe4c66e80d0b12401a7cc7ce9e",
        "thumbnail_width": null,
        "thumbnail_height": null,
        "body_media": [],
        "poll": null,
        "media": {
          "type": "video",
          "preview_url": "https://external-preview.redd.it/so-are-you-a-cat-person-or-a-dog-person-v0-dGN4ZnFvdTAyczFpMbvneNdr2JySo0gJC6Cb913U-fkGxg5X3TeoEBvQJ0uf.png?format=pjpg&auto=webp&s=08ec131f20cb14fe4c66e80d0b12401a7cc7ce9e",
          "preview_width": null,
          "preview_height": null,
          "preview_variants": [],
          "alt_text": null,
          "hls_url": "https://v.redd.it/104411312s1i1/HLSPlaylist.m3u8?f=sd%2CsubsAll%2ChlsSpecOrder&v=1&a=1798146058%2CNTEzYzJkZTFmMGFkY2Q4ODQ0YzhmNGRiYjA2MDc2NTZkYTk2OGM1MTFmNDExYjg3NGQ0YzI2NGU5NDRmMWM0NQ%3D%3D",
          "video_url": null,
          "poster_url": "https://external-preview.redd.it/so-are-you-a-cat-person-or-a-dog-person-v0-dGN4ZnFvdTAyczFpMbvneNdr2JySo0gJC6Cb913U-fkGxg5X3TeoEBvQJ0uf.png?format=pjpg&auto=webp&s=08ec131f20cb14fe4c66e80d0b12401a7cc7ce9e",
          "captions_url": null,
          "duration_seconds": 14,
          "width": 720,
          "height": 1052,
          "renditions": [
            {
              "url": "https://packaged-media.redd.it/104411312s1i1/pb/m2-res_322p.mp4?m=DASHPlaylist.mpd&var=sgpssanpmp4v2&v=1&e=1795572000&s=4b33bb0a83d9bcd75e20dfc18f37e5ea35adc494",
              "width": 220,
              "height": 322,
              "bitrate_bps": 189206,
              "codec": "h264"
            },
            {
              "url": "https://packaged-media.redd.it/104411312s1i1/pb/m2-res_394p.mp4?m=DASHPlaylist.mpd&var=sgpssanpmp4v2&v=1&e=1795572000&s=749b5fbca4ac46fea21e73f77b3edabf7227dc91",
              "width": 270,
              "height": 394,
              "bitrate_bps": 352250,
              "codec": "h264"
            }
          ],
          "embed_html": null,
          "embed_provider": null,
          "gallery": []
        }
      }
    ],
    "has_next_page": true,
    "next_page_token": "eyJ2IjoxLCJraW5kIjoibWVkaWFfc2VhcmNoIiwiZnAiOiJhOTdlYjIzMjJjIiwidHMiOjE3OTU1NTQwNTksInUiOiJleUpqWVc1a2FXUmhkR1Z6WDNKbGRIVnlibVZrSWpvaWUxd2ljMlZqZEdsdmJsOHhYM0JwY0dWc2FXNWxYekJmWjJ4dlltRnNYMjF2WkdsbWFXVnljMXdpT2x3aU1Wd2lMRndpYzJWamRHbHZibDh4…",
    "resolved_filters": {
      "subreddit": null,
      "sort": {
        "input": "top",
        "resolved": "top",
        "source": "param"
      },
      "time": {
        "input": "month",
        "resolved": "month",
        "source": "param"
      },
      "media_type": {
        "input": "video",
        "resolved": "video",
        "source": "param"
      }
    },
    "scanned_count": 10,
    "billed_requests": 1
  },
  "request_params": {
    "q": "cat",
    "per_page": "10",
    "time": "month",
    "sort": "top",
    "media_type": "video"
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue when the request succeeded
request_idstringUnique request identifier
dataobjectSearch page.
data.resultsarray of objectsImage and video posts with media renditions. created_at and upvote_ratio are always null on media search (the results carry neither; use /post/details).
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[].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[].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[].author_flairobject / nullAuthor’s flair in this subreddit; null when this endpoint does not carry it. Only with with_details=true on the routes that have it. Left out on /subreddit/multi-posts and the listing-card routes (/subreddit/posts, /feed/best, /feed/popular, /content/stories, /content/viral-media, /user/activity, /user/insights).
data.results[].flairobject / nullPost 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[].scoreintegerNet upvotes at fetch time.
data.results[].comments_countintegerComment count reported by Reddit.
data.results[].is_nsfwbooleanMarked NSFW.
data.results[].is_spoilerbooleanMarked spoiler. Only with with_details=true on /post/batch and /answers.
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[].distinguishedstring / nullmoderator or admin when the post is distinguished; else null. Only with with_details=true on the routes that have it.
data.results[].removed_bystring / nullWho removed the post: moderator, author, automod, spam, reddit or other; null when live or when this endpoint does not carry it. Only with with_details=true on the routes that have it.
data.results[].removal_categorystring / nullReddit’s removal reason as sent, e.g. moderator or automod_filtered; null when live. Only with with_details=true on the routes that have it.
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[].thumbnail_widthinteger / nullThumbnail pixel width; null when this endpoint does not carry it. Only with with_details=true on the routes that have it.
data.results[].thumbnail_heightinteger / nullThumbnail pixel height; null when this endpoint does not carry it. Only with with_details=true on the routes that have it.
data.results[].body_mediaarrayImages and videos embedded in the text body, in order; empty when none or when this endpoint does not carry them. Only with with_details=true on the routes that have it.
data.results[].pollobject / nullPoll options and totals (poll posts only). Only with with_details=true on the routes that have it.
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.typestringMedia kind: image, video, gif, gallery, embed or null.
data.results[].media.preview_urlstringLargest still preview URL.
data.results[].media.preview_widthinteger / nullPreview pixel width.
data.results[].media.preview_heightinteger / nullPreview pixel height.
data.results[].media.preview_variantsarrayEvery size Reddit renders of the preview image, smallest first; empty when this endpoint does not carry them.
data.results[].media.alt_textstring / nullImage description the author set for screen readers; null when none.
data.results[].media.hls_urlstringHLS 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_urlstringVideo poster image.
data.results[].media.captions_urlstring / nullWebVTT captions URL when available.
data.results[].media.duration_secondsintegerVideo duration in seconds.
data.results[].media.widthintegerVideo pixel width (a hosted video’s full size, or the embed player’s size).
data.results[].media.heightintegerVideo pixel height (a hosted video’s full size, or the embed player’s size).
data.results[].media.renditionsarray of objectsMP4 renditions with bitrate and size (hosted video only).
data.results[].media.renditions[].urlstringSigned MP4 URL (expires in about a day — never cache).
data.results[].media.renditions[].widthintegerPixel width.
data.results[].media.renditions[].heightintegerPixel height.
data.results[].media.renditions[].bitrate_bpsintegerBitrate in bits per second.
data.results[].media.renditions[].codecstringVideo codec (e.g. h264).
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.subredditobject / nullSubreddit scope as applied; source: not_found when the community does not exist.
data.resolved_filters.sortobjectSort as applied.
data.resolved_filters.sort.inputstringWhat 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.timeobjectTime window as applied.
data.resolved_filters.time.inputstringWhat the caller sent.
data.resolved_filters.time.resolvedstringWhat was applied on Reddit (null when not applied).
data.resolved_filters.time.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.media_typeobjectMedia kind filter as applied (/media/search only); present only when media_type was given.
data.resolved_filters.media_type.inputstringWhat the caller sent.
data.resolved_filters.media_type.resolvedstringWhat was applied on Reddit (null when not applied).
data.resolved_filters.media_type.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.scanned_countintegerPosts examined on this page before media_type (only with that filter).
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
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
22
23
import requests

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

params = {
    "q": "cat",
    "per_page": "10",
    "time": "month",
    "sort": "top",
    "media_type": "video",
}

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
18
19
const url = "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/media/search";

const params = new URLSearchParams({
  q: "cat",
  per_page: "10",
  time: "month",
  sort: "top",
  media_type: "video",
});

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
7
8
curl -G "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/media/search" \
  --data-urlencode "q=cat" \
  --data-urlencode "per_page=10" \
  --data-urlencode "time=month" \
  --data-urlencode "sort=top" \
  --data-urlencode "media_type=video" \
  -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