Write
Post a Reddit Comment Programmatically
Post a comment on any Reddit thread programmatically. Handles reCAPTCHA, CSRF tokens, and rich-text encoding for you — just send post URL and text.
POST
/api/reddit/comment$0.012 / callPost a comment on any Reddit post.
Request Body
Cookies are passed as flat top-level fields.
| Field | Type | Required | Description |
|---|---|---|---|
post_url | string | yes | Any reddit.com post URL |
text | string | yes | Plain text comment body |
reddit_session | string | yes | Session cookie from /api/reddit/login |
loid | string | yes | Long-lived account identifier cookie |
token_v2, csrf_token, edgebucket, csv, session_tracker, pc | string | no | Any extra Reddit cookies as top-level fields |
{
"post_url": "https://www.reddit.com/r/X/comments/.../",
"text": "your comment text",
"reddit_session": "...",
"loid": "...",
"token_v2": "...",
"csrf_token": "..."
}Success Response
{
"success": true,
"author": "your_reddit_username",
"comment_id": "t1_ohfsdj0",
"permalink": "https://www.reddit.com/r/X/comments/.../comment/ohfsdj0/",
"body": "your comment text"
}Errors
| Status | Meaning |
|---|---|
400 | Missing post_url / text or required cookies |
401 | Missing Bearer token |
403 | Invalid Bearer token |
502 | Could not post |
500 | Unexpected server error |
Example
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{
"post_url": "https://www.reddit.com/r/test/comments/xxx/title/",
"text": "hello from api",
"reddit_session": "eyJhbGc...",
"loid": "000000...",
"token_v2": "eyJhbGc...",
"csrf_token": "689ea9..."
}' \
"https://api.redditapis.com/api/reddit/comment"const response = await fetch("https://api.redditapis.com/api/reddit/comment", {
method: "POST",
headers: {
Authorization: "Bearer TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
post_url: "https://www.reddit.com/r/test/comments/xxx/title/",
text: "hello from api",
reddit_session: "eyJhbGc...",
loid: "000000...",
token_v2: "eyJhbGc...",
csrf_token: "689ea9...",
}),
});import requests
response = requests.post(
"https://api.redditapis.com/api/reddit/comment",
json={
"post_url": "https://www.reddit.com/r/test/comments/xxx/title/",
"text": "hello from api",
"reddit_session": "eyJhbGc...",
"loid": "000000...",
"token_v2": "eyJhbGc...",
"csrf_token": "689ea9...",
},
headers={"Authorization": "Bearer TOKEN"},
)Reddit API LoginNew
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.
Comment v2New
Post Reddit comments ~2x faster than v1 with the v2 endpoint. Same request shape, same response — just lower latency for higher-volume use cases.
