Reddit Subreddit API
The Reddit Subreddit API returns the posts of a subreddit on
Reddit
as structured JSON, in the order Reddit lists them: hot, new, top, rising or controversial. Each post
comes with its title, author, score, comment count, flair, text and media, and next_page_token
pages through the rest. popular returns Reddit's Popular feed, and NSFW posts are left out
unless safe is off.
API Parameters
Subreddit
-
- Name
-
subreddit - Required
- Required
- Description
-
The name of the subreddit, for example
awworr/aww, or a link to it, for examplehttps://www.reddit.com/r/aww/. Use thesubreddit.nameof a Reddit Search API result.popularreturns Reddit's Popular feed.
Sorting
-
- Name
-
sort_by - Required
- Optional
- Description
-
Sorts the posts. Options are:
hot- currently popular (default)new- newest firsttop- highest scorerising- gaining votes fastcontroversial- most mixed votes
-
- Name
-
time_period - Required
- Optional
- Description
-
Limits
topandcontroversialposts to a time range, and is only accepted with those sorts. Reddit's default islast_day. Options are:last_hourlast_daylast_weeklast_monthlast_yearany_time
Filters
-
- Name
-
safe - Required
- Optional
- Description
-
Controls NSFW posts.
active(default) leaves them out,offincludes them.
Pagination
-
- Name
-
next_page_token - Required
- Optional
- Description
-
The token for the next page of posts. Use the
pagination.next_page_tokenvalue from the previous response with the samesubreddit,sort_byandtime_period. A page holds about 25 posts, as on Reddit, which lists up to about 1,000 posts per sort.
Engine
-
- Name
-
engine - Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
reddit_subreddit.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Posts
https://www.searchapi.io/api/v1/search?engine=reddit_subreddit&subreddit=aww
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "reddit_subreddit",
"subreddit": "aww"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_JQGykEzoKXOSL54y3aB6bl2N",
"status": "Success",
"created_at": "2026-10-28T19:36:24Z",
"request_time_taken": 1.63,
"parsing_time_taken": 0.03,
"total_time_taken": 1.66,
"request_url": "https://www.reddit.com/r/aww/hot/",
"html_url": "https://www.searchapi.io/api/v1/searches/search_JQGykEzoKXOSL54y3aB6bl2N.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_JQGykEzoKXOSL54y3aB6bl2N"
},
"search_parameters": {
"engine": "reddit_subreddit",
"subreddit": "aww"
},
"posts": [
{
"position": 1,
"id": "t3_1xhjsjk",
"title": "He climbed to the highest spot in the room, let out the biggest yawn, and stayed right there to watch over me.",
"link": "https://www.reddit.com/r/aww/comments/1xhjsjk/he_climbed_to_the_highest_spot_in_the_room_let/",
"type": "video",
"author": {
"username": "Ok_Judgment8420",
"id": "t2_294a6oadxy",
"link": "https://www.reddit.com/user/Ok_Judgment8420/"
},
"subreddit": {
"name": "aww",
"id": "t5_2qh1o",
"link": "https://www.reddit.com/r/aww/"
},
"score": 5831,
"upvote_ratio": 0.9840340606705694,
"comments": 41,
"thumbnail": "https://external-preview.redd.it/he-climbed-to-the-highest-spot-in-the-room-let-out-the-v0-bTZwZGNyZnlpNnloMUT9V3ZDCQThVlDkh996JGw1Pg0GL5QDssjmUbVJvUPo.png?width=640&crop=smart&format=pjpg&auto=webp&s=c959dc11f7bb694f774641d544748e33b3ebc86e",
"video": {
"link": "https://packaged-media.redd.it/04yfkifyi6yh1/pb/m2-res_1280p.mp4?m=DASHPlaylist.mpd&var=sgpssan&v=1&e=1793232000&s=6fa3834d99835ed9c11a9f1505b0bbab2e4cd50c",
"hls_link": "https://v.redd.it/04yfkifyi6yh1/HLSPlaylist.m3u8?f=sd%2CsubsAll%2ChlsSpecOrder&v=1&a=1795808185%2CY2JiZDY4Nzk3MmY3ZThmZGRkZTk4ZTVjNDUwOTg2Mzk2ODRiOTU1Njg3NTg2NDUwNjlkN2U4OGNlODIzZDZjMA%3D%3D",
"duration": 31,
"width": 720,
"height": 1280
},
"iso_date": "2026-10-28T09:54:32Z"
},
"..."
],
"pagination": {
"next_page_token": "dDNfMXhoZTZjYQ=="
}
}
Top Posts of the Week
https://www.searchapi.io/api/v1/search?engine=reddit_subreddit&sort_by=top&subreddit=programming&time_period=last_week
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "reddit_subreddit",
"subreddit": "programming",
"sort_by": "top",
"time_period": "last_week"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_byrKD1vgMQrI0V9kgeJNER4z",
"status": "Success",
"created_at": "2026-10-28T19:36:26Z",
"request_time_taken": 2.06,
"parsing_time_taken": 0.03,
"total_time_taken": 2.1,
"request_url": "https://www.reddit.com/r/programming/top/?t=week",
"html_url": "https://www.searchapi.io/api/v1/searches/search_byrKD1vgMQrI0V9kgeJNER4z.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_byrKD1vgMQrI0V9kgeJNER4z"
},
"search_parameters": {
"engine": "reddit_subreddit",
"subreddit": "programming",
"sort_by": "top",
"time_period": "last_week"
},
"posts": [
{
"position": 1,
"id": "t3_1xf4c5d",
"title": "Just finished my multiplayer system in C and turns out we can support 50k players in a single server at 60hz simulation tick",
"link": "https://www.reddit.com/r/programming/comments/1xf4c5d/just_finished_my_multiplayer_system_in_c_and/",
"type": "link",
"author": {
"username": "dechichi",
"id": "t2_4anbx9d9",
"link": "https://www.reddit.com/user/dechichi/"
},
"subreddit": {
"name": "programming",
"id": "t5_2fwo",
"link": "https://www.reddit.com/r/programming/"
},
"score": 951,
"upvote_ratio": 0.8598484848484849,
"comments": 187,
"external_link": "https://youtu.be/imG2Tt_KOj4",
"domain": "youtu.be",
"iso_date": "2026-10-25T14:50:38Z"
},
"..."
],
"pagination": {
"next_page_token": "dDNfMXhkZWYwcA=="
}
}
Pagination
Pass the pagination.next_page_token value from a response as next_page_token,
with the same subreddit, sort_by and time_period, to get the next page.
https://www.searchapi.io/api/v1/search?engine=reddit_subreddit&next_page_token=dDNfcTNzbWZy&sort_by=top&subreddit=programming&time_period=any_time
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "reddit_subreddit",
"subreddit": "programming",
"sort_by": "top",
"time_period": "any_time",
"next_page_token": "dDNfcTNzbWZy"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_80BKjxagxvjc2b6Y35nMQeWO",
"status": "Success",
"created_at": "2026-10-28T19:36:29Z",
"request_time_taken": 1.26,
"parsing_time_taken": 0.01,
"total_time_taken": 1.27,
"request_url": "https://www.reddit.com/r/programming/top/?t=all",
"html_url": "https://www.searchapi.io/api/v1/searches/search_80BKjxagxvjc2b6Y35nMQeWO.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_80BKjxagxvjc2b6Y35nMQeWO"
},
"search_parameters": {
"engine": "reddit_subreddit",
"subreddit": "programming",
"sort_by": "top",
"time_period": "any_time",
"next_page_token": "dDNfcTNzbWZy"
},
"posts": [
{
"position": 1,
"id": "t3_4caow0",
"title": "Yesterday, I used glitches to inject the source code for Flappy Bird into Super Mario World on SNES. Here’s how.",
"link": "https://www.reddit.com/r/programming/comments/4caow0/yesterday_i_used_glitches_to_inject_the_source/",
"type": "link",
"author": {
"username": "SethBling",
"id": "t2_4gzmb",
"link": "https://www.reddit.com/user/SethBling/"
},
"subreddit": {
"name": "programming",
"id": "t5_2fwo",
"link": "https://www.reddit.com/r/programming/"
},
"score": 10799,
"upvote_ratio": 0.9087116564417178,
"comments": 545,
"external_link": "https://www.youtube.com/watch?v=hB6eY73sLV0",
"domain": "youtube.com",
"iso_date": "2016-03-28T15:47:00Z"
},
"..."
],
"pagination": {
"next_page_token": "dDNfMTFnd3lweQ=="
}
}