Reddit Extract
EN

Reddit Extract · GET · JSON

Write a mapping rule you can trace back to its source

Conceptual illustration, not a screenshot or measured result.

Questions about this page

Which request starts this worked example?

Begin with https://api.redditextract.com/v1/search?q=index&subreddit=PostgreSQL&limit=3.

How do I map source fields to my own columns?

Make the mapping readable before you implement it.

When should I select title rather than text?

q searches title and text.

How do I test missing values before converting them?

Preserve identifiers as identifiers.

What should I check in “Account for every input record”?

Keep parent_id and link_id only if returned and useful to your task.

Which retrieval boundaries matter when testing my field mapping?

If you request another page, keep limit and the selection criteria in your request log.

What is Reddit Extract?

Reddit Extract 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 Extract 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 small response as your working input

Begin with https://api.redditextract.com/v1/search?q=index&subreddit=PostgreSQL&limit=3. Send the request from your backend with the domain API key in a supported authentication header. The text query and community scope narrow this particular inspection; the request does not define a random or complete sample. limit=3 is an upper bound for the page, and an empty response is a valid possible outcome.

Save the returned response unchanged with the request parameters, your local retrieval time and the mapping version you intend to test. These are records of your own workflow, not additional API response fields. Keep credentials out of this fixture. The archive is independent and historical, not a live official Reddit interface, and it does not promise that repeating the request later will produce the same objects.

Write the source-to-output ledger

Make the mapping readable before you implement it. A local ledger can name the output column, the observed source property, its accepted type, the action for an absent value and whether the output is copied or derived. For example, content_source can be a local marker saying title or text; source_page can come from your request log. Neither name claims a new field in the API response.

Inspect each returned object rather than inferring its shape from one record. List the properties you actually see, their runtime types and whether they are absent or explicitly null in other objects. Three inspected records can uncover a failing assumption but cannot prove a field is always present. A successful empty page gives no observed record schema at all; keep it as an empty fixture.

Record why you chose title or text

q searches title and text. With several search terms, the terms must match together within a matching field; splitting them between title and text is not enough. For q=index, inspect those fields independently and decide which content to retain. If the body is absent, either keep that absence or use a documented title fallback with its source marker. Do not silently present the fallback as original body text.

Test absence before converting a value

Preserve identifiers as identifiers. If a text property is present, verify that it contains a string before applying your chosen whitespace normalization; retain the original text when auditability matters. An absent property, null and an empty string should remain distinguishable until you explicitly decide how your destination represents them. Do not silently convert a missing score into zero or cast an unexpected object to a textual value that looks valid.

Time conversion requires a verified representation and unit. If created_utc or another time property is present, inspect its value before choosing a conversion; do not divide a number by 1000 merely because your destination expects milliseconds or seconds. For an optional author or score, record a validation failure or a nullable value according to your own contract. Do not infer that every post and comment shares all those properties.

Account for every input record

Keep parent_id and link_id only if returned and useful to your task. They can support a local join, but neither a complete thread nor the presence of every referenced record is guaranteed. They are not exposed search filters. A field extraction job can deliberately leave relationship expansion out, retaining the reference and its unresolved status rather than manufacturing a parent object.

Use clearly labeled synthetic cases to test the choice itself: title only, text only, both present, explicit null and neither property present. Check both the projected value and its source marker. Keep an unchanged input object beside each rejected case and write a local reason. For a mapper that emits at most one row per record, accepted plus rejected records should account for the received records; never confuse these counts with a count of the whole archive.

Choose a reason to fetch another page

If you request another page, keep limit and the selection criteria in your request log. Results follow _doc archive order, not chronological, relevance or score order. min_score only filters. Retrieval is bounded by 100 records per request and 100 pages per query, and exact, lower-bound or unknown totals must not be turned into an exhaustive-coverage claim. A local sort changes only the records you collected.

Budget one credit for every successful page retrieval, including an empty page. A successful response followed by your own parsing failure remains billed; rerunning the mapper on the saved response makes no new request. The price is $1 per 1000 successful requests, with a $50 minimum paid top-up for 50000 credits and an optional conditional 5,000-credit trial. The account panel, not public /v1/status, is where you inspect the domain balance.

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

Python

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

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

Choose a route and keep authentication on the server

The base host is https://api.redditextract.com. /v1/search searches historical posts and comments; /v1/posts and /v1/comments constrain the record kind. Those routes do not require id. /v1/item takes id for one archived record, which may be absent. /v1/subreddits supports community discovery using prefix and limit; it is not a content search or a complete community inventory. The public /v1/status route is a separate, uncharged status response.

Use either X-API-Key with the raw domain key or Authorization: Bearer followed by that key for protected retrievals. Neither format is Reddit OAuth. The key issued for redditextract.com and its balance are specific to this site. A browser login session serves the account panel, not API retrieval. Keep secrets out of frontend bundles, request examples, committed fixtures and transformation logs.

The PostgreSQL inspection request uses /v1/search?q=index&subreddit=PostgreSQL&limit=3. q is text search, not a way to submit arbitrary query syntax. Supported content filters are q, subreddit, author, kind, from, to, min_score, limit and page. from and to accept YYYY-MM-DD dates in UTC and filter created_utc; the entire to day is included; limit and page range from 1 to 100. Do not add fields, parent_id or link_id as query filters: those controls are not exposed.

Inspect the object and define your own destination types

Flat records are the API input to your mapper, not a promise of a universal destination schema. Check property presence separately from null and verify the runtime type before conversion. If your table needs record_id or body_text, document which available source property supplies it and what you do when that property is absent. Those names are your local aliases, not new API fields or server-side projection options.

Keep identifier values without numeric coercion. Validate a score before storing it as a number; do not treat missing values as zero. For a time field, establish its representation and units before converting it to your application format. Preserve the source value beside a derived value when that helps diagnose a conversion. Do not assume every object contains a title, text, author, timestamp or score merely because those concepts are useful to your application.

Retrieval uses archive _doc order, which is neither chronological, relevance, nor score order. Pagination supports up to 100 records per request and 100 pages per query. Bounded page iteration does not guarantee full coverage, complete ingestion, or that all matching records are returned. Always treat retrieved data as a bounded sample.

Totals must be read with their reported relation: eq denotes an exact count, gte a lower bound, and unknown the absence of a reliable total, which can be null. None of these descriptions establishes full archive coverage. min_score remains a threshold filter, never a score-sort control. Use observed pages as bounded input and maintain your own record of successful retrievals and local validation failures.

Handle request failures independently of transformation failures

HTTP 400 identifies an invalid request, 401 a missing or invalid key, 402 insufficient credit, and 429 a rate limit. Correct invalid parameters or credentials rather than repeating the same request unchanged. A local parsing exception is not an HTTP failure: keep the response and diagnose your mapper first. Public /v1/status only reports a static historical-archive disclosure and that the HTTP server responds; it does not check search health or record availability.

One successful retrieval costs one credit even if the returned list is empty. Requests rejected before retrieval do not purchase records; an upstream failure refunds the reserved credit. A successful response followed by a failure in your application is still a successful billed retrieval. Reprocessing the saved response locally avoids another API call, whereas requesting it again can incur another credit. Use the account panel on the key page to inspect your domain balance.

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