Reddit Search API
EN

Reddit Search API · GET · JSON

Build a search-history card without storing secrets

Conceptual illustration, not a screenshot or measured result.

Questions about this page

What should I check in “List replayable public inputs”?

The structure of the history card should mirror the API's filter contract exactly.

What should I check in “Separate secret storage”?

The caller's backend needs access to its saved API key to send X-API-Key or Authorization: Bearer.

What should I check in “Save interpretation notes”?

Keep observations separate from conclusions.

What should I check in “Review retention boundaries”?

Define deletion, export and expiry behavior for this application before offering the card as persistent history.

What is Reddit Search API?

Reddit Search 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 Search 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.

List replayable public inputs

The structure of the history card should mirror the API's filter contract exactly. For a proposed LocalLLaMA notebook, record the submitted q, subreddit, author, kind, from, to, min_score, limit and page when those parameters are used. A concise example is q=quantization, subreddit=LocalLLaMA, limit=3, page=1. Store dates as the actual submitted YYYY-MM-DD UTC values. These entries explain the request's conditions; they are not proof that any particular discussion was returned, and replaying them does not guarantee the same response later.

Treat public inputs as noncredential fields, not as automatically harmless information. A query can contain a private project name, and a note may identify someone the reader did not intend to disclose. Decide what should be stored or exported rather than copying an entire request object. Keep authentication headers out of the history. If the application saves a response locally, identify it separately from the request and record when it was obtained. Otherwise a link to repeat the query can be mistaken for an archived copy of the original result.

Separate secret storage

The caller's backend needs access to its saved API key to send X-API-Key or Authorization: Bearer. A one-way hash alone cannot supply that outgoing credential. Keep the usable key in appropriate backend secret storage, outside browser bundles, query strings, history exports and diagnostic logs. The service itself stores a key hash and prefix for authentication; that is a different role. Your API key is stored encrypted and is available after sign-in. Keep it private. A history record must never become an accidental key backup.

Keep three relationships distinct: the reader's application account, the service operator's session, and the service API key used for retrieval. Service keys and balances are specific to their tenant; changing a host does not make another tenant's key valid. Excluding credentials from history reduces one exposure path, but does not make the stored query or notes safe from every browser or access-control problem. Review the application's own storage and sharing choices. Do not advertise this proposed card as a tested security boundary or a history feature supplied by the archive API.

Save interpretation notes

Keep observations separate from conclusions. A card might say that the request returned three displayed records, that one lacked usable body text, and that the reader still needs the experiment's memory conditions. This is an illustrative annotation, not an observed archive result. If you retain pagination.total, also retain pagination.relation, plus the continuation and window indicators needed to explain the response. A lower bound is not an exact count. None of those fields measures how relevant a record is or how common the underlying problem is.

Let readers add a short explanation of why they kept a reference. Label that text as their note, preserve available source identity, and avoid mixing it into quoted source material. Optional source fields may be absent, and parent references do not provide a complete discussion. Reopening an already saved response need not call the API, whereas an explicit refresh is a new retrieval. Successful refreshes cost one credit even if empty. Preserve a failed or uncertain refresh as its own outcome rather than overwriting the earlier observation with an unlabelled blank card.

Review retention boundaries

Define deletion, export and expiry behavior for this application before offering the card as persistent history. Removing a local card removes the data your implementation chooses to store; it does not delete an archive record, close the service account or alter its payment records. Browser clearing, device loss or storage restrictions may remove local history. If you offer synchronization or backups, describe and test them as separate application features. Neither is an archive endpoint, and this article does not establish that either has been implemented.

The service specifies no fixed retention period for account data here, and that statement does not promise permanent access to archived content. A retained query can remain understandable even when a source later becomes unavailable, provided the card distinguishes the old observation from a new retrieval. Review exports for secrets and sensitive notes, then let the reader decide what to retain. The useful product is a traceable record of a search decision, not an assurance that its data, interpretation or source link will remain valid indefinitely.

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.redditsearchapi.com/v1/search' \
  -H "Authorization: Bearer ${REDDIT_API_KEY}" \
  --data-urlencode 'q=quantization' \
  --data-urlencode 'subreddit=LocalLLaMA' \
  --data-urlencode 'limit=3'

Python

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

params = urlencode({"q":"quantization","subreddit":"LocalLLaMA","limit":"3"})
request = Request(
    "https://api.redditsearchapi.com/v1/search?" + 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({"q":"quantization","subreddit":"LocalLLaMA","limit":"3"});
const response = await fetch(
  "https://api.redditsearchapi.com/v1/search?" + 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.

Documentation

1. Write down what the request is allowed to answer

The example is a model developer reading past LocalLLaMA discussions about quantization. The API base is https://api.redditsearchapi.com and the proposed first route is /v1/search?q=quantization&subreddit=LocalLLaMA&limit=3. Authenticate from your server with Authorization: Bearer followed by your API key, or the X-API-Key header. Keep the raw credential out of a browser bundle, query-history entry and shared screenshot. Keys and balances belong to this domain.

This independent historical archive does not provide a live Reddit feed, Reddit account authorization, posting, voting or private messages. A page timestamp, a record timestamp and the time you retrieved a response describe different things. Record only the timestamp fields actually present. No requested date range or successful response establishes complete coverage of the period.

2. Test what the words mean before adding controls

q is analyzed against title and text using best_fields matching with operator AND. For quantization memory, both analyzed terms must match within a matching field; putting one word only in the title and the other only in text does not by itself satisfy that field-level requirement. This is a conceptual counterexample, not a recorded archive result. Do not call the request exact-phrase search, an OR search or a ranked recommendation.

Search, posts and comments accept q, subreddit, author, kind, from, to, min_score, limit and page. kind accepts post or comment. /v1/posts and /v1/comments constrain record kind and do not require id. /v1/item takes id instead of the search filter set. /v1/subreddits accepts prefix and limit for community aggregation; its buckets are not a guaranteed complete directory. There are no parent_id, link_id or sort parameters.

3. Keep a dated search separate from a dated conclusion

Supply from and to as YYYY-MM-DD UTC dates. The to date includes its final second; a date-time such as 2026-06-01T00:00:00Z is not a valid filter value. An example interval from=2026-06-01&to=2026-06-30 describes the requested June window. It does not assert that records for every day exist. Keep the actual submitted dates beside any local reading note.

min_score excludes records below the supplied threshold; it never asks for score order. Retrieval uses archive _doc order, neither chronological nor relevance nor score order. A date filter does not make the first returned record the earliest. If your own interface sorts records it already has, identify that as local presentation of a bounded response rather than the server ordering all matching discussions.

4. Read pagination as evidence about this window

limit and page each accept integers from 1 through 100. Keep the query conditions and limit unchanged when incrementing page. Inspect pagination.has_more and pagination.window_exhausted instead of inferring another page from an attractive total. The last full 100-record page of the 100-page window has no lookahead beyond the exposed window, so a full last page cannot establish an exact total.

pagination.relation qualifies pagination.total: eq is exact, gte is a lower bound and unknown means no reliable total, which may be null. A deep empty page can carry an unknown total rather than proving the whole query had no matches. Community aggregations also expose truncation separately. Do not label a lower bound as an exact match count or promise that bounded page iteration exports every matching archive record.

5. Map a flat record to an honest reading card

The data array contains flat source records. Treat each field as conditional on the returned item rather than assuming every post has a title, author, timestamp or usable link. Preserve source text separately from your own annotations. Only expose a source link after validating the returned value for safe navigation in your application; a missing parent is not permission to invent a thread URL.

Returned parent_id and link_id values can support local grouping of records you actually possess. They are not query filters and do not prove complete ancestry or a complete thread. If the author’s model settings are missing, mark the reading question unresolved. Fetching more material is an optional further request, not a service guarantee that the context can be recovered.

6. Put the failure beside the request that produced it

HTTP 400 means invalid input, 401 a missing or invalid API key, 402 insufficient credit, 429 a rate limit and 502 an upstream failure. Let the account operator handle credentials or balance without presenting a service-key problem as the reader’s personal login failure. Correct invalid parameters before retrying; avoid an uncontrolled retry loop after a rate limit or an uncertain connection failure.

Every successful retrieval costs one credit, including an empty data array. Invalid requests are not charged; upstream failures refund a reserved credit, with pending reconciliation possible if immediate refund handling fails. A lost response does not establish whether a successful request occurred. The public uncharged /v1/status returns a static archive disclosure and an HTTP response; it does not test search health, record availability or the completeness of your notebook.

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