Reddit Comments API
EN

Reddit Comments API · GET · JSON

Retrieve flat comment records with documented filters

Conceptual illustration, not a screenshot or measured result.

Questions about this page

What is Reddit Comments API?

Reddit Comments API 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 Comments API 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.

How do I get an API key?

Create an account with email and password, or continue with Google in a popup. Eligible new accounts receive $5 (5,000 credits) once across this site network. Your API key is available at the top of the account after sign-in and is stored encrypted. Keep it on your server.

Which filters can I use to search Reddit records?

Use q for analyzed text search and combine it with subreddit, author, kind, from, to or min_score. Multiple search words use AND semantics; this is not a semantic-search or arbitrary-query-DSL endpoint. Dates use YYYY-MM-DD in UTC, with the to date including the whole day. Start with documented parameters in the reference.

Does Reddit Comments API provide live Reddit access?

No. This service reads a historical archive, not a live Reddit feed. It cannot publish posts, vote, send private messages or perform Reddit OAuth actions. The public /v1/status route describes the service scope; it does not prove archive health, complete coverage or current availability of an original Reddit page.

Can I export every record that matches a search?

Not necessarily. A request returns up to 100 records, and page ranges from 1 to 100. Read total together with pagination.relation: exact, lower bound or unknown. Results follow archive order rather than guaranteed chronological or relevance order. Reaching the last accessible page does not prove that a saved sample is exhaustive.

Can I reuse the same key on another domain?

No. Accounts, API keys and credit balances are separated by site. Use the key issued for this domain with its own HTTPS API hostname. Keep that key in server-side configuration, not in browser JavaScript, public repositories or shared logs. A key from another site is not a substitute for a local account. Google sign-in is shared across the network; API keys and balances remain separate for each site.

Which request should I try first?

Start with /v1/comments, q=javascript, subreddit=learnprogramming, limit=3 and page=1. This small request lets you inspect available fields before writing import or interface logic. It still costs one credit when successful, including an empty result. Adjust the topic and community for your task; the example is not a promise of a fixed record count.

Authentication and route boundaries

Authenticated retrieval accepts X-API-Key: <key> or Authorization: Bearer <key>. Use either supported header with requests to https://api.redditcommentsapi.com. Account sign-in uses a separate Secure HttpOnly session cookie; signing into the website does not replace the retrieval header in your application. Never embed a working key in public examples or browser code distributed to visitors.

GET /v1/search searches archived records. GET /v1/posts and GET /v1/comments restrict retrieval to posts and comments respectively. These three routes support q, subreddit, author, kind, from, to, min_score, limit and page. The kind values are post and comment; each type-specific route already fixes its own type. None of these routes accepts id as a search filter.

GET /v1/item requires id and accepts no other query filters. It retrieves an individual item rather than a discussion tree. GET /v1/subreddits accepts only prefix and limit for community-name lookup; it does not expose a hierarchy of communities, and aggregation counts are not guaranteed globally exact. Public GET /v1/status is uncharged and requires no key.

Dates, pages and interpretation

The q parameter provides text search, not an arbitrary query language or sentiment classifier. Use subreddit and author to restrict the selected records. Dates in from and to must use YYYY-MM-DD and UTC; to includes the whole final day. These bounds apply to created_utc, not archive ingestion time. Intraday intervals must be handled locally using available record timestamps.

Set limit and page within 1–100. Each request retrieves one page of at most 100 records, and a query permits at most 100 pages. The internal order _doc is archive document order, not an identifier, insertion-time sequence, chronological sort or relevance rank. The min_score threshold filters records but does not change this ordering or sort results by score.

Read pagination.relation together with pagination.total. The value eq reports an exact query total, gte reports a lower bound, and unknown means there is no reliable total, which may be null. An exact total does not establish that you downloaded every match. Splitting dates or iterating pages can organize retrieval but does not guarantee exhaustive or duplicate-free collection.

Relationships, failures and credit accounting

It is crucial to note that the server does not guarantee a complete conversation history when grouping by these identifiers. The presence of parent and link fields indicates relationships, but no completeness promise is attached to these associations. You should design your analysis tools to handle potential gaps in the lineage of a comment or post within the archive.

When present, parent_id and link_id are relationship metadata for local grouping, not supported server filters. Their presence does not guarantee that referenced items are available, or that every comment includes either field. Inspect identifier formats and preserve unresolved references. The API does not supply assembled threads, completeness checks or server-side conversation analytics. HTTP 400 means an invalid request, 401 missing or invalid authentication, 402 insufficient credits, and 429 a rate limit. Invalid requests do not debit credits; upstream failures refund reserved credits. A successful retrieval, even empty, costs one credit. A lost client response can follow billable server success, and a successful repeat costs another credit. Use /v1/status only for static service-scope information and evidence that the HTTP application responds. It does not query the search backend or establish record availability, latency or capacity. Treat payment verification and account balance as separate account-panel operations; the retrieval API has no conversation-level billing or payment-tracking endpoint.

Warehouse guide

Illustrative workload, not measured usage.

Choose what the text can show

Ask how a reply prompts an explanation or supplies one, rather than whether it successfully taught programming. Start with https://api.redditcommentsapi.com/v1/comments?subreddit=learnprogramming&limit=3 and save the actual response. A small limit is a reading exercise, not a way to request three connected turns. An empty result cannot tell you whether learners elsewhere asked that question.

Inventory the missing premise

For each passage, note whether the problem statement, attempted code, error message and expected behavior are actually visible. They are reading questions, not required record fields. Separate a quoted snippet from your own reformatted version. Do not run retrieved code merely to make the annotation seem complete, and do not turn a plausible missing question into a quotation from the learner.

Join records only with evidence

Preserve the flat records and inspect whether parent_id and link_id actually appear. When available, parent_id describes the referenced parent relationship and link_id connects to a post context; neither is an author identifier. Check the returned identifier formats before joining records. Do not strip prefixes blindly or assume every relationship value is automatically suitable as an /v1/item identifier.

Warehouse guide

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.redditcommentsapi.com/v1/comments' \
  -H "Authorization: Bearer ${REDDIT_API_KEY}" \
  --data-urlencode 'subreddit=learnprogramming' \
  --data-urlencode 'limit=3'

Python

import json
import os
from urllib.parse import urlencode
from urllib.request import Request, urlopen

params = urlencode({"subreddit":"learnprogramming","limit":"3"})
request = Request(
    "https://api.redditcommentsapi.com/v1/comments?" + 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({"subreddit":"learnprogramming","limit":"3"});
const response = await fetch(
  "https://api.redditcommentsapi.com/v1/comments?" + 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": 0,
    "relation": "eq",
    "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.

MethodAPIUse
GET/v1/searchSearch posts and comments
GET/v1/postsPosts only
GET/v1/commentsComments only
GET/v1/itemOne known record id
GET/v1/subredditsCommunity names by prefix
GET/v1/statusService 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.

ParameterMeaning
qText in title and text
subredditExact community spelling
authorExact author value
kindpost or comment
from / toYYYY-MM-DD, UTC; end day included
min_scoreMinimum score, not sorting
limit / pageBoth range from 1 to 100
prefix / idRoute-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.

ParameterMeaning
idKeep the source identifier
kindInspect the record kind
subredditPreserve the returned community name
title / textTreat missing, null and empty separately
created_utc / scoreCheck numeric values before conversion
parent_id / link_idOptional links; group locally if present
Conceptual illustration, not a screenshot or measured result.

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.

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.

Conceptual illustration, not a screenshot or measured result.

Continue with the related reference