Reddit Data Stream
EN

Reddit Data Stream · GET · JSON

Schedule a batch you can inspect and recover locally

Conceptual illustration, not a screenshot or measured result.

Questions about this page

What should the batch job record before it starts?

Define one run as a finite set of requests and an output handoff.

Why keep an untouched copy of the response?

Use X-API-Key: <key> or Authorization: Bearer <key> on the server and keep the header out of the saved metadata.

How do I serialize accepted records into JSONL?

Validate that data is an array.

What can the inspected page actually prove?

Use at most 100 records per request and pages 1–100 per query.

When may the downstream task consume the file?

Write a temporary output first and expose the completed file to the downstream task only after your checks succeed.

How do I recover from a failed local processing stage?

If transformation fails after the response was saved, replay that local copy.

What is Reddit Data Stream?

Reddit Data Stream 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 Data Stream 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.

Write the run contract before the schedule

Define one run as a finite set of requests and an output handoff. For the first run, choose the homepage request /v1/posts?subreddit=apacheairflow&limit=3&page=3, a destination directory and a maximum number of attempts. Give the run a local identifier. Your scheduler may repeat this plan, but Reddit Data Stream remains an independent historical archive, not an official Reddit feed or a service that executes your schedule.

When adding periods, write from and to explicitly as YYYY-MM-DD in UTC; the full to day is included. These filters concern record creation, not arrival in the archive. Store the exact bounds with the run rather than deriving the next start from the last returned timestamp. Use /v1/comments for a separate comment batch when needed. Shared dates do not make those comments a complete conversation with the posts.

Stage the received response

Use X-API-Key: <key> or Authorization: Bearer <key> on the server and keep the header out of the saved metadata. Check the HTTP result, then save the received JSON response before transforming it. Record the requested path, page and local attempt time alongside it. Mark this stage complete only after that save succeeds. A received response and a published JSONL file are distinct checkpoints in your implementation, not a transaction provided by the API.

Convert records and account for exclusions

Validate that data is an array. Serialize each accepted record as one JSON value followed by one line break, for example with json.dumps(record, ensure_ascii=False) in Python. Let the serializer escape newlines inside post text. Do not split raw text into rows or write the whole response envelope as a post. Keep pagination and credits with the original response or local manifest, outside the record lines.

Read the output back as JSONL and compare the written line count with your accepted-record count. Preserve missing fields as missing instead of inventing values. If a local rule rejects a record, save the reason separately and report how many were excluded. Flat parent_id or link_id references may support optional local grouping when present; they neither supply missing ancestors nor guarantee complete conversations.

Stop at the query boundary

Use at most 100 records per request and pages 1–100 per query. Read pagination.total together with relation: eq is exact for that query, gte is a lower bound and unknown can accompany null. Preserve has_more and window_exhausted when returned. Neither an exact total nor traversal of the allowed pages establishes exhaustive retrieval. _doc is internal document order, not chronology, score or relevance; a page number is not a stable restart cursor.

If the batch needs text filtering, q matches title or text with AND between query terms within a matching field. Terms spread across two fields do not by themselves satisfy that condition. min_score applies a minimum score filter only; it does not rank output. Save the chosen query with the batch so a later reader can understand why particular records could have been excluded before local transformation began.

Publish a file together with its manifest

Write a temporary output first and expose the completed file to the downstream task only after your checks succeed. The accompanying local manifest can list request parameters, input and output paths, accepted and rejected counts, and the stopping reason. Label an empty success explicitly: it produces zero record lines and still has a retrieval outcome. Publish the file and manifest according to your storage system's own rules; naming or renaming files alone does not establish exactly-once delivery.

Recover from the stage that actually failed

If transformation fails after the response was saved, replay that local copy. It makes no archive request. A fresh remote retrieval is different: every success, including empty results, costs one credit. Invalid requests do not debit; upstream failures refund reservations. A lost client response can conceal a charged success, and another successful attempt costs another credit. Record that uncertainty instead of labelling all timeouts free. Correct 400 parameters, check the key and domain for 401, check balance for 402 and bound delayed retries for 429.

Review the manifest before scheduling the next batch. Documentation supplies route details and pricing explains the $1 per 1000 successful requests and $50 minimum for 50000 paid credits. The key page handles access and invoices. Public /v1/status is a static service disclosure, not an upstream health check or evidence that your local file was delivered.

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.redditdatastream.com/v1/posts' \
  -H "Authorization: Bearer ${REDDIT_API_KEY}" \
  --data-urlencode 'subreddit=apacheairflow' \
  --data-urlencode 'limit=3' \
  --data-urlencode 'page=3'

Python

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

params = urlencode({"subreddit":"apacheairflow","limit":"3","page":"3"})
request = Request(
    "https://api.redditdatastream.com/v1/posts?" + 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({"subreddit":"apacheairflow","limit":"3","page":"3"});
const response = await fetch(
  "https://api.redditdatastream.com/v1/posts?" + 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": 3,
    "limit": 3,
    "total": null,
    "relation": "unknown",
    "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

Protected reads and the public status exception

Protected reads use GET under https://api.redditdatastream.com with X-API-Key: <key> or Authorization: Bearer <key>. Both alternatives carry this domain's archive key, not a Reddit OAuth token. Keep the secret server-side. The account panel's Secure HttpOnly session cookie is separate from retrieval authentication. The service provides discrete JSON responses rather than a live SSE stream, WebSocket connection or subscription to Reddit events.

/v1/search searches posts and comments. /v1/posts constrains results to posts and /v1/comments to comments. 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 through search. q is text search, without arbitrary query DSL, sentiment classification or server-side custom analytics.

/v1/item?id=... requires id only and looks for one archived record, which may be absent. It does not walk parents or replies. /v1/subreddits accepts prefix and limit only for community-name discovery, without page traversal or guaranteed globally exact counts. /v1/status is public and uncharged: its static scope disclosure confirms that the HTTP application responds, without checking search availability, record freshness, key validity or balance.

Dates, document order and local serialization

from and to accept YYYY-MM-DD in UTC and filter created_utc, not when a record entered the archive. The complete final to day is included. These are day filters, not intraday cursor values. If you divide work by date, record the actual bounds and distinguish your job's processing time from source creation time. Such partitioning does not prove exhaustive retrieval or a schedule of archive updates.

min_score sets a numeric score threshold without sorting or assessing advice quality. Retrieval follows internal _doc order, not insertion time, chronology, relevance or score. The last record on a page is therefore not a guaranteed chronological watermark. Local sorting can organize the received records, but cannot establish that every earlier record was received or every later record will appear in a future request.

Content records are flat and fields may vary. Present parent_id and link_id may support local grouping, without complete ancestry or conversations. Neither is an exposed search filter. Responses contain data, pagination and credits. Your application can serialize individual data records into local JSONL, keeping pagination and credits separate. This is local processing, not a server-side stream, export switch or guarantee of a fixed source schema.

Page boundaries, totals and failure handling

Content routes accept limit and page from 1 to 100, one page per request. page=3 does not return three pages together. Numbering is not a stable cursor or event sequence, and page=101 is unsupported for the same query. Smaller windows and local deduplication can organize work without proving complete coverage, unique records or unchanged repeated results. A local checkpoint or completed file does not establish lossless resume.

Read pagination.total with relation: eq means an exact query total, gte a lower bound and unknown no reliable total, possibly null. An empty page after page one can return unknown rather than a count of zero. An exact total does not prove that all matches were downloaded or that the archive contains all history. Preserve returned has_more and window_exhausted as boundary signals, not unlimited-export tokens.

HTTP 400 concerns invalid parameters, 401 a missing or invalid key, 402 insufficient credits and 429 a frequency limit. Invalid requests do not debit; upstream failures refund reservations. Every successful retrieval costs one credit, even empty or repeated. Response loss may conceal a billed success, and a local processing failure does not refund it. Save the received response before advancing local progress and budget successful retries separately.

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