GET /subreddit/batch

Subreddit Batch

Look up to 50 communities in one request. Reddit Scraper API endpoint /subreddit/batch: parameters, JSON response fields and code examples.

Basics for up to 50 communities at once, in the order sent: id, name, description, icon, colours, NSFW flag, subscribers and weekly visitors / contributions; unknown ones come back with exists: false and in missing_subreddits. with_details=true (at most 20 communities) adds the /subreddit/details fields: rules, sidebar widgets, menu links, flair settings, banner, created time, type and apps. Billed 1 request per community found (minimum 1), +3 per community detailed with with_details=true.

HTTP Request

GET /subreddit/batch

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

Parameters

ParameterTypeRequiredDefaultDescription
subredditsstringYes-Community names (with or without r/) or t5_ ids, 1–50 (1–20 with with_details). Comma-separated, duplicates removed, request order kept in the answer.
with_detailsbooleanNofalseAdds the /subreddit/details fields per community (left out without it): title, type, is_quarantined, banner_url, key_color, background_color, created_at, state, topics, related_subreddits, flair_settings, is_chat_enabled, rules, widgets, menu_links, devvit_apps. Caps the batch at 20 communities. Billed: +3 per community detailed.

Response

Real response to GET /subreddit/batch?subreddits=python,django (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
{
  "status": true,
  "request_id": "814503d7-11e3-6f77-8d9c-c2759233",
  "data": {
    "requested_count": 2,
    "found_count": 2,
    "truncated": false,
    "not_attempted": [],
    "missing_subreddits": [],
    "billed_requests": 2,
    "items": [
      {
        "input": "python",
        "exists": true,
        "name": "Python",
        "subreddit_id": "t5_2qh0y",
        "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 Python use r/LearnPython",
        "subscribers_count": 1524296,
        "weekly_visitors": 89865,
        "weekly_contributions": 568,
        "is_nsfw": false,
        "icon_url": "https://styles.redditmedia.com/t5_2qh0y/styles/communityIcon_lctik80p96tg1.png?width=64&frame=1&auto=webp&s=92baaacc951d52b5071629852df033d53cafa5ec",
        "primary_color": "#FFCC00"
      },
      {
        "input": "django",
        "exists": true,
        "name": "django",
        "subreddit_id": "t5_2qh4v",
        "description": "News and links for the Django community.",
        "subscribers_count": 167330,
        "weekly_visitors": 13393,
        "weekly_contributions": 99,
        "is_nsfw": false,
        "icon_url": "https://styles.redditmedia.com/t5_2qh4v/styles/communityIcon_ghr9nki9z3je1.png?width=64&frame=1&auto=webp&s=6897d08c6be30fc8c13e0464d96137bc0bdf715b",
        "primary_color": "#092E20"
      }
    ]
  },
  "request_params": {
    "subreddits": "python,django"
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue when the request succeeded
request_idstringUnique request identifier
dataobjectBatch result.
data.requested_countintegerCommunities requested after de-duplication.
data.found_countintegerCommunities found; the billing unit.
data.truncatedbooleanTrue when the request ran out of time before every community was looked up; the rest are not looked up, not billed, and listed in not_attempted (rows with exists: null). Send them again in a new request.
data.not_attemptedarrayRequested communities that were not looked up in time (not billed: send them again; empty unless truncated).
data.missing_subredditsarrayRequested communities that do not exist.
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).
data.itemsarray of objectsOne row per requested community, in request order (unknown ones are rows with exists: false).
data.items[].inputstringCommunity as requested.
data.items[].existsbooleanThe community exists (false for unknown names, and banned or private ones may also come back false: /subreddit/details tells a community’s state, and so does state with with_details=true; null when it was not looked up in time, see not_attempted, or, with with_details=true, when its details could not be read: send it again).
data.items[].namestringSubreddit name without r/.
data.items[].subreddit_idstringSubreddit id (t5_…).
data.items[].descriptionstringPublic description.
data.items[].subscribers_countintegerSubscribers (members).
data.items[].weekly_visitorsintegerWeekly visitors (Reddit’s periodic count, not live).
data.items[].weekly_contributionsintegerWeekly posts + comments (Reddit’s periodic count, not live).
data.items[].is_nsfwbooleanMarked 18+.
data.items[].icon_urlstringCommunity icon URL.
data.items[].primary_colorstringCommunity primary colour (hex).
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
200 with status: falseItem not availableerror.code is not_found, banned, private, quarantined. data is null. Billed 1 request
503Reddit temporarily unreachable"error": "Service temporarily unavailable". Not billed, retry later

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import requests

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

params = {
    "subreddits": "python,django",
}

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["items"]:
    print(item["name"])
print("Billed requests:", data["billed_requests"])
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
const url = "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/subreddit/batch";

const params = new URLSearchParams({
  subreddits: "python,django",
});

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.items.forEach((item) => console.log(item.name));
1
2
3
4
curl -G "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/subreddit/batch" \
  --data-urlencode "subreddits=python,django" \
  -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