jcrabapple/hermes-skills/praw-subreddit-listings
Claude Code and agent skill by jcrabapple/hermes-skills
- community
Checking that the SKILL.md file is still in the repository.
List and search subreddits via PRAW's Subreddits class.
Install
npx vskill@latest install jcrabapple/hermes-skills/praw-subreddit-listingsSKILL.md
The same SKILL.md was published earlier as jcrabapple/hermes-skills/praw-subreddit-listings.
PRAW Subreddit Listings
Access the praw.models.Subreddits Listing class — the collection-level API for enumerating and searching subreddits through a praw.Reddit instance (reddit.subreddits). Covers the 10 documented members of the class: default, new, popular, premium, recommended, search, search_by_name, stream, parse, __init__. Does NOT cover the per-subreddit Subreddit model class (that is a separate docs page), moderation, flair, or the reddit.subreddit page. Source: PRAW 8.0.2 docs, code_overview/reddit/subreddits.html.
When to Use
- Enumerate default / new / popular / premium subreddit lists
- Full-text search of subreddits by title or description
- Find subreddits whose names start with a prefix (name lookup, not text search)
- Get "similar subreddits" recommendations for a set of subreddits
- Stream newly-created subreddits in near-real-time
- Any task needing a listing of subreddits (not content inside one subreddit)
Prerequisites
prawinstalled:pip install praw(PRAW 8.x, docs are 8.0.2)- A
praw.Redditinstance with valid credentials. Read-only listing endpoints work with script-type app credentials (client_id,client_secret,user_agent). Setup: see Installing PRAW (https://praw.readthedocs.io/en/stable/getting_started/installation.html) and Authenticating via OAuth (https://praw.readthedocs.io/en/stable/getting_started/authentication.html). All methods below are invoked on that instance'sreddit.subredditsattribute. - Reddit API rate limits apply (see https://praw.readthedocs.io/en/stable/getting_started/ratelimits.html).
How to Run
Invoke through the terminal tool, e.g. write a script with write_file then run python script.py. The class is praw.models.Subreddits; you never construct it directly — you use the reddit.subreddits attribute of a configured Reddit instance.
Quick Reference
| Method | Signature | Returns | |
|---|---|---|---|
default() | default(**generator_kwargs) | Iterator[Subreddit] | |
new() | new(**generator_kwargs) | Iterator[Subreddit] | |
popular() | popular(**generator_kwargs) | Iterator[Subreddit] | |
premium() | premium(**generator_kwargs) | Iterator[Subreddit] | |
recommended() | recommended(subreddits, omit_subreddits=None) | list[Subreddit] | |
search() | search(query, **generator_kwargs) | Iterator[Subreddit] | |
search_by_name() | search_by_name(query, *, exact=False, include_nsfw=True) | list[Subreddit] | |
stream() | stream(**stream_options) | Iterator[Subreddit] | |
parse() | parse(data, reddit) (classmethod) | PRAWBase instance |
Procedure
- Configure a
Redditinstance (see Prerequisites). All listings hang offreddit.subreddits. - Pick the listing method for the task:
- Predefined lists: iterate
reddit.subreddits.default(),.new(),.popular(), or.premium(). Each returns a lazily-evaluatedListingGenerator; you must iterate it to trigger requests. - Text search:
reddit.subreddits.search("query")— matches subreddits by BOTH title and description. Use for topical discovery. - Name lookup:
reddit.subreddits.search_by_name("ask", exact=False, include_nsfw=True)— finds subreddits whose names BEGIN with the query string.exact=Truereturns only exact name matches;include_nsfw=Falseexcludes NSFW-labeled subreddits. Returns a plainlist, not a generator. - Recommendations:
reddit.subreddits.recommended(["python", "learnpython"], omit_subreddits=["learnprogramming"])— accepts subreddit names and/orSubredditinstances in both args; returns alist. - Streaming:
reddit.subreddits.stream()— yields new subreddits as created, oldest first, seeding with up to 100 historical subreddits on start.
- Handle results. Listing methods yield
Subredditobjects, so access attributes like.display_name,.subscribers, etc. (see the Subreddit model docs page for the full attribute list — not covered here). - Control pagination by passing
generator_kwargs(e.g. page size) to the listing methods; these are forwarded verbatim toListingGeneratorinitialization (https://praw.readthedocs.io/en/stable/code_overview/other/listinggenerator.html).stream()'s kwargs are forwarded tostream_generator()inpraw.models.util(https://praw.readthedocs.io/en/stable/code_overview/other/util.html#praw.models.util.stream_generator).
Pitfalls
search()andsearch_by_name()are NOT interchangeable:searchdoes full-text over title+description;search_by_namedoes name-prefix matching only. Picking the wrong one returns empty or irrelevant results.search_by_name()andrecommended()return plain Pythonlists. Do not pass paginationgenerator_kwargsto them — they accept none (keyword-onlyexact/include_nsfwonsearch_by_name) and extra kwargs raiseTypeError.recommended()'somit_subredditsexclusion "may not work as expected" per the docs — Reddit's endpoint is unreliable about honoring exclusions. Filter client-side if exclusion is critical.stream()starts by replaying up to 100 historical subreddits (oldest first) before live items — dedupe if you only want new creations.- All listing methods are lazy iterators; nothing is fetched until you iterate. A bare call like
reddit.subreddits.popular()with no loop does nothing. parse()is a classmethod returning aPRAWBaseinstance from raw dict data — only reach for it when constructing from cached/stored JSON, not for normal use.
Verification
A script that proves the skill end-to-end with one network hit:
Expect ask (or the exact-name subreddit you queried) printed. If creds are unavailable, syntax-check instead: python -m py_compile script.py.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsocial-media/praw-subreddit-listings/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jcrabapple/hermes-skills/praw-subreddit-listings)