Popular Subreddits API
List Reddit's most popular subreddits or the newest communities, with member counts, descriptions, and icons. JSON, $0.01 per call.
/v1/reddit/popular-subredditsReturns Reddit's directory of popular communities, or newly created ones with type: "new". Each result has the same fields as Search Subreddits; call Subreddit Info for the full profile.
Usage
const res = await fetch('https://api.yepapi.com/v1/reddit/popular-subreddits', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({"type": "popular"}),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/reddit/popular-subreddits \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type": "popular"}'import requests
res = requests.post(
"https://api.yepapi.com/v1/reddit/popular-subreddits",
headers={"x-api-key": "YOUR_API_KEY"},
json={"type": "popular"},
)
print(res.json()["data"])Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
type | string | No | One of: popular, new | popular |
cursor | string | No | cursor from the previous response, to fetch the next page | — |
Response
{
"ok": true,
"data": {
"cursor": "t5_2cneq",
"subreddits": [
{
"active_users": null,
"banner": null,
"created_at": "2009-01-25T02:25:57+00:00",
"created_utc": 1232850357,
"description": null,
"icon": null,
"id": "2qs0k",
"lang": "en",
"name": "Home",
"over_18": false,
"subscribers": 435022,
"title": "Home",
"type": "public",
"url": "https://www.reddit.com/r/Home/"
},
{
"active_users": null,
"banner": "https://styles.redditmedia.com/t5_2qh1i/styles/bannerBackgroundImage_fs33xogq946f1.png?width=4000&s=460f7387ea96fb4707fad8acaa81643df40f19a9",
"created_at": "2008-01-25T03:52:15+00:00",
"created_utc": 1201233135,
"description": "r/AskReddit is the place to ask and answer thought-provoking questions.",
"icon": "https://styles.redditmedia.com/t5_2qh1i/styles/communityIcon_p6kb2m6b185b1.png?width=256&s=c28b9f038c305e139b62739f2133d7b776582696",
"id": "2qh1i",
"lang": "es",
"name": "AskReddit",
"over_18": false,
"subscribers": 60021127,
"title": "Ask Reddit...",
"type": "public",
"url": "https://www.reddit.com/r/AskReddit/"
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.subreddits | object[] | Subreddits |
data.subreddits[].id | string | null | Subreddit ID |
data.subreddits[].name | string | Subreddit name without r/ |
data.subreddits[].title | string | null | Subreddit title |
data.subreddits[].description | string | null | Public description |
data.subreddits[].subscribers | number | null | Member count |
data.subreddits[].active_users | number | null | Users online, when Reddit reports it |
data.subreddits[].created_utc | number | null | Unix timestamp (seconds) |
data.subreddits[].created_at | string | null | ISO 8601 timestamp |
data.subreddits[].over_18 | boolean | Marked NSFW |
data.subreddits[].type | string | null | public, restricted, private, … |
data.subreddits[].lang | string | null | Language code |
data.subreddits[].url | string | reddit.com URL of the subreddit |
data.subreddits[].icon | string | null | Community icon URL |
data.subreddits[].banner | string | null | Banner image URL |
data.cursor | string | null | Cursor for the next page |
Pagination
Each response includes a cursor. Send the same request again with that value in cursor to get the next page. When cursor is null, there are no more results. A query with no matches returns 200 with an empty list and cursor: null. Every page is a separate $0.01 call.
Caching
Responses are cached for 1 hour.
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION_ERROR | type is not popular or new |
429 | RATE_LIMITED_UPSTREAM | Too many requests in a short burst — retry after a few seconds |
502 | UPSTREAM_ERROR | Temporary problem fetching data from Reddit — retry |
Failed calls are not charged.
Related Endpoints
- Reddit Popular Posts API — trending posts on r/popular
- Similar Subreddits — communities related to one subreddit
Reddit Popular Posts API
Reddit Popular Posts API — get the posts trending on r/popular, worldwide or for one country, sorted by hot, new, top, or rising. JSON, $0.01 per call.
Twitter Search API (X Search API)
Twitter Search API (X Search API) — search tweets with every X search operator, or search accounts. Top, latest, people, or media results as JSON for $0.01 per call.