Reddit API Login - Username and Password Authentication Endpoint
Reddit API login endpoint - authenticate to Reddit with username and password (plus optional 2FA TOTP) and get the full set of session cookies for /comment, /vote, and /dm calls.
/api/reddit/login$0.012 / callLog in to Reddit with username + password. Returns the session cookies you need to paste into /comment, /vote, and /dm.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Reddit username or email |
password | string | Yes | Account password |
totp_secret | string | No | Base32 TOTP secret for accounts with 2FA enabled. The 6-digit code is generated server-side. Omit if 2FA is off. |
method | string | No | http (default) or browser. Use browser for the most compatible write-session cookies, especially when you plan to call /vote. |
proxy | object | No | Bring your own sticky IP for this account — {server, username, password}. Omit to use the default pool. |
{
"username": "your_reddit_username",
"password": "...",
"method": "browser",
"proxy": {
"server": "http://host:port",
"username": "...",
"password": "..."
}
}Response (200)
{
"success": true,
"username": "your_reddit_username",
"link_karma": 1,
"comment_karma": 315,
"cookies": {
"reddit_session": "...",
"loid": "...",
"token_v2": "...",
"csrf_token": "...",
"edgebucket": "...",
"csv": "2",
"session_tracker": "..."
}
}Failure returns success: false plus a diagnostic error message. The status code tells you whose problem it is:
| Status | Meaning | What to do |
|---|---|---|
401 | Reddit rejected the credentials — wrong password, or 2FA is enabled and no totp_secret was supplied. | Fix the credentials. Retrying as-is will fail the same way. |
502 | The upstream path failed before Reddit ruled on the credentials — anti-bot block, captcha solver unavailable, or a proxy fault. | The credentials are not implicated. Retry after a short pause. |
Notes
- Flow: call
/loginonce → get cookies → paste them as flat top-level fields into/comment,/vote, or/dm. Re-login when they expire. - Login method: omit
methodor usehttpfor the faster login flow. Usemethod: "browser"when you need maximum compatibility for write actions such as/vote. - 2FA: pass
totp_secret(the Base32 string from the QR code) when enrolling the account; the server generates the 6-digit code per request.
Example
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"username":"your_reddit_username","password":"your_password","method":"browser"}' \
"https://api.redditapis.com/api/reddit/login"const response = await fetch("https://api.redditapis.com/api/reddit/login", {
method: "POST",
headers: {
Authorization: "Bearer TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
username: "your_reddit_username",
password: "your_password",
method: "browser",
}),
});import requests
response = requests.post(
"https://api.redditapis.com/api/reddit/login",
json={
"username": "your_reddit_username",
"password": "your_password",
"method": "browser",
},
headers={"Authorization": "Bearer TOKEN"},
)Independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by Reddit, Inc.
Search Users
Search Reddit accounts by username, the People tab on reddit.com search. Returns karma totals, avatar, account age, and profile blurb, with pagination.
CommentHot
Post a comment on any Reddit thread programmatically. Handles reCAPTCHA, CSRF tokens, and rich-text encoding for you — just send post URL and text.
