GET /user/subreddits

User Subreddits

Communities a Reddit account is active in. Reddit Scraper API endpoint /user/subreddits: parameters, JSON response fields and code examples.

The communities an account is active in (up to 95), as shown on its profile: id, name, title, description, members, NSFW flag and icon; accounts that hide the list answer visibility: hidden. Give username or user_id. For the communities the account moderates use /user/moderated-subreddits (same input, same community card). Billed 1 request per call.

HTTP Request

GET /user/subreddits

Cost (in requests): 1. Every successful answer reports its cost in data.billed_requests.

Parameters

ParameterTypeRequiredDefaultDescription
usernamestringNo-Reddit username, with or without u/ (case-insensitive). Give this or user_id.
user_idstringNo-Reddit account id (t2_…). Alternative to username.

Response

Real response to GET /user/subreddits?username=spez (arrays trimmed to 2 items, long texts cut with …).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "status": true,
  "request_id": "a6dfe71e-30db-ad5f-90cf-1f840204",
  "data": {
    "visibility": "hidden",
    "items": [],
    "billed_requests": 1
  },
  "request_params": {
    "username": "spez"
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue when the request succeeded
request_idstringUnique request identifier
dataobjectActive communities; null with error.code = not_found.
data.visibilitystringhidden when the user hides the list; visible otherwise (may be empty).
data.itemsarrayCommunities the user is active in (up to 95), largest first (subscribers, then name). The order is ours: Reddit returns them in a different order on each call.
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).
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, suspended, deleted. 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
import requests

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

params = {
    "username": "spez",
}

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"]

print(data["visibility"])
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/user/subreddits";

const params = new URLSearchParams({
  username: "spez",
});

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();
console.log(data.visibility);
1
2
3
4
curl -G "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/user/subreddits" \
  --data-urlencode "username=spez" \
  -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