API Reddit Info
EN

API Reddit Info · GET · JSON

Read and validate the promise search response

Conceptual illustration, not a screenshot or measured result.

Questions about this page

What should I save alongside the retrieved records?

Begin with https://api.apireddit.info/v1/search?q=promise&subreddit=learnjavascript&limit=3.

Which HTTP outcomes need a correction rather than more data?

A parseable JSON body is not by itself a successful retrieval.

What should I validate before reading individual items?

For this search response, check that data is an array and pagination is an object before iterating.

Why can the wording change what the sample contains?

A record can match q in its title or text.

How should I interpret the pagination boundary?

Interpret pagination.total together with pagination.relation.

How do I test the reader with local fixtures?

Keep clearly labelled local fixtures for an empty page, a null optional field, a lower-bound total and an error response.

What is API Reddit Info?

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

Keep the request next to the response

Begin with https://api.apireddit.info/v1/search?q=promise&subreddit=learnjavascript&limit=3. Save the request parameters with a private copy of the response, removing the key from anything you share. This gives each check a purpose: you asked for a small page from one community containing a particular search term. You did not ask for a complete thread or a ranking of the best explanations of promises.

Check HTTP before interpreting the JSON

A parseable JSON body is not by itself a successful retrieval. Check the HTTP outcome first, then parse the appropriate response. A 400 calls for correcting the request, 401 for checking the key, 402 for checking the balance, and 429 for reducing request frequency. Avoid an automatic retry loop that treats all four as temporary network trouble.

An upstream failure refunds the reserved credit. A timeout on your own client is different: the server may have completed and charged the request while its response was lost. Preserve that uncertainty in your logs. A successful retry is another retrieval and consumes another credit, even if both results are empty.

Validate the container before the individual item

For this search response, check that data is an array and pagination is an object before iterating. An empty data array is a valid successful result, not a missing response. Keep it distinct from an absent data field or a parsing failure. Also inspect the credits object without confusing its balance with the number of returned records.

Validate the fields your application actually reads. Test whether a value is present and of the expected type before using string methods or date conversion. Do not silently replace every null with an empty string: a missing author and a deliberately empty text need not mean the same thing. Render retrieved text as text, rather than inserting it as trusted HTML.

Let the request explain surprising records

A record can match q in its title or text. With multiple terms, AND applies within a matching field. Looking only at the displayed title can therefore give the wrong impression of a mismatch. Check the relevant available fields before changing the query.

Do not infer thread completeness from parent_id or link_id. If present, these fields can support local grouping of the records you have. A missing parent remains missing; grouping must not manufacture a conversation. Likewise, sort only your retrieved subset if you need a local timeline, and keep that distinction visible.

Read pagination as a qualified statement

Interpret pagination.total together with pagination.relation. eq reports an exact count, gte a lower bound, and unknown an unknown total that may be null. Never turn unknown into zero. Respect has_more and the bounds of 100 records per request and 100 pages per query; reaching a bound does not establish exhaustive coverage.

Archive document order is neither chronological nor relevance order. min_score is a filter only. If you add dates, from and to accept YYYY-MM-DD in UTC, with to inclusive. Those query dates are not an instruction to parse every returned timestamp as the same string format.

Exercise the reader without spending on every test

Keep clearly labelled local fixtures for an empty page, a null optional field, a lower-bound total and an error response. These are examples you construct, not claims about observed archive records. Test your parser against them before issuing a changed query. The home page explains that query; documentation is the route reference, pricing defines request costs, and the key page prepares private access. /v1/status is a static scope disclosure, not a test of upstream archive health.

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.apireddit.info/v1/search' \
  -H "Authorization: Bearer ${REDDIT_API_KEY}" \
  --data-urlencode 'q=promise' \
  --data-urlencode 'subreddit=learnjavascript' \
  --data-urlencode 'limit=3'

Python

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

params = urlencode({"q":"promise","subreddit":"learnjavascript","limit":"3"})
request = Request(
    "https://api.apireddit.info/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":"promise","subreddit":"learnjavascript","limit":"3"});
const response = await fetch(
  "https://api.apireddit.info/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

Authentication, Credits, and Error Handling

Access to the independent historical Reddit archive requires an API key passed in the header for each request. This key authenticates your account, which is managed via email and password rather than third-party OAuth providers. The system operates on a credit basis where one successful retrieval counts as one credit, ensuring precise billing for every interaction with the archive.

When the upstream source fails during retrieval, the reserved credit is returned to your account. Invalid requests do not debit a credit. A 429 response indicates a request-rate limit: reduce the frequency before retrying. This control limits request volume; it does not guarantee archive availability. A client timeout is different from an upstream failure: a completed server request may still have been charged.

A missing or invalid key produces HTTP 401; insufficient credits produce 402. The public, uncharged /v1/status endpoint returns a static description of the service and shows that the HTTP application responds. It does not probe the search source or verify archive availability. Distinguish these outcomes before changing a query: an access failure is not evidence that no matching record exists.

Endpoint Routes, Filters, and Request Limits

The content routes /v1/search, /v1/posts and /v1/comments accept q, subreddit, author, kind, from, to, min_score, limit and page. The posts and comments routes also restrict the record kind. q searches title and text; multiple analyzed words use AND within a matching field. kind accepts post or comment. Date filters use YYYY-MM-DD in UTC, with to inclusive.

Content retrieval is limited to 100 records per request and 100 pages per query. /v1/item takes only id for one record, rather than content pagination. /v1/subreddits accepts prefix and limit for community names; it does not accept page or the content-search filters. /v1/status supplies the public scope disclosure. Choose the route before adding parameters so the request matches its documented purpose.

The /v1/subreddits route additionally supports prefix matching, which is useful for discovering related communities or variants. By combining these filters, developers can construct highly specific queries to extract exact subsets of historical data. The archive structure ensures that each request returns consistent JSON formatting, making parsing predictable across all different endpoint types.

Pagination Totals, Document Order, and Validation

Read a pagination total together with its relation. eq reports an exact count for that response; gte reports a lower bound; unknown means no reliable total and may accompany null. Do not replace an unknown count with zero or treat a lower bound as exact. These values describe the response, not the archive's completeness or how representative the returned records are.

Results use archive document order (_doc), not chronological, score or relevance sorting. Repeating a query need not return unchanged results, and iterating pages does not prove that every matching record has been collected. Validate the fields your client uses before processing them. If you sort saved records locally, describe that order as applying only to the retrieved subset.

Validating the JSON response involves checking for the presence of required fields and ensuring the data types match expectations. The system does not guarantee that iterating pages will cover the entire universe of matching records due to the nature of historical archiving. Always handle the 100-record limit by implementing robust pagination logic that respects the upper bounds defined by the API specification.

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