Reddit Search API
EN

Reddit Search API · GET · JSON

Explain field-level AND with counterexamples

Conceptual illustration, not a screenshot or measured result.

Questions about this page

What should I check in “Draw field-local cases”?

A reader who adds memory to quantization needs to know what the extra word changes.

What should I check in “Test a title-only match”?

For the first paper example, put quantization memory in the synthetic title and leave the synthetic body unrelated to those two terms.

What should I check in “Test a split-field nonmatch”?

For the second paper example, place only quantization in the title and only memory in the text.

What should I check in “Write a query explanation”?

A short label beside the form can say: all analyzed query terms must match within title or within text.

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.

Draw field-local cases

A reader who adds memory to quantization needs to know what the extra word changes. The current q query uses multi_match with type=best_fields and operator=and over title and text. The analyzed terms must match within a matching field. It is not enough to find one term only in title and the other only in text. A match is not achieved if one keyword is in the title and the other is exclusively in the text. This explanation concerns field boundaries, not a judgment that the content answers the reader's question.

Draw a two-column worksheet labelled title and text, then list the analyzed terms the exercise assumes. Use synthetic snippets and explicitly state that both example words are assumed to remain distinct analyzed terms. Real matching depends on the actual analyzer; the illustration does not establish stemming, synonyms, punctuation handling or a character-for-character rule. It also does not require both fields to match simultaneously. One matching field can satisfy the condition, and neither the phrase's order nor the words' proximity is guaranteed by this AND explanation.

Test a title-only match

For the first paper example, put quantization memory in the synthetic title and leave the synthetic body unrelated to those two terms. Under the stated token assumptions, the title supplies both required terms. The body need not supply them again. This is a conceptual matching example, not a record claimed to exist in the archive and not a report of an executed test. The title could still describe conditions different from those the reader cares about. A term match only gives the reader material to inspect.

Now keep the example title but change the task. A person investigating the conditions of a memory measurement may need the hardware, model and method, none of which the two words establish. Show those requirements as a separate reading note. Do not award the title a higher quality badge or claim that title matches rank above body matches. Retrieval uses archive _doc order, not relevance, date or score order. The matching example explains eligibility; the position of a returned record does not validate its usefulness.

Test a split-field nonmatch

For the second paper example, place only quantization in the title and only memory in the text. Assume neither field contains the other analyzed term. Neither field then satisfies the two-term AND condition, despite the record containing both words somewhere. This contrasts with an imagined cross-field search that pools every word across the two columns. It does not compare two separate documents, and it should not be explained as a proximity rule. The missing condition is both terms within a matching field, not necessarily adjacent words.

Apply the counterexample carefully to an actual reading problem. An absent result does not prove that its terms were split across fields: availability, other filters, analyzer behavior and the bounded window also matter. If a reader broadens q to quantization alone, make that an explicit new request and retain the previous wording for comparison. Do not suggest an exposed OR toggle, phrase-search syntax, arbitrary field selection or field weights. Those controls are not in this API's documented filter contract. Your interface should not imply that a hidden switch can supply them.

Write a query explanation

A short label beside the form can say: all analyzed query terms must match within title or within text. Follow it with the two-column example when the user needs detail. Keep the submitted wording visible above the response, especially after a refinement. The helper text should distinguish this condition from exact-phrase matching and from semantic understanding. It should also distinguish q from filters such as subreddit, author, kind and min_score. Those restrictions narrow a request separately; min_score does not turn the result list into a relevance ranking.

When testing your own interface later, verify that adding a word starts a new page-1 sequence and that old responses remain attached to their original inputs. These are proposed application checks, not tests already performed by this article. Further successful retrievals cost one credit, including empty results. Preserve uncertainty in the message: no records returned for this request does not mean the topic was never discussed. Field-local AND is one explainable part of a historical, bounded search; it does not establish coverage, a complete conversation or a best answer.

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