Install
openclaw skills install @lycici/keyapi-reddit-user-analysisDiscover and analyze Reddit users and subreddits — retrieve user profiles, active communities, public trophies, subreddit rules, settings, post channels, and perform dynamic search with typeahead suggestions and trending search intelligence.
openclaw skills install @lycici/keyapi-reddit-user-analysisDiscover and analyze Reddit users and subreddits — from user profiles and community activity to subreddit governance, search intelligence, and trending topic discovery.
This skill provides comprehensive Reddit user and community intelligence using the KeyAPI MCP service. It enables retrieval of user profiles, active subreddit memberships, public trophies, subreddit rules and style, post channels, settings, mute status, and powerful search capabilities including typeahead suggestions, dynamic multi-type search, and trending search topics — all through a unified, cache-first workflow.
Use this skill when you need to:
| Requirement | Details |
|---|---|
| KEYAPI_TOKEN | A valid API token from keyapi.ai. Register at the site to obtain your free token. Set it as an environment variable: export KEYAPI_TOKEN=your_token_here |
| Node.js | v18 or higher |
| Dependencies | Run npm install in the skill directory to install @modelcontextprotocol/sdk |
All tool calls in this skill target the KeyAPI Reddit MCP server:
Server URL : https://mcp.keyapi.ai/reddit/mcp
Auth Header: Authorization: Bearer $KEYAPI_TOKEN
Setup (one-time):
# 1. Install dependencies
npm install
# 2. Set your API token (get one free at https://keyapi.ai/)
export KEYAPI_TOKEN=your_token_here
# 3. List all available tools to verify the connection
node scripts/run.js --platform reddit --list-tools
| User Need | Node(s) | Best For |
|---|---|---|
| User profile, karma, account age | fetch_reddit_app_user_profile | User identity research, credibility assessment |
| Most active subreddits for a user | fetch_users_active_subreddits | Community affiliation mapping, interest profiling |
| User's public trophies and achievements | fetch_user_public_trophies | Account reputation, milestone tracking |
| Subreddit rules and style info | fetch_reddit_app_subreddit_rules_and_style_info | Community governance research, moderation policy |
| Subreddit post channels / content categories | fetch_reddit_app_subreddit_post_channels | Content taxonomy, channel structure |
| Subreddit general info and metadata | fetch_reddit_app_subreddit_info | Community overview, subscriber count, description |
| Subreddit settings and moderation config | fetch_reddit_app_subreddit_settings | Admin/moderation research, policy analysis |
| Check if a subreddit is muted | check_if_subreddit_is_muted | Mute status verification |
| Search autocomplete suggestions | fetch_reddit_app_search_typeahead_suggestions | Query refinement, subreddit/user discovery |
| Dynamic multi-type search | fetch_reddit_app_dynamic_search_results | Posts, communities, comments, media, user search |
| Platform-wide trending searches | fetch_reddit_app_trending_searches | Trend intelligence, topic monitoring |
Clarify the research objective and map it to one or more nodes. Typical entry points:
fetch_reddit_app_user_profile → fetch_users_active_subreddits → fetch_user_public_trophies.fetch_reddit_app_subreddit_info → fetch_reddit_app_subreddit_rules_and_style_info → fetch_reddit_app_subreddit_post_channels.fetch_reddit_app_search_typeahead_suggestions to refine query, then fetch_reddit_app_dynamic_search_results for full results.fetch_reddit_app_trending_searches (no parameters required).Subreddit Identifier:
subreddit_namevs.subreddit_idTwo different identifiers are used across subreddit endpoints:
subreddit_name— the display name (e.g.,technology,worldnews). Used byfetch_reddit_app_subreddit_rules_and_style_info,fetch_reddit_app_subreddit_post_channels,fetch_reddit_app_subreddit_info.subreddit_id— the internal ID with at5_prefix (e.g.,t5_2qh0u). Required byfetch_reddit_app_subreddit_settings,check_if_subreddit_is_muted,fetch_reddit_app_community_highlights.Call
fetch_reddit_app_subreddit_infowithsubreddit_namefirst to obtain thesubreddit_idwhen needed.
fetch_reddit_app_trending_searchesThis endpoint requires no parameters. Call it directly to retrieve the current list of trending search topics across Reddit.
need_formatParameterMost endpoints accept an optional
need_formatboolean. Set totruefor sanitized/cleaned response data. Defaults tofalse.
Before calling any node, inspect its input schema to confirm required parameters and available options:
node scripts/run.js --platform reddit --schema <tool_name>
# Examples
node scripts/run.js --platform reddit --schema fetch_reddit_app_user_profile
node scripts/run.js --platform reddit --schema fetch_reddit_app_dynamic_search_results
Execute tool calls and persist responses to the local cache to avoid redundant API calls.
Calling a tool:
# Single call with pretty output
node scripts/run.js --platform reddit --tool <tool_name> \
--params '<json_args>' --pretty
# Force fresh data, skip cache
node scripts/run.js --platform reddit --tool <tool_name> \
--params '<json_args>' --no-cache --pretty
Example — get user profile:
node scripts/run.js --platform reddit --tool fetch_reddit_app_user_profile \
--params '{"username":"spez"}' --pretty
Example — get user's active subreddits:
node scripts/run.js --platform reddit --tool fetch_users_active_subreddits \
--params '{"username":"spez"}' --pretty
Example — get subreddit post channels (with sort and range):
node scripts/run.js --platform reddit --tool fetch_reddit_app_subreddit_post_channels \
--params '{"subreddit_name":"technology","sort":"HOT","range":"DAY"}' --pretty
Example — get subreddit settings (requires t5_ prefixed subreddit_id):
node scripts/run.js --platform reddit --tool fetch_reddit_app_subreddit_settings \
--params '{"subreddit_id":"t5_2qh0u"}' --pretty
Example — get subreddit info:
node scripts/run.js --platform reddit --tool fetch_reddit_app_subreddit_info \
--params '{"subreddit_name":"technology"}' --pretty
Example — dynamic search for posts:
node scripts/run.js --platform reddit --tool fetch_reddit_app_dynamic_search_results \
--params '{"query":"AI regulation","search_type":"post","sort":"RELEVANCE","time_range":"month"}' --pretty
Example — get trending searches (no params):
node scripts/run.js --platform reddit --tool fetch_reddit_app_trending_searches \
--params '{}' --pretty
fetch_reddit_app_dynamic_search_results options:
| Parameter | Options | Description |
|---|---|---|
search_type | post, community, comment, media, user | Type of content to search (singular form) |
sort | RELEVANCE, HOT, TOP, NEW, COMMENTS | Sort order (uppercase) |
time_range | all, hour, day, week, month, year | Time filter |
safe_search | "unset", "on", "off" | Safe search setting (string, not boolean) |
allow_nsfw | "0" (exclude), "1" (include) | NSFW content filter (string, not boolean) |
after | cursor string | Pagination cursor |
Pagination:
| Endpoint | Pagination parameter | Notes |
|---|---|---|
fetch_reddit_app_dynamic_search_results | after (cursor string) | Pass cursor from previous response |
fetch_reddit_app_user_profile, fetch_users_active_subreddits, fetch_user_public_trophies | — | Single-call response |
fetch_reddit_app_subreddit_* endpoints | — | Single-call response |
fetch_reddit_app_trending_searches | — | No parameters, single-call response |
Cache directory structure:
.keyapi-cache/
└── YYYY-MM-DD/
├── fetch_reddit_app_user_profile/
│ └── {params_hash}.json
├── fetch_users_active_subreddits/
│ └── {params_hash}.json
├── fetch_user_public_trophies/
│ └── {params_hash}.json
├── fetch_reddit_app_subreddit_rules_and_style_info/
│ └── {params_hash}.json
├── fetch_reddit_app_subreddit_post_channels/
│ └── {params_hash}.json
├── fetch_reddit_app_subreddit_info/
│ └── {params_hash}.json
├── fetch_reddit_app_subreddit_settings/
│ └── {params_hash}.json
├── check_if_subreddit_is_muted/
│ └── {params_hash}.json
├── fetch_reddit_app_search_typeahead_suggestions/
│ └── {params_hash}.json
├── fetch_reddit_app_dynamic_search_results/
│ └── {params_hash}.json
└── fetch_reddit_app_trending_searches/
└── {params_hash}.json
Cache-first policy:
Before every API call, check whether a cached result already exists for the given parameters. If a valid cache file exists, load from disk and skip the API call.
After collecting all API responses, produce a structured user and community intelligence report:
For user analysis:
For subreddit research:
For search intelligence:
| Rule | Detail |
|---|---|
| Subreddit identifier | Use subreddit_name for info/rules/channels endpoints. Use subreddit_id (with t5_ prefix, e.g., t5_2qh0u) for settings/mute/highlights endpoints. Call fetch_reddit_app_subreddit_info first to resolve it from name. |
fetch_reddit_app_trending_searches | Requires no parameters. Call with empty params {}. |
need_format | Set to true for sanitized output. Defaults to false. |
| Dynamic search types | search_type options: post, community, comment, media, user (singular form). sort options: RELEVANCE, HOT, TOP, NEW, COMMENTS (uppercase). |
| Dynamic search string params | safe_search is a string ("unset", "on", "off"). allow_nsfw is a string ("0" to exclude, "1" to include). Neither is a boolean. |
fetch_reddit_app_subreddit_post_channels | Accepts a range param (default: DAY) in addition to sort. Valid range values: HOUR, DAY, WEEK, MONTH, YEAR, ALL. |
fetch_user_comments page_size | Supports page_size (integer, default 25) to control how many comments are returned per page. |
| Success check | code = 0 → success. Any other value → failure. Always check the response code before processing data. |
| Retry on 500 | If code = 500, retry the identical request up to 3 times with a 2–3 second pause between attempts before reporting the error. |
| Cache first | Always check the local .keyapi-cache/ directory before issuing a live API call. |
| Code | Meaning | Action |
|---|---|---|
0 | Success | Continue workflow normally |
400 | Bad request — invalid or missing parameters | Validate input; ensure correct identifier type (subreddit_name vs. subreddit_id) |
401 | Unauthorized — token missing or expired | Confirm KEYAPI_TOKEN is set correctly; visit keyapi.ai to renew |
403 | Forbidden — plan quota exceeded or feature restricted | Review plan limits at keyapi.ai |
404 | Resource not found — user or subreddit may not exist or be banned | Verify the username or subreddit name; banned/private subreddits may return no data |
429 | Rate limit exceeded | Wait 60 seconds, then retry |
500 | Internal server error | Retry up to 3 times with a 2–3 second pause; if it persists, log the full request and response and skip this node |
| Other non-0 | Unexpected error | Log the full response body and surface the error message to the user |