Reddit API Gateway
EN

Reddit API Gateway · GET · JSON

Follow the key through one onboarding job

Conceptual illustration, not a screenshot or measured result.

Questions about this page

How do I distinguish the caller, the job and the paying account?

Treat the onboarding feature as three identities: the signed-in product user, your internal job and the domain account charged for archive reads.

How do I build only the supported read request?

For the first job, fix the destination host and permit the intended search route.

How do I decide whether a failed request may be retried?

Assign the job an internal identifier and a small attempt allowance.

Why keep an untouched copy of the response?

Save the received payload before transforming it for the screen.

What happens when I regenerate the key?

Prepare a replacement procedure that stops new product jobs while the credential changes.

What should count as an accepted integration?

Finally, run the small permitted job and examine the actual outcome.

What is Reddit API Gateway?

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

Separate the person, the job and the paying account

Treat the onboarding feature as three identities: the signed-in product user, your internal job and the domain account charged for archive reads. Connect the first two in your own backend. The browser should receive the permitted result, not the shared retrieval credential. Otherwise one copied key can start paid work outside the limits you placed on the screen.

Do not place the secret in browser JavaScript, public repositories, request URLs or diagnostic output. Use protected server configuration, such as environment variables or a secrets manager, and ensure error handling does not print the header. Merely moving a secret into an environment variable does not guarantee security. Review where your own application reads, forwards and logs it, including build and deployment processes.

Build one permitted archive request

For the first job, fix the destination host and permit the intended search route. Construct q=onboarding, subreddit=SaaS and limit=3 from validated inputs, then add the key only at the outbound request boundary. Do not forward a visitor-supplied URL with that header attached. Local permission checks must happen before this step.

Start with https://api.redditapigateway.com/v1/search?q=onboarding&subreddit=SaaS&limit=3, the homepage example. Your server can fix the archive host and permitted routes, validate inputs and insert X-API-Key: <key> or Authorization: Bearer <key>. Both work with the archive key. Do not accept an arbitrary visitor-supplied target URL for a credentialed request. The account panel's Secure HttpOnly cookie is a separate authentication mechanism.

Record attempts before deciding to retry

Assign the job an internal identifier and a small attempt allowance. Record the route, filters, attempt number and outcome without authentication headers. An example policy permits three attempts in total, including page changes and repeats. This is a product rule you implement; the archive supplies neither that per-user quota nor an authoritative job ledger.

Walk through an awkward outcome: an empty successful first call spends one credit; the next call loses its response and may still have spent another; a successful retry spends a further credit. Do not record the lost response as a free failure. Upstream failures refund reservations, while a local parsing or storage error does not undo a charged success.

Store the response before interpreting it

Save the received payload before transforming it for the screen. Records are flat; absent fields and unresolved parent_id or link_id references must remain possible. Local grouping cannot establish complete conversations. If adding dates, use YYYY-MM-DD in UTC with to inclusive. q matches title and text with AND terms within a matching field; min_score filters, and _doc order is neither ranking nor chronology.

Replace the credential without an overlap assumption

Prepare a replacement procedure that stops new product jobs while the credential changes. After signed-in password confirmation, regeneration invalidates the previous key immediately. Update the processes that send archive requests before resuming them; there is no overlap window to depend on. Restrict secret access and remove it from diagnostics during this handover as well.

A local request limit only controls traffic through your backend. It cannot constrain someone using an exposed key directly. Compare your attempt ledger with the account context when investigating unusual use, but do not infer a leak from volume alone or promise that rotation recovers spent credits. Protect the password too: no password-reset or emailed-key workflow is supplied.

Check the complete path with a small job

Finally, run the small permitted job and examine the actual outcome. Treat 400 as parameters, 401 as credentials, 402 as balance and 429 as request frequency before choosing a next action. Retrieval is bounded to 100 records per request and 100 pages per query, without complete coverage. Public /v1/status is static scope information, not a probe of archive health. A saved sample and a recorded decision to stop are valid product outcomes.

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

Python

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

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

Keep retrieval and account access separate

Protected data requests use GET under https://api.redditapigateway.com. Both X-API-Key: <key> and Authorization: Bearer <key> are accepted alternatives. Use this domain's archive key rather than Reddit OAuth credentials. Keep the secret in protected server configuration and out of public code, URLs and diagnostic logs. An archive key does not encode the roles or budgets of your product's own users.

The account panel on the key page uses email/password access and a Secure HttpOnly session cookie. This is separate from the key header used by your application's retrieval requests. The widget keeps invoice and user identifiers in localStorage per hostname for invoice recovery, not the raw API key. HttpOnly applies to the session cookie, not localStorage. Signing into the panel does not authenticate a separate data client.

/v1/status is public, uncharged and requires no key. It gives a static disclosure of the historical service and confirms that the HTTP application responds. It does not probe the search backend, record availability, usage or balance. Do not turn that response into a product quota check or search-readiness guarantee. Read actual retrieval responses and inspect account balance in the account panel for their respective purposes.

Use each route's documented parameters

/v1/search searches posts and comments. /v1/posts adds a post constraint and /v1/comments a comment constraint. All three accept q, subreddit, author, kind, from, to, min_score, limit and page, not id. kind accepts post or comment; omit it to allow both kinds through search. q is text search rather than arbitrary query DSL, a sentiment classifier or custom server-side analytics.

/v1/item?id=... requires id only and looks for a single archived record, which may be absent. It does not retrieve parents or replies automatically. /v1/subreddits accepts prefix and limit only for community-name discovery, without page traversal or globally exact counts guaranteed. prefix is not a content-route filter. Neither route accepts an arbitrary Reddit URL to crawl or a request for a complete conversation.

from and to require YYYY-MM-DD dates in UTC and filter created_utc rather than archive ingestion time; the final to day is fully included. min_score is a numeric score threshold, without sorting or quality assessment. Content records are flat, and fields may vary. Present parent_id and link_id can support local grouping but are not query filters and do not establish complete ancestry.

Apply page boundaries and billing semantics

Content searches allow limit and page from 1 to 100, one page per request. Results follow internal _doc order, not insertion time, chronology, relevance or score. Local sorting only reorganizes what was received. Smaller intervals, page iteration and local deduplication cannot prove complete coverage or unique records. The archive offers no guaranteed fixed schema, immutable response or permanent record availability.

Responses contain data, pagination and credits. Read pagination.total with relation: eq means an exact query total, gte a lower bound and unknown no reliable total, possibly null. An exact count does not prove all matches were downloaded or all Reddit history is represented. Preserve returned has_more and window_exhausted as boundary signals. The reported balance is not a per-user quota or a future-credit reservation.

Each successful retrieval costs one credit, even empty. Additional pages and successful repeats each have their own cost. Invalid requests do not debit; upstream failures refund reservations. A client disconnect may follow a charged success, and a local processing failure does not refund that success. HTTP 400 concerns parameters, 401 the key, 402 the balance and 429 frequency. Budget retries separately and save responses before advancing a local job.

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