Find subreddits by keyword
Search for subreddits matching a keyword. Returns community names, descriptions, URLs, metadata text, and NSFW status.
/search-communities Search https://api.fetchlayer.dev/reddit/search-communities Headers
Authorization string required Bearer token — your FetchLayer API key.
Parameters
query string required Search keyword.
limit integer optional Max results. (default: 25)
pages integer optional How many pages of results to return, at most. Each page holds 10 results. If omitted, results continue until `limit` is reached (or the 45s time budget ends, returning partial results with `incompleteReason: "scrape_timeout"`), billed as `ceil(items returned / 10)`. If passed, results are capped at that many pages and billed per page actually returned (see `pagesScraped` in the response).
after string optional Continue where a previous response stopped: pass its nextCursor. Use the same query.
Response Fields
search-communities
Find subreddits by keyword
requestedUrl string The Reddit URL the request was for.
finalUrl string Final URL after redirects.
listingType string Always search-communities for a successful response.
query string Community search query.
items[].subreddit string | null Subreddit name without the r/ prefix.
items[].subredditPrefixed string | null Subreddit name with the r/ prefix.
items[].title string | null Community display title.
items[].descriptionText string Plain-text community description.
items[].descriptionHtml string | null HTML community description when available.
items[].url string | null Absolute subreddit URL.
items[].metaText string | null Metadata text displayed by Reddit.
items[].nsfw boolean Whether the community marks itself as 18+ (NSFW).
nextCursor string | null Pass as after, with the same query, to continue exactly where this response stopped; null at the end.
listingTitle string | null Display title of the listing, or null when unavailable.
itemCount number Number of entries returned in items.
nextPageUrl string | null The next page’s address, or null at the end. On endpoints that take `after` it is an api.fetchlayer.dev address: POST it with your key to get the next page (a body is optional; fields you send override the address), or pass its `after` parameter as `after`.
prevPageUrl string | null The previous page’s address (its `before` parameter is the cursor), or null.
pagesRequested number Number of pages requested.
pagesScraped number Pages of results returned. This is what the request is billed at: 1 credit per page actually returned, never per page requested.
scrapedAt string ISO 8601 time the result was produced.
transport string The data source: always the platform id, "reddit".
Request
curl -X POST "https://api.fetchlayer.dev/reddit/search-communities" \
-H "Authorization: Bearer ss-your-key" \
-H "Content-Type: application/json" \
-d '{"query":"programming","limit":5}'Response
{
"listingType": "search-communities",
"query": "programming",
"items": [
{
"subreddit": "programming",
"subredditPrefixed": "r/programming",
"title": "Programming",
"descriptionText": "Computer Programming",
"url": "https://www.reddit.com/r/programming/",
"metaText": "Programming community",
"nsfw": false
}
],
"itemCount": 1,
"pagesRequested": 1,
"pagesScraped": 1,
"transport": "reddit"
}