Reddit Search API · GET · JSON
Give empty results and transport failures different screens

Questions about this page
What should I check in “Define response classes”?
A blank results area cannot explain what happened to a search.
What should I check in “Write empty-state actions”?
Use restrained copy such as No records were returned for this request.
What should I check in “Write failure-state actions”?
Map the error to the person who can act on it.
What should I check in “Test navigation continuity”?
Continuity also involves preserving the user's input state.
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.
Define response classes
A blank results area cannot explain what happened to a search. In the proposed LocalLLaMA notebook, distinguish a request still in progress, a successful response with records, a successful response with an empty data array, an HTTP error, and a transport attempt from which no usable response arrived. These are different observations. In particular, an empty success does not prove that the archive contains no relevant discussion, while a lost response does not reveal whether the server completed the request. Keep those interpretations out of the visual shortcut no results.
Use the HTTP status and validated response shape together. A 200 response containing data: [] is a successful empty retrieval. HTTP 400, 401, 402, 429 and 502 are error responses, not alternative kinds of successful empty data. A network exception may provide no HTTP status at all. Do not infer from an error alone whether a request reached every backend stage. Keep the submitted parameters and an application request identifier with each outcome so a later response can be attached to the correct search.
Write empty-state actions
Use restrained copy such as No records were returned for this request. Show the submitted q=quantization and subreddit=LocalLLaMA nearby, along with any active date or score restriction. Offer a deliberate way to edit one condition and submit again. Do not replace the empty response with invented popular discussions or automatically broaden the query while leaving the old label in place. If a reader removes a filter, the next result belongs to that changed request and should begin a new page-1 sequence.
Explain a relevant constraint without pretending to diagnose the absence. For quantization memory, all analyzed terms must match within a matching title or text field; a split across the two fields is insufficient. That is one possible consideration, not proof of why this response was empty. Preserve the billing distinction: successful empty retrieval still costs one credit. An empty deep page can also have an unknown total. Do not turn it into a claim of zero matches throughout the archive or a reason to keep requesting pages indefinitely.
Write failure-state actions
Map the error to the person who can act on it. HTTP 400 calls for checking the actual input, such as an unsupported parameter or a date that is not YYYY-MM-DD. HTTP 401 concerns the service API key, and 402 the service account's available credits; neither establishes that the reader's own application login has expired. The operator may need to correct the backend credential or review the balance. Avoid asking the reader to paste a service key into a public search screen.
For 429, respect Retry-After and reduce repeated submissions. For 502, preserve the query and offer an intentional retry when appropriate; reserved-credit refunds may be pending reconciliation. A missing response needs different wording: the outcome is not known, including whether a successful request was charged. Invalid requests rejected before reservation are not charged, but a connection failure does not prove that rejection occurred. The uncharged /v1/status endpoint reports a static service disclosure and HTTP responsiveness; it cannot settle the lost request or verify search health.
Test navigation continuity
Continuity also involves preserving the user's input state. Plan local fixtures for a valid empty response, an HTTP error and a network exception before a response is available. Use explicitly synthetic material; these fixtures would test your interface, not establish archive availability. Check that each produces distinct copy and leaves the submitted query accessible. Add a case where the reader changes the form while a request is pending: the old outcome must not appear as an answer to the new wording.
For a failed next page, retain the already loaded records and distinguish their completed state from the failed continuation. Let the reader retry that page or return to the form without silently issuing another request. Ignoring a late response in the interface does not guarantee cancellation of server work. Record which transitions your application actually tests and which remain proposed. The aim is a screen that tells the reader what is known and offers a useful next action, rather than a reassuring message unsupported by the response.
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.
| 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
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.