Reddit API Instructions

This page documents all Reddit API features integrated into this project.

1) Setup

  • Go to Settings → add at least one Reddit app account (client_id, client_secret, user_agent).
  • For authenticated actions (inbox, posting, voting, moderation), also add username + password.
  • Open Reddit API Explorer page to run any operation.
  • Open AI Center page to inspect model status, run ad-hoc analysis, and re-analyze stored posts.

2) Read features

  • Auth context: /api/reddit/auth/me, /api/reddit/auth/preferences
  • Posts: feed, search, submission detail, submission comments, single comment
  • Subreddits: search, discovery, about, rules, moderators, wiki pages/content
  • Users: public profile, submissions, comments, and authenticated saved/hidden/upvoted/downvoted
  • Inbox: all/unread/messages/sent/mentions/comment_replies + mark read/unread
  • Moderation reads: modqueue/reports/spam/unmoderated/edited/log

3) Write features

  • Send private messages
  • Submit posts (selftext or url)
  • Reply to submissions/comments
  • Edit/delete submissions and comments
  • Vote/save/unsave/hide/unhide/report
  • Subscribe/unsubscribe subreddits
  • Moderation actions: approve/remove/lock/unlock/distinguish/ignore_reports

4) Placeholders + IDs

  • Replace placeholders in paths: {submission_id}, {comment_id}, {message_id}, {fullname}, {subreddit}, {username}
  • fullname examples: t3_<submissionId> or t1_<commentId>
  • Query params support optional account_id to select a specific Reddit account

5) Common errors

  • 400: invalid payload or missing required script credentials
  • 401: Reddit credentials invalid/expired
  • 403: scope or subreddit permission missing
  • 404: resource not found or inaccessible
  • 502/503: upstream Reddit API/network issue

6) AI features

  • Provider status: /api/ai/status
  • Ad-hoc AI classification: /api/ai/analyze
  • Re-analyze single stored post: /api/ai/posts/{post_id}/reanalyze
  • Re-analyze project posts in bulk: /api/ai/projects/{project_id}/reanalyze?limit=50
  • Project posts page includes one-click 'Re-analyze AI' action

Quick examples

GET /api/reddit/posts/search?query=design%20job&subreddit=forhire&sort=new&time_filter=week&limit=25
POST /api/reddit/things/t3_xxxxxx/vote
{"account_id": 1, "direction": 1}
POST /api/reddit/moderation/submissions/xxxxxx/approve
{"account_id": 1, "spam": false, "sticky": false}