Login
Log in to Reddit with username and password — returns all session cookies needed for /api/reddit/comment. Runs in headless Chromium, handles reCAPTCHA auto.
/api/reddit/loginLog in to Reddit with username + password, get back all cookies needed for /api/reddit/comment.
Runs inside the browser pool. Handles reCAPTCHA automatically via 2captcha when Reddit triggers it (env TWOCAPTCHA_API_KEY).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Reddit username or email |
password | string | Yes | Account password |
proxy | object | No | Sticky IP for the account — {server, username, password}. Recommended to match the proxy used for /comment. |
{
"username": "CalmOrganization7179",
"password": "...",
"proxy": {
"server": "http://host:port",
"username": "...",
"password": "..."
}
}Response (200)
{
"success": true,
"username": "CalmOrganization7179",
"link_karma": 1,
"comment_karma": 315,
"cookies": {
"reddit_session": "...",
"loid": "...",
"token_v2": "...",
"csrf_token": "...",
"edgebucket": "...",
"csv": "2",
"session_tracker": "..."
},
"timing": { "total": 11641, "nav": 2616, "fill": 463, "submit": 8026 }
}Failure returns 401 with success: false + diagnostic error message + page_url + page_text_sample.
Notes
- Flow:
/loginonce → get cookies → paste into/commentas flat top-level fields. Cookies last ~7 days. - Limits: no TOTP/2FA yet (accounts with 2FA fail at the prompt).
Example
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"username":"CalmOrganization7179","password":"NM$Y<Z;R2)zw4#i"}' \
"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: "CalmOrganization7179",
password: "NM$Y<Z;R2)zw4#i",
}),
});import requests
response = requests.post(
"https://api.redditapis.com/api/reddit/login",
json={"username": "CalmOrganization7179", "password": "NM$Y<Z;R2)zw4#i"},
headers={"Authorization": "Bearer TOKEN"},
)User Comments
Fetch a Reddit user's recent comments by username — sorted by new, top, or controversial. Includes comment body, score, subreddit, and cursor pagination.
CommentHot
Post a comment on any Reddit thread programmatically. Runs inside headless Chromium and handles reCAPTCHA, CSRF tokens, and rich-text encoding automatically.