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.
/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 |
proxy | object | string | no | Sticky IP for this account, {server, username?, password?} or a URL string. Use the same proxy you passed to /login. Omit to use our pool. See Per-account proxies. |
locale / timezone | string | no | Browser-context identity, e.g. de-DE and Europe/Berlin. Match these to your proxy's country, or the account acts from your IP while reporting a New York clock. Only applies where a real browser runs. Defaults en-US / America/New_York. See Per-account proxies. |
{
"post_url": "https://www.reddit.com/r/X/comments/.../",
"text": "your comment text",
"reddit_session": "...",
"loid": "...",
"token_v2": "...",
"csrf_token": "...",
"proxy": { "server": "http://host:port", "username": "...", "password": "..." }
}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; or proxy is malformed (INVALID_PROXY), or a proxy-shaped field was sent as a top-level string (INVALID_FIELD), see Per-account proxies |
401 | Missing Bearer token |
403 | Invalid Bearer token |
502 | Could not post. When Reddit itself refused or throttled the comment, code says which: REDDIT_HTTP_ERROR (a non-200 such as a 429, with that status in upstream_status), REDDIT_RATELIMIT, or REDDIT_REFUSED (Reddit's own error in reddit_errors) |
500 | Unexpected server error |
A write Reddit refused or throttled is billed at this endpoint's price. Reddit received the attempt and answered it, so a 502 carrying one of the Reddit codes above costs the same as a posted write, as it does on every other write endpoint. A 500 (our own failure) is not billed.
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"},
)Independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by Reddit, Inc.
Scheduled Posts and Comments
Schedule a Reddit post or comment for a later time, list your scheduled actions and cancel one. Free to schedule; billed at the write price only when it runs.
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.
