Reddit API Hub · GET · JSON
From a community-name candidate to an archive preview

Questions about this page
What should an entry in my community directory explain?
Build one directory entry before planning a broad collection.
What should I save alongside the retrieved records?
In your own catalogue, retain the returned name, the prefix you submitted and the response’s limitations.
How do I choose the record type for a directory preview?
Use /v1/search when the task combines supported text and metadata filters across posts and comments.
How should I treat dates and result order?
For a dated sample, choose from and to as YYYY-MM-DD UTC dates on created_utc; the whole to day is included.
Does an item lookup recover the whole thread?
For one known identifier, use /v1/item?id=...
What should make this collection run stop?
A content page holds at most 100 records, and page cannot exceed 100 across separate requests.
What is Reddit API Hub?
Reddit API Hub is an independent read-only service for retrieving available archived Reddit posts and comments as JSON. Authenticate with the key for this site and choose a documented search or lookup route. It is not official Reddit, live access or a complete export of a community.
How much does Reddit API Hub cost?
The price is $1 per 1,000 successful requests. The minimum top-up is $50 for 50,000 credits. Each successful request uses one credit, even when it returns no matching records. Invalid requests are not charged; upstream failures trigger a refund, which can require reconciliation. A timeout alone does not establish the final billing outcome.
1. Define what a directory entry should answer
Build one directory entry before planning a broad collection. Your first decision is whether the entry needs only a discoverable name or also a sample of archived content. Treat these as separate observations. The route directory tells you which request can supply each observation; it does not certify coverage of a community.
Begin a community catalogue with https://api.redditapihub.com/v1/subreddits?prefix=program&limit=3. This asks for at most three community entries with the name prefix program. It does not find posts containing that word, promise the programming community or establish which communities are active today. Save the returned names as candidates, and explain that archive omissions and non-exact counts limit what this discovery can demonstrate.
2. Retain the discovery evidence
In your own catalogue, retain the returned name, the prefix you submitted and the response’s limitations. Label these as local notes rather than fields invented for the API. Do not turn count into a subscriber count or a ranking of current activity. If discovery is truncated, keep that fact beside the candidate list; /v1/subreddits has no page parameter for completing a census.
3. Choose the preview’s record type and text condition
Use /v1/search when the task combines supported text and metadata filters across posts and comments. Use /v1/posts when only posts are needed, or /v1/comments when only comments are needed. These routes accept q, subreddit, author, kind, from, to, min_score, limit and page. kind accepts post or comment. They return matching records, not a statistical report or an assembled discussion tree.
For a text preview, q matches title and text with an AND operator within a matching field. With q=memory leak, the terms must match together in title or together in text; one term in each field is not enough. This is not an exact-phrase promise or an arbitrary query language. Decide whether that condition suits the preview before adding other filters.
4. Specify time and ordering separately
For a dated sample, choose from and to as YYYY-MM-DD UTC dates on created_utc; the whole to day is included. Record the interval in your local entry so readers can distinguish the requested dates from actual archive coverage. Results use _doc order, not chronological, score or relevance order. min_score only filters a numeric threshold. Sorting the received sample locally changes its presentation, not which missing records the archive supplied.
5. Inspect an item without promising a thread
For one known identifier, use /v1/item?id=... with id only. A URL is not a substitute for this parameter. Finding the item is not guaranteed and does not retrieve all its parents or replies. For content records, group present parent_id and link_id locally if useful, leaving unresolved references visible. Such grouping cannot establish a complete conversation or compensate for records absent from the archive.
A useful preview can display a few received records and leave missing relationships unresolved. Preserve the source identifier if you plan an individual lookup. Describe any grouping as work done by your application; a catalogue card is not evidence that every parent and reply has been recovered.
6. Stop with a useful, bounded catalogue
A content page holds at most 100 records, and page cannot exceed 100 across separate requests. Read total together with relation: eq is exact for the query, gte a lower bound and unknown unreliable or null. No total proves complete retrieval. Smaller date windows and local deduplication may organize work but do not prove exhaustive coverage, unique results or stability of future responses.
Every successful discovery, content page, individual lookup or repeat costs one credit, including successful empty results. Invalid requests do not debit and upstream failures refund reservations; response loss may conceal a billed success. Handle 400, 401, 402 and 429 by cause and limit retries. Read pricing and the key page before funding work: $1 per 1000 successful requests, a $50 paid minimum and conditional trial eligibility.
For the initial experiment, stop after one name-discovery response and one chosen preview. Reopen the Documentation for parameter changes, Pricing for the request budget and Get API key for account controls. A useful directory can acknowledge an unknown total without presenting an unfinished census as complete.
Make your first authenticated request
Create an account, copy the key shown at the top of the account page, and put it in a server environment variable. The three examples below request the same small page. Inspect the HTTP status before using the JSON; keep credentials out of browser bundles, shared notebooks and request logs.
cURL
curl --get --fail-with-body 'https://api.redditapihub.com/v1/subreddits' \
-H "Authorization: Bearer ${REDDIT_API_KEY}" \
--data-urlencode 'prefix=program' \
--data-urlencode 'limit=3'Python
import json
import os
from urllib.parse import urlencode
from urllib.request import Request, urlopen
params = urlencode({"prefix":"program","limit":"3"})
request = Request(
"https://api.redditapihub.com/v1/subreddits?" + params,
headers={"Authorization": "Bearer " + os.environ["REDDIT_API_KEY"]},
)
with urlopen(request, timeout=20) as response:
payload = json.load(response)
print(payload["pagination"])
print(payload["data"])Node.js 18+
// Node.js 18+ · example.mjs
const parameters = new URLSearchParams({"prefix":"program","limit":"3"});
const response = await fetch(
"https://api.redditapihub.com/v1/subreddits?" + parameters,
{headers: {Authorization: "Bearer " + process.env.REDDIT_API_KEY}}
);
if (!response.ok) throw new Error("HTTP " + response.status);
const payload = await response.json();
console.log(payload.pagination);
console.log(payload.data);Read the response before building a table
This is an illustrative empty successful response, not a live query result. An empty page still costs one credit. Read data, pagination and credits separately; a total must always be interpreted with relation. The balance shown is an example after one eligible trial request.
{
"data": [],
"pagination": {
"page": 1,
"limit": 3,
"total": null,
"relation": "unknown",
"has_more": false,
"window_exhausted": false,
"truncated": false
},
"credits": {
"cost": 1,
"balance": 4999
}
}Response
Inspect the actual objects before assuming a column exists. Keep omitted values, null and empty strings distinct. Relationship fields, when returned, may help with local grouping; they do not establish a complete thread. Preserve the raw response so a revised mapping can be tested without paying to fetch it again.
Combine ordinary text with an exact community and a UTC date window. Keep the nonsecret query parameters with the saved response. Limit controls the page size, page selects a bounded offset, and min_score is a filter rather than a sorting option. A page order is not a chronological or relevance ranking.
Six routes, one read-only API contract
Choose the route for the object you need. Search selects posts and comments; posts and comments constrain the record kind. Item looks up a known id. Subreddits returns matching community names rather than a complete community dataset. Status is an uncharged service-scope response and does not test search availability.
| Method | API | Use |
|---|---|---|
GET | /v1/search | Search posts and comments |
GET | /v1/posts | Posts only |
GET | /v1/comments | Comments only |
GET | /v1/item | One known record id |
GET | /v1/subreddits | Community names by prefix |
GET | /v1/status | Service scope; no charge |
Set the boundaries of a collection job
Combine ordinary text with an exact community and a UTC date window. Keep the nonsecret query parameters with the saved response. Limit controls the page size, page selects a bounded offset, and min_score is a filter rather than a sorting option. A page order is not a chronological or relevance ranking.
| Parameter | Meaning |
|---|---|
q | Text in title and text |
subreddit | Exact community spelling |
author | Exact author value |
kind | post or comment |
from / to | YYYY-MM-DD, UTC; end day included |
min_score | Minimum score, not sorting |
limit / page | Both range from 1 to 100 |
prefix / id | Route-specific name prefix or known id |
Map observed fields deliberately
Inspect the actual objects before assuming a column exists. Keep omitted values, null and empty strings distinct. Relationship fields, when returned, may help with local grouping; they do not establish a complete thread. Preserve the raw response so a revised mapping can be tested without paying to fetch it again.
| Parameter | Meaning |
|---|---|
id | Keep the source identifier |
kind | Inspect the record kind |
subreddit | Preserve the returned community name |
title / text | Treat missing, null and empty separately |
created_utc / score | Check numeric values before conversion |
parent_id / link_id | Optional links; group locally if present |
Where this archive API fits
Use this service when your task starts with reading available historical records. A live feed, posting, editing, voting or a server-built thread requires a different integration. Direct page scraping and official Reddit access have their own behaviour and requirements; this endpoint does not impersonate either interface or promise their coverage.
How do search, posts and comments differ?
Use /v1/search for the supported search across record kinds. /v1/posts and /v1/comments add a post or comment constraint. They share the documented search filters; /v1/item is the separate route for a known id. None of these routes creates, edits or deletes Reddit content.
How is this different from scraping Reddit pages?
You request structured historical records through the documented routes instead of downloading current HTML and extracting page elements. This avoids making your loader depend on page markup. It does not provide a live proxy, browser session, official OAuth compatibility or a promise of complete historical coverage.
Documentation
Community discovery and individual items
All protected retrieval routes use GET under https://api.redditapihub.com. Authenticate using X-API-Key: <key> or Authorization: Bearer <key>. Both are supported alternatives carrying this domain's archive key, not Reddit OAuth credentials. Store the secret server-side. The Secure HttpOnly session cookie for the account panel is separate from data retrieval and does not replace a key header in your application.
/v1/subreddits accepts prefix and limit only. An optional prefix restricts community names, not post text. When supplied, it uses 1–64 ASCII letters, digits or underscores. limit ranges from 1 to 100 and caps community entries. Each entry contains subreddit and count, without a globally exact count guarantee. This route has no page, author, date or content query filter; it does not expose an exhaustive community-catalogue cursor.
/v1/item?id=... requires a record identifier and looks for one archived item. It accepts id only, not a Reddit URL or a request for a complete thread. The record may be absent. Inspect identifiers in actual records rather than assuming a transformation used by another client. /v1/status is public, needs no key and costs no credits. Its static disclosure confirms an HTTP application response without probing the search backend, archive availability or balance.
Content routes and supported filters
/v1/search searches posts and comments. /v1/posts adds a post-kind constraint and /v1/comments adds a comment-kind constraint. All three accept q, subreddit, author, kind, from, to, min_score, limit and page, not id or prefix. kind accepts post or comment; omit it to allow both kinds through search. q is text search, not arbitrary query DSL, sentiment analysis or custom server-side statistics.
from and to require YYYY-MM-DD in UTC and filter created_utc, not ingestion time. The complete final to day is included. min_score is a numeric score threshold, without score sorting or quality assessment. Results follow internal _doc order, not insertion time, chronology, relevance or score. You may sort or analyze the received sample locally, while preserving the fact that missing records remain outside that sample.
Retrieval responses contain data, pagination and credits. Content documents are flat and their fields may vary. Present parent_id and link_id allow local relationships, but neither field is an exposed query filter. Local grouping does not guarantee every parent, reply or complete conversation. Keep absent fields and unresolved references visible instead of silently filling them with fabricated source values.
Pagination, errors and credit accounting
Content searches allow limit and page from 1 to 100, one page per request. This is not pagination for /v1/subreddits. Read pagination.total with relation: eq means an exact query total, gte a lower bound and unknown no reliable total, possibly null. Discovery uses an unknown total; its truncated signal can indicate omitted aggregation buckets without giving a way to page through them.
An exact total does not prove a complete download or full archive coverage. Dividing periods, iterating pages or removing duplicates locally does not prove exhaustive or unique retrieval. There is no fixed coverage date, immutable snapshot or permanent-record guarantee. Keep returned has_more, window_exhausted and truncated indicators with the response, interpreting each in the context of the route rather than inventing a cursor from them.
HTTP 400 means invalid parameters, 401 a missing or invalid key, 402 insufficient credits and 429 a frequency limit. Invalid requests do not debit; upstream failures refund reservations. Successful retrieval costs one credit even when empty. A timeout or lost client response may follow a charged success, and another successful attempt costs another credit. A failure in your own storage or transformation does not refund a successful archive request.
Keeping and replacing your key
API key
Your API key is stored encrypted and is available after sign-in. Keep it private.
Keep the key on your server. Regeneration immediately disables the previous key. Your credits and account remain available.
Recovering account access
Save this one-time code privately. You need your email and this code to reset a forgotten password. A new code replaces the previous one.
Continue with Google
An existing account can be linked when Google establishes authoritative ownership of the email. Other email addresses require confirmation with the existing account password.
Request records and local copies
Request activity · last 30 days
Detailed request records, including client IP and user agent, are kept for 30 days.
Summaries cover the selected period. IP, response and latency details are available only for logged requests and expire after 30 days. Older records may lack these fields.
Requests
The export contains the currently displayed page and filters. Times use your browser timezone; chart days use UTC.
Reddit Data API is an independent historical archive service, not an official Reddit product or a live mirror. Availability of a record, time range or optional field is not guaranteed. Record the scope and retrieval time of your own batch, review the terms and privacy information, and avoid presenting a bounded archive sample as all activity on Reddit. The account exposes request costs, statuses and available client details; older requests may lack IP or latency fields.
Request costs you can account for
$1 / 1,000
A successful retrieval costs one credit, including an empty result: $1 per 1,000 successes. Eligible new accounts receive $5 = 5,000 credits once across the network. The minimum paid top-up is $50 = 50,000 credits. Invalid requests are not charged; upstream failures refund the reservation, sometimes after reconciliation. A successful retry is a new paid retrieval, so rerun local transformations from saved inputs first.
$5 / 5,000
Welcome credit: $5 · 5,000 credits
$50 / 50,000
Create an invoice before sending. Send exactly the displayed amount using the displayed token and network. Credit is added only after blockchain confirmation.