Read Private and Member-Only Subreddits With Your Own Session
Send your Reddit session as headers on any read endpoint to see private, restricted and member-only subreddits, plus your own feed. Optional, additive, and existing calls are unchanged.
Reads on this API are anonymous by default. They are served from our pool of logged-in accounts, which is why you send no cookies for them and why they work with nothing but your API key.
That default cannot answer everything. A private subreddit, a restricted one, a member-only community, or your own front page are all invisible to an account that is not yours. Send your own Reddit session on the request and the same endpoint fetches the same thing as you.
Nothing changes unless you opt in
This is additive. If you send no session headers, every read behaves exactly as it did before: same pool, same response, same billing. Existing integrations need no change and were not affected by this feature shipping.
Send the session as headers
Get the values from POST /api/reddit/login, which returns your cookie jar. Send them as headers:
| Header | Cookie | Required |
|---|---|---|
x-reddit-session | reddit_session | Yes, whenever you authenticate |
x-reddit-loid | loid | Yes, whenever you authenticate |
x-reddit-token-v2 | token_v2 | No |
x-reddit-csrf-token | csrf_token | No |
x-reddit-edgebucket | edgebucket | No |
x-reddit-csv | csv | No |
x-reddit-session-tracker | session_tracker | No |
x-reddit-pc | pc | No |
curl "https://api.redditapis.com/api/reddit/posts?subreddit=your_private_sub" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-reddit-session: YOUR_REDDIT_SESSION" \
-H "x-reddit-loid: YOUR_LOID"Headers, not query parameters. A Reddit session cookie grants full control of that account, and anything in a query string is written into access logs, proxy logs and browser history along the way. Headers are not.
Send both or neither
x-reddit-session without x-reddit-loid (or the reverse) is a 400 with
code: "INCOMPLETE_SESSION", naming the header you left out.
It would be easy to fall back to an anonymous read there instead. That is exactly what makes it a bad idea: a private subreddit read anonymously comes back empty, and an empty listing is indistinguishable from a quiet one. You would get a plausible answer to a question you did not ask.
Reading through your own proxy
Add x-reddit-proxy to make the read leave from an IP you control, so it
reaches Reddit from where that account normally acts:
-H "x-reddit-proxy: http://user:pass@host:port"Same forms and the same behaviour as the write endpoints, including that your proxy is pinned for every retry, so a retry cannot move your account onto a different IP. Full detail on Proxies.
Without it, an authenticated read egresses through our shared pool. That egress is pinned for the request too, so your account is never presented to Reddit from several addresses in one call, but the address is ours rather than yours. Fine for most reads, and the wrong choice for an account with a strong geographic history.
A proxy sent without a session is a 400, not a silently anonymous read.
There would be no account to act as, so the read would come from our egress
while you believed it came from yours.
Which endpoints accept a session
| Endpoint | Anonymous | Authenticated |
|---|---|---|
GET /api/reddit/posts | Yes | Yes |
GET /api/reddit/search | Yes | Yes |
GET /api/reddit/sub/:name/top | Yes | Yes |
GET /api/reddit/sub/:name/comments | Yes | Yes |
GET /api/reddit/comments | Yes | Yes |
GET /api/reddit/post/:id/comments | Yes | Yes |
GET /api/reddit/comments/:postId | Yes | Yes |
GET /api/reddit/feed | No, session required | Yes |
GET /api/reddit/user/:name/upvoted | No, session required | Yes |
GET /api/reddit/user/:name/saved | No, session required | Yes |
GET /api/reddit/user/:name/hidden | No, session required | Yes |
GET /api/reddit/user/:name/gilded | No, session required | Yes |
The four user/:name/* listings have always required a session and have always
taken it as query parameters. They now accept the header form too, and the query
form keeps working. If you send both, the headers win, so a stale query
parameter you forgot to delete cannot quietly serve you.
Errors
| Status | code | Meaning |
|---|---|---|
400 | INCOMPLETE_SESSION | One required session header was sent without the other. |
400 | SESSION_REQUIRED | The endpoint needs a session and none was sent. |
400 | PROXY_WITHOUT_SESSION | x-reddit-proxy was sent with no session, so there is no account to read as. |
400 | INVALID_PROXY | The proxy address could not be parsed. The message names what is wrong with it. |
400 | PROXY_AS_COOKIE | A query field named like a proxy (proxy, server, username, password, socks5, …) was sent to an endpoint that forwards unknown query fields as cookies. Use the x-reddit-proxy header instead; sending it as a query field would ship your proxy credentials to Reddit. |
401 | REAUTH_REQUIRED | Reddit rejected the session. Log in again. |
403 | PERMISSION_DENIED | The account cannot see this: private, restricted, not a member, or suspended. |
404 | NOT_FOUND | It does not exist, or is unavailable to this account. |
429 | HTTP_429 | Reddit rate-limited your account. Retry-After says how long to wait. |
502 | PROXY_ERROR and others | Your proxy could not complete the read. The response names it, because it is the one part you can fix. |
503 | upstream_unavailable | Our egress could not complete the read. Retryable, Retry-After is set, and not billed. |
A rejected or expired session is always one of these, never a 200 with an
empty list.
The 502 / 503 split is deliberate: a failure of your proxy is described so
you can act on it, and a failure of ours is our problem to absorb rather than
yours to pay for.
One thing this does not detect
If Reddit accepts your cookie but treats the request as logged out, a read
of a public subreddit still returns real data and nothing marks it. For a
private subreddit it surfaces correctly as 403, and for the feed as 403, so
the gap is limited to public content, where the answer is at least not wrong.
If you need certainty that a session is live, call
GET /api/reddit/feed: it cannot be served without one.
Independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by Reddit, Inc.
Browser fingerprint
Every browser-method call gets a per-account User-Agent, screen, platform and canvas signature. Pin it with your own seed so one account keeps one machine across re-logins.
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.
