100 free credits. No credit card required. Get a key

Reddit subreddit sidebar widgets API

Every sidebar widget of a community in order: the community card with weekly visitors, rules, post flairs with their colours, bookmarks and buttons, related communities with member counts, events and text widgets.

GET /v1/reddit/subreddits/{name}/widgets1 credit per callRefunded on failure
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/reddit/subreddits/selfhosted/widgets",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
Response
200 · 1 credit
{
"items": {
"widget_id-card-32hch": {
"id": "widget_id-card-32hch",
"kind": "id-card",
"shortName": "Self-Hosters",
"textHtml": null,
"data": [
{
"text": "A place to share, discuss, discover, assist with, gain assistance for, and critique self-hosted alternatives to our favo…",
"url": null,
"descriptionHtml": null,
"backgroundColor": null,
"subscribers": 493908,
"iconUrl": null,
"when": null,
"where": null
}
]
}
},
"layout": {
"idCardWidget": "widget_id-card-32hch",
"sidebar": {
"order": []
}
}
}

Parameters

NameTypeDescription
namepath · requiredstringSubreddit name, with or without "r/". "all" and "popular" also work for posts. Example: typescript.
Response fields

200 with a SubredditWidgets, in Reddit’s own Things and Listings.

FieldTypeDescription
itemsobject
layoutobject
Status codes
StatusMeaning
200The widgets, keyed by id, and their order.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The subreddit, post or user does not exist.
429Too many requests. Wait for Retry-After seconds.
503Reddit is temporarily unavailable. Retryable; nothing was charged.

Every error has code, message, hint and retryable. All error codes

Questions

Where are the post flairs?

In the post-flair widget: each item has the flair text, its background colour and the link that filters the community by it.

Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit.