A moderator gets a report on a new commenter. Is it a long-time member who had a bad day, or an account made last week to push a link? Answering that by hand means opening the profile, scrolling two tabs, and guessing at patterns.
This guide builds a small Python tool that does that first pass for you. It pulls a public user's karma, account age and recent posts and comments from the SteadyAPI Reddit API, then summarizes where they post, when they post, and whether anything looks off. It works for moderation, research, and community tools.
Prerequisites
- A SteadyAPI API key from steadyapi.com. The Free plan works, but read the cost section first.
- Python 3.8+ with
requests.
Two endpoints cover a profile
You need two calls. Both take the Reddit username without the u/ prefix.
GET /v1/reddit/user-stats (weight 1) returns the account summary in body: total_karma, link_karma, comment_karma, created_utc, is_gold, is_mod and verified, plus a nested profile object with the avatar and banner.
GET /v1/reddit/user-data (weight 2) returns the user's public activity. The filter parameter picks posts or comments. Leave it out and you get both in one list. sortType is new, hot or top. Each page holds up to 25 items, and meta.cursor is the value to send back as cursor for the next page.
The items are Reddit's own objects, with many fields. These are the ones this guide uses:
- Posts:
title,subreddit,score,num_comments,created_utc,domain,is_self,permalink. - Comments:
body,subreddit,score,created_utc,link_title,link_permalink,parent_id.
A trimmed response from user-stats looks like this:
{
"meta": { "version": "v1.0", "status": 200, "username": "spez" },
"body": {
"name": "spez",
"total_karma": 941413,
"link_karma": 184789,
"comment_karma": 756624,
"created_utc": 1118030400,
"is_gold": true,
"is_mod": true,
"verified": true
}
}
The analyzer
The script fetches the summary, pages through up to four pages of posts and four of comments, and prints a short report. It also checks a few signals a moderator would look at first.
import os
import sys
import time
from collections import Counter
from datetime import datetime, timezone
import requests
BASE = "https://api.steadyapi.com"
API = f"{BASE}/v1/reddit"
HEADERS = {"Authorization": f"Bearer {os.environ['STEADYAPI_KEY']}"}
def call(path, **params):
for attempt in range(3):
r = requests.get(f"{API}/{path}", headers=HEADERS, params=params, timeout=60)
if r.status_code in (429, 500, 502, 503):
time.sleep(2 ** attempt)
continue
r.raise_for_status()
data = r.json()
if data.get("success") is False:
raise ValueError(data["message"])
return data
raise RuntimeError(f"{path} failed after retries")
def history(username, kind, pages=4):
"""Yield items for one content type ('posts' or 'comments'), newest first."""
cursor = None
for _ in range(pages):
params = {"username": username, "filter": kind, "sortType": "new"}
if cursor:
params["cursor"] = cursor
try:
data = call("user-data", **params)
except ValueError:
if cursor is None:
raise # the first page failing means a bad username
break # a deeper page can come back as an error instead of an empty list
yield from data["body"]
cursor = data["meta"]["cursor"]
if not cursor:
break
def review_flags(stats, age_days, posts):
"""Cheap signals a moderator can check before opening the full history."""
flags = []
if age_days < 30:
flags.append("account is under 30 days old")
if stats["total_karma"] < 50:
flags.append("total karma is under 50")
# i.redd.it and reddit.com are Reddit's own hosts, not outside links.
domains = Counter(p["domain"] for p in posts if not p["domain"].endswith(("reddit.com", "redd.it")))
if posts and domains:
domain, count = domains.most_common(1)[0]
if count / len(posts) >= 0.6:
flags.append(f"{count} of {len(posts)} posts link to {domain}")
return flags
def analyze(username):
stats = call("user-stats", username=username)["body"]
posts = list(history(username, "posts"))
comments = list(history(username, "comments"))
items = posts + comments
created = datetime.fromtimestamp(stats["created_utc"], timezone.utc)
age_days = (datetime.now(timezone.utc) - created).days
hours = Counter(datetime.fromtimestamp(i["created_utc"], timezone.utc).hour for i in items)
subs = Counter(i["subreddit"] for i in items)
best = max(comments, key=lambda c: c["score"], default=None)
print(f"u/{username} account age: {age_days} days")
print(f"karma: {stats['total_karma']:,} (posts {stats['link_karma']:,}, comments {stats['comment_karma']:,})")
print(f"sampled: {len(posts)} posts, {len(comments)} comments")
print("top communities:", ", ".join(f"{s} ({n})" for s, n in subs.most_common(5)))
print("most active UTC hours:", ", ".join(f"{h:02d}:00 ({n})" for h, n in hours.most_common(3)))
if posts:
print(f"average post score: {sum(p['score'] for p in posts) / len(posts):.0f}")
if best:
print(f"best sampled comment: {best['score']:,} points in r/{best['subreddit']}")
print("flags:", "; ".join(review_flags(stats, age_days, posts)) or "none")
if __name__ == "__main__":
analyze(sys.argv[1] if len(sys.argv) > 1 else "spez")
Run it with STEADYAPI_KEY=your_key python analyze.py spez. This is real output from a test run:
u/spez account age: 7828 days
karma: 941,413 (posts 184,789, comments 756,624)
sampled: 24 posts, 100 comments
top communities: RDDT (42), u_spez (40), redditstock (31), modnews (4), ModSupport (4)
most active UTC hours: 23:00 (24), 22:00 (22), 16:00 (15)
average post score: 2577
best sampled comment: 290 points in r/redditstock
flags: none
Read the result carefully
The numbers describe a sample, not a lifetime. The script looks at the newest 100 comments and up to 100 posts, so "most active hours" means most active recently. Raise pages for a deeper look, and expect each page to cost 2 requests.
The flags are prompts for a human, not verdicts. A new account with low karma is often just new. While testing, the link check first flagged a normal user because many image posts have the domain i.redd.it or reddit.com. Those are Reddit's own hosts, so the script ignores them. Check your own flags against a few accounts you know before you act on them.
Things that behave in ways you should plan for
- A missing user is a 200. An unknown or suspended username returns HTTP 200 with
"success": falseandUser not found or invalid username.Checksuccess, not only the status code. - Deep pages can fail. When I paged deep into one account's history, a later page returned
Please enter a valid subReddit URL.instead of an empty list. Thehistoryfunction stops quietly when that happens after page one. newwas the steadiest sort. In my tests,hotandtopsometimes returned that same error for a user and worked on another attempt. If you need them, retry once.- Posts and comments have different shapes. Without a
filter, one list holds both. Tell them apart by thenameprefix:t3_for posts andt1_for comments. - Responses are cached for about 15 minutes. Running the same profile twice in a row returns the same data and is fast.
Cost and rate limits
One full run above costs about 11 requests: 1 for the summary, 2 for one page of posts, and 8 for four pages of comments. The Free plan's 500 requests a month covers about 45 profiles. The Starter plan ($14.99/mo, 10,000 requests) covers roughly 900 profiles. The standard limit is 10 requests per second per account, and only HTTP 200 responses count toward your quota, so a 422 does not cost you.
Store results by username and re-check an account only when it acts again, not every time it is reported.
Bonus: look up a user by asking
If you use Claude Code, Cursor, VS Code, or any MCP client, you can connect it to https://api.steadyapi.com/mcp with your API key. Then you can ask for a user's karma and recent posts in plain English before you write any code.
Conclusion
You pulled an account summary and a user's recent posts and comments, summarized where and when they are active, and added a few flags for a moderator to review. Two endpoints and about 80 lines of Python are enough for a first-pass check.
Create a free account at steadyapi.com (no card required) and run the script on a username you know. The API documentation lists every Reddit parameter with ready-made examples in cURL, JavaScript, PHP, and Python.