YepAPI
Reddit API

Search Subreddits API

Search Reddit communities by keyword. Returns subreddit names, descriptions, icons, and URLs as JSON for $0.01 per call.

POST/v1/reddit/search-subreddits
$0.01/call

Find subreddits that match a keyword — useful for discovering where a topic is discussed before pulling posts with the Subreddit Posts API. Search results are compact: some fields (subscribers, created_at, title) can be null here. Call Subreddit Info for the full profile of a community.

Usage

const res = await fetch('https://api.yepapi.com/v1/reddit/search-subreddits', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"query": "python"}),
});
const { data } = await res.json();
console.log(data);
curl -X POST https://api.yepapi.com/v1/reddit/search-subreddits \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "python"}'
import requests

res = requests.post(
    "https://api.yepapi.com/v1/reddit/search-subreddits",
    headers={"x-api-key": "YOUR_API_KEY"},
    json={"query": "python"},
)
print(res.json()["data"])

Request Body

ParameterTypeRequiredDescriptionDefault
querystringYesSearch text (max 256 characters)—
cursorstringNocursor from the previous response, to fetch the next page—

Response

{
  "ok": true,
  "data": {
    "cursor": "eyJjYW5kaWRhdGVzX3JldHVybmVkIjoie1wic2VjdGlvbl8xX3BpcGVsaW5lXzBfZ2xvYmFsX21vZGlmaWVyc1wiOlwiMVwiLFwic2VjdGlvbl8xX3BpcGVsaW5lXzFfbG9jYWxfbW9kaWZpZXJzXCI6XCIwXCIsXCJzZWN0aW9uXzJfcGlwZWxpbmVfMF9zdWJyZWRk…",
    "subreddits": [
      {
        "active_users": null,
        "banner": null,
        "created_at": null,
        "created_utc": null,
        "description": "The largest Python community for Reddit! Stay up to date with the latest news, packages, and meta information relating to the Python programming language. \n---\n\nIf you have questions or are new to Pyt…",
        "icon": "https://styles.redditmedia.com/t5_2qh0y/styles/communityIcon_lctik80p96tg1.png?width=64&frame=1&auto=webp&s=92baaacc951d52b5071629852df033d53cafa5ec",
        "id": null,
        "lang": null,
        "name": "Python",
        "over_18": false,
        "subscribers": null,
        "title": null,
        "type": null,
        "url": "https://www.reddit.com/r/Python/"
      },
      {
        "active_users": null,
        "banner": null,
        "created_at": null,
        "created_utc": null,
        "description": "A subreddit for helping Python programmers",
        "icon": null,
        "id": null,
        "lang": null,
        "name": "pythonhelp",
        "over_18": false,
        "subscribers": null,
        "title": null,
        "type": null,
        "url": "https://www.reddit.com/r/pythonhelp/"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
data.subredditsobject[]Matching subreddits
data.subreddits[].idstring | nullSubreddit ID
data.subreddits[].namestringSubreddit name without r/
data.subreddits[].titlestring | nullSubreddit title
data.subreddits[].descriptionstring | nullPublic description
data.subreddits[].subscribersnumber | nullMember count
data.subreddits[].active_usersnumber | nullUsers online, when Reddit reports it
data.subreddits[].created_utcnumber | nullUnix timestamp (seconds)
data.subreddits[].created_atstring | nullISO 8601 timestamp
data.subreddits[].over_18booleanMarked NSFW
data.subreddits[].typestring | nullpublic, restricted, private, …
data.subreddits[].langstring | nullLanguage code
data.subreddits[].urlstringreddit.com URL of the subreddit
data.subreddits[].iconstring | nullCommunity icon URL
data.subreddits[].bannerstring | nullBanner image URL
data.cursorstring | nullCursor 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 15 minutes.

Errors

StatusCodeWhen
400VALIDATION_ERRORquery is missing or longer than 256 characters
429RATE_LIMITED_UPSTREAMToo many requests in a short burst — retry after a few seconds
502UPSTREAM_ERRORTemporary problem fetching data from Reddit — retry

Failed calls are not charged.

On this page