Reddit API Labs
Reddit API Labs
  1. Before counting replication discussions, define what counts

    Explore replication in r/science through a documented archive pilot. Separate the search rule, the records received and your interpretation.

    Get API key

Request example

cURL

curl --fail-with-body -H "Authorization: Bearer YOUR_API_KEY" "https://api.redditapilabs.com/v1/search?q=replication&subreddit=science&limit=3"

A word match is the start of the experiment

For research engineers studying discussion of scientific replication, the first decision is linguistic: does a record concern repeating a study, DNA replication, or something unclear? Reddit API Labs reads an independent historical Reddit archive, without official affiliation or live updates. It supplies material for that decision; it does not make the scientific classification. Start the notebook with the question you can answer from the records actually received.

Give each collection attempt a local run identifier and record the route, filters, page size, page number and retrieval time in your own notes. The identifier is yours, not an archive-issued snapshot token. Keep the actual response separately from cleaned text, exclusions and annotations. A list of parameters describes an attempted selection; it cannot substitute for the received records when explaining the input to an analysis.

The first page is a pilot specimen

Use GET https://api.redditapilabs.com/v1/search?q=replication&subreddit=science&limit=3. q=replication supplies a text search, subreddit=science restricts the community and limit=3 requests at most three records. It does not identify scientifically valid studies or run a replication test. Without kind, search can return posts and comments; the default page is one. Authenticate server-side with X-API-Key: <key> or Authorization: Bearer <key>; both accept this domain's archive key.

q searches title and text. With several terms, operator and requires the terms within a matching field; distributing them between title and text does not necessarily match. Changing replication to replication crisis changes the selection. Record that change as a separate pilot, rather than treating the narrower wording as proof that irrelevant meanings have disappeared.

Synthetic response excerpt for demonstration only: {"data":[],"pagination":{"page":1,"limit":3,"total":0,"relation":"eq"},"credits":{"cost":1,"balance":99}}. No real request produced this example and the balance is fictional. An empty first page can have an exact query total of zero and still costs one credit. It does not prove that replication was never discussed in science or that the archive contains all relevant records.

Keep a record of what entered the analysis

Save your actual response before transforming fields and note whether collection succeeded, failed or had an uncertain outcome. Flat records may omit fields; present parent_id and link_id allow local grouping without guaranteed complete conversations. Keep missing values distinct from zero or empty text. Your protocol should describe the transformations your code performs, rather than attribute local cleaning, sentiment classification or statistical testing to the API.

Reprocessing saved responses locally and collecting them again remotely are different experiments. The first uses the copy you retained with your code and dependencies; the second is a new archive request with no guaranteed equality, similarity or bound on differences. Neither a matching local file hash nor a detailed notebook proves full coverage or representative sampling. They help identify the particular material and decisions behind your own result.

Set a stopping rule before enlarging the pilot: for example, inspect one page, revise the coding rule, then decide whether collection is justified. Retrieval permits at most 100 records per request and 100 pages per query. _doc order is neither chronological, relevance nor score order; the first three records are not the most important three.

Decide whether the next step needs another request

Each successful retrieval, including empty or repeated responses, costs one credit: $1 per 1000 requests. Invalid requests do not debit; upstream failures refund reservations. A client timeout can conceal a charged success, and another successful attempt costs another credit. A failed local transformation does not reverse that charge. Record remote attempts separately from successful local processing and keep secrets out of research logs.

Continue locally if the next task is to annotate the saved text. Open the guide to write inclusion decisions; use the documentation to check parameters. If another retrieval is necessary, the key page handles access and the pricing page explains credits. Neither more calls nor a longer notebook turns an incomplete archive selection into a representative population.