# Reddit Historical Archive Scraper (`automation-lab/reddit-historical-archive-scraper`) Actor

🗄️ Export old Reddit posts and comments by subreddit, author, keyword, score, and date range from a public archive — no login or API key.

- **URL**: https://apify.com/automation-lab/reddit-historical-archive-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Social media
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Reddit Historical Archive Scraper

Export old Reddit posts and comments by subreddit, author, keyword, score, and date range.

The **Reddit Historical Archive Scraper** turns a bounded historical window into clean datasets for research, social listening, OSINT, moderation analysis, NLP, and data backfills.

It reads the public Arctic Shift archive directly.
No Reddit login, OAuth app, API key, cookie, or proxy is required.

- 🗓️ Search exact UTC date windows instead of only recent Reddit listings.
- 🧵 Export both historical posts and historical comments.
- 🎯 Narrow by subreddit, author, keyword, and minimum score.
- 📦 Keep posts and comments in separate run-scoped datasets.
- 🔁 Schedule repeatable archive exports or call them through API and MCP.
- 💾 Download JSON, CSV, Excel, XML, HTML, or JSONL from Apify.

[Run Reddit Historical Archive Scraper](https://apify.com/automation-lab/reddit-historical-archive-scraper)

### What does Reddit Historical Archive Scraper do?

Reddit's normal listings emphasize recent content and expose limited history.
This Actor queries a historical archive so you can backfill older conversations within an explicit date window.

For every matching post, it can return:

- title and selftext;
- author and subreddit;
- UTC and ISO timestamps;
- score, upvote ratio, and comment count;
- flair, domain, permalink, and outbound URL;
- NSFW, self-post, video, locked, sticky, and spoiler flags.

For every matching comment, it can return:

- full comment body;
- author and subreddit;
- UTC and ISO timestamps;
- score and controversiality;
- post ID and parent ID;
- permalink, submitter status, and award count.

Every row includes the archive request URL and the requested filters for reproducibility.

### Who is this Reddit archive extractor for?

#### Researchers and academics

Create bounded historical samples for discourse, community, event, and longitudinal studies.
Preserve the exact requested dates and provenance with each row.

#### Social-listening teams

Backfill brand or topic mentions in selected communities.
Schedule fixed windows to maintain an internal historical corpus.

#### OSINT analysts

Trace public discussions around known authors, communities, events, or phrases without relying on current Reddit search ranking.

#### ML, NLP, and RAG builders

Export flat text records for sentiment classification, topic modeling, retrieval, evaluation, or training-data preparation.

#### Moderators and community teams

Review old high-scoring posts, archived comments, recurring themes, or author activity in a defined period.

### Why use this historical Reddit scraper?

- ✅ **Historical depth** — query date windows that ordinary listings may not expose.
- ✅ **No credentials** — no Reddit developer application or personal account is needed.
- ✅ **Bounded jobs** — every run requires an after date, before date, and subreddit or author.
- ✅ **Analysis-ready records** — numbers remain numbers, booleans remain booleans, and timestamps include ISO values.
- ✅ **Two datasets** — posts and comments stay separate instead of creating a sparse mixed table.
- ✅ **Resilient requests** — transient failures use bounded backoff and rate-limit headers.
- ✅ **Deduplication** — duplicate archive IDs are removed within a run.
- ✅ **Apify workflows** — use schedules, webhooks, integrations, API clients, and MCP.

### What Reddit data can you extract?

| Data group | Example fields | Why it helps |
|---|---|---|
| Identity | `recordType`, `redditId`, `author`, `subreddit` | Join, group, and deduplicate records |
| Time | `createdUtc`, `createdAt` | Build timelines and time-series analyses |
| Engagement | `score`, `numComments`, `upvoteRatio` | Rank and filter archived discussions |
| Post text | `title`, `selftext`, `linkFlairText` | Topic, intent, and sentiment analysis |
| Comment text | `body`, `linkId`, `parentId` | Conversation and reply analysis |
| URLs | `permalink`, `url`, `sourceUrl` | Trace records back to Reddit and the archive query |
| Flags | `over18`, `locked`, `stickied`, `spoiler` | Segment moderation and content states |
| Provenance | `requestedAfter`, `requestedBefore`, filter fields | Reproduce an export later |

Optional source fields are omitted when the archive has no value.
Required identity and timestamp fields are always present for saved rows.

### How to scrape old Reddit posts and comments

1. Open the Actor input page.
2. Choose **Posts**, **Comments**, or both under Record types.
3. Enter at least one subreddit or author.
4. Set the **After date** and **Before date** in `YYYY-MM-DD` format.
5. Optionally enter a keyword and minimum score.
6. Choose oldest-first or newest-first ordering.
7. Set a safe maximum number of archive records.
8. Click **Start**.
9. Open **Posts** or **Comments** in the Output and Storage views.
10. Export the dataset or connect it to your next workflow.

A one-day window and 20-record cap are prefilled for a fast first run.

### Input parameters

| Input | Type | Required | Description |
|---|---|---:|---|
| `recordTypes` | array | No | `posts`, `comments`, or both; default is both |
| `subreddits` | string array | Conditional | Names without `r/`; at least a subreddit or author is required |
| `authors` | string array | Conditional | Usernames without `u/`; combines with subreddit when both are set |
| `keyword` | string | No | Matches post title/selftext or comment body within the selected scope |
| `after` | date string | Yes | Inclusive UTC lower bound in `YYYY-MM-DD` |
| `before` | date string | Yes | Exclusive UTC upper bound in `YYYY-MM-DD` |
| `minScore` | integer | No | Save only records with this score or higher |
| `sort` | string | No | `asc` for oldest first or `desc` for newest first |
| `maxItems` | integer | No | Global output limit across posts and comments |
| `batchSize` | integer | No | Archive records requested per page, from 1 to 100 |
| `maxPages` | integer | No | Global request safety limit; default 100 pages |

Keyword and score filters are applied to fetched archive pages before records are saved. Sparse filters may inspect more records than they return, so `maxPages` prevents unbounded scans.

When both subreddit and author lists are supplied, the Actor evaluates each subreddit-author combination.
Keep arrays focused to avoid a large cross-product.

### Example inputs

#### Export posts and comments from one subreddit

```json
{
  "recordTypes": ["posts", "comments"],
  "subreddits": ["python"],
  "after": "2024-01-01",
  "before": "2024-01-02",
  "maxItems": 100
}
````

#### Export one author's old posts

```json
{
  "recordTypes": ["posts"],
  "authors": ["spez"],
  "after": "2023-01-01",
  "before": "2024-01-01",
  "sort": "asc",
  "maxItems": 200
}
```

#### Find keyword-matching historical comments

```json
{
  "recordTypes": ["comments"],
  "subreddits": ["technology"],
  "keyword": "privacy",
  "after": "2024-01-01",
  "before": "2024-02-01",
  "minScore": 1,
  "maxItems": 1000
}
```

### Output datasets

The Actor defines two run-scoped datasets.
They belong to the current run and follow its retention settings.

- **Posts** uses the default dataset alias.
- **Comments** uses the `comments` dataset alias.

This design prevents post-only and comment-only columns from being mixed into one sparse table.
The Run page's main Export button exports Posts; use the Storage dataset picker for Comments.

### Example post output

```json
{
  "recordType": "post",
  "redditId": "18vks3q",
  "author": "friendlyfitnessguy",
  "subreddit": "Python",
  "createdUtc": 1704068225,
  "createdAt": "2024-01-01T00:17:05.000Z",
  "score": 0,
  "permalink": "https://www.reddit.com/r/Python/comments/18vks3q/",
  "title": "code competition topics",
  "numComments": 0,
  "over18": false,
  "isSelf": true,
  "isVideo": false,
  "locked": false,
  "stickied": false,
  "spoiler": false,
  "totalAwardsReceived": 0,
  "requestedAfter": "2024-01-01",
  "requestedBefore": "2024-01-02"
}
```

### Example comment output

```json
{
  "recordType": "comment",
  "redditId": "kfrp2h4",
  "author": "startup_biz_36",
  "subreddit": "Python",
  "createdUtc": 1704067267,
  "createdAt": "2024-01-01T00:01:07.000Z",
  "score": 1,
  "body": "yeah when dealing with big datasets...",
  "linkId": "18vgrc9",
  "parentId": "t3_18vgrc9",
  "controversiality": 0,
  "isSubmitter": false,
  "locked": false,
  "stickied": false,
  "totalAwardsReceived": 0
}
```

### How much does it cost to scrape historical Reddit data?

The Actor uses pay-per-event pricing:

- a small one-time start charge covers input validation and run startup;
- each saved historical post or comment is one result event;
- Apify subscription tiers receive volume discounts shown on the Pricing tab.

You are not charged a result event for duplicate IDs, filtered-out rows, or empty archive pages.
Set `maxItems` to control the maximum number of billable records before starting.

The Apify Free plan includes platform credits, so small test exports may fit within your available credits.
Check the live Pricing tab for the exact price applicable to your account tier.

### Pagination, ordering, and deduplication

Arctic Shift returns bounded pages ordered by creation timestamp.
The Actor advances a timestamp cursor until it reaches the requested date boundary, `maxItems`, or the `maxPages` safety limit.

- `asc` starts at the After date and moves forward.
- `desc` starts at the Before date and moves backward.
- IDs are deduplicated separately for posts and comments.
- `maxItems` applies across every selected type and scope.
- `maxPages` bounds source requests when keyword or score filters are sparse.
- A safe request-time budget stops very broad or slow archive scans before the Apify run timeout, preserving all records already saved.
- Keyword matching is case-insensitive against post title/selftext or comment body.
- Transient HTTP failures are retried a limited number of times.

An upstream outage fails clearly instead of silently falling back to a login-dependent Reddit surface.

### Tips for reliable archive exports

- 🎯 Start with one subreddit, a short date window, and a low `maxItems`.
- 🗓️ Split multi-year research into monthly or yearly runs for simpler checkpoints.
- 🔍 Combine a keyword with a subreddit or author; the archive does not allow unbounded global full-text searches.
- 📊 Use `minScore` to reduce low-engagement records after validating the source coverage.
- ↕️ Use oldest-first ordering for incremental backfills.
- 💾 Save the requested dates with your downstream job state.
- 🔁 Schedule non-overlapping windows to avoid downloading the same archive period repeatedly.
- 🧪 Review both dataset schemas before importing them into a strict database.

### Integrations and automation workflows

#### Google Sheets and data warehouses

Export CSV for a one-off analysis, or use the Dataset API to load rows into BigQuery, Snowflake, PostgreSQL, or a lakehouse.

#### Make, Zapier, and n8n

Start the Actor on a schedule, wait for completion, then route post and comment dataset items into dashboards, alerts, or storage.

#### Webhooks

Attach a run-succeeded webhook to trigger sentiment analysis, embedding generation, moderation review, or an ETL job.

#### Research pipelines

Run one date partition per task, preserve the input JSON and `sourceUrl`, and merge results by `recordType + redditId`.

#### Social-listening backfills

Use a keyword plus selected brand-relevant communities, then enrich the returned text with your taxonomy or classifier.

### Run with the Apify API using cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~reddit-historical-archive-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "recordTypes": ["posts", "comments"],
    "subreddits": ["python"],
    "after": "2024-01-01",
    "before": "2024-01-02",
    "maxItems": 100
  }'
```

Keep tokens in environment variables or a secret manager.
Do not commit them to source control.

### Run with the Apify JavaScript client

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/reddit-historical-archive-scraper').call({
  recordTypes: ['posts', 'comments'],
  subreddits: ['python'],
  after: '2024-01-01',
  before: '2024-01-02',
  maxItems: 100,
});

const posts = await client.dataset(run.defaultDatasetId).listItems();
console.log(posts.items);
```

Use the run's storage mapping to access the Comments dataset when comments are enabled.

### Run with the Apify Python client

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("automation-lab/reddit-historical-archive-scraper").call(run_input={
    "recordTypes": ["posts"],
    "authors": ["spez"],
    "after": "2023-01-01",
    "before": "2024-01-01",
    "maxItems": 200,
})

posts = client.dataset(run["defaultDatasetId"]).list_items().items
print(posts)
```

Poll asynchronous runs when your application cannot wait for a long historical export.

### Use Reddit Historical Archive Scraper with MCP

Apify's MCP server lets Claude Code, Claude Desktop, Cursor, VS Code, and other MCP clients call the Actor as a tool.

#### Claude Code

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=automation-lab/reddit-historical-archive-scraper"
```

#### Claude Desktop, Cursor, or VS Code

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/reddit-historical-archive-scraper"
    }
  }
}
```

Example prompts:

- “Export the top historical Python subreddit posts from January 2024.”
- “Find archived privacy comments in r/technology and summarize recurring concerns.”
- “Build a JSON dataset of one author's public Reddit posts during 2023.”
- “Compare historical comment themes across two bounded monthly runs.”

### Scheduling historical Reddit backfills

Use an Apify Schedule for repeatable partitions.
For example, run a closed monthly window after the archive has had time to ingest it.

A practical incremental pattern is:

1. Store the end of the last successful window.
2. Use that date as the next run's `after` value.
3. Set a later non-overlapping `before` date.
4. Keep oldest-first ordering.
5. Merge downstream by `recordType + redditId`.
6. Alert if a run fails because the community archive is unavailable.

Do not use a moving unbounded window; explicit dates make reruns auditable.

### Data source, freshness, and limitations

This Actor depends on the community-maintained Arctic Shift archive.
It is not operated by Reddit or Apify and has no guaranteed uptime or completeness SLA.

Archive coverage can differ by year, subreddit, author, deletion state, or ingestion lag.
Scores and comment counts reflect the archived record and may not match today's live Reddit values.
Deleted or removed content may be absent, partially preserved, or marked with source placeholders.

The Actor does not:

- log in to Reddit;
- bypass private communities or access controls;
- recover content missing from the archive;
- promise real-time Reddit monitoring;
- enrich records from a separate live Reddit API;
- reconstruct nested comment trees beyond parent and link identifiers.

Use a live Reddit scraper when freshness matters more than deep historical coverage.

### Is scraping historical Reddit data legal?

This Actor accesses a public archive endpoint and returns public-facing archive records.
Whether a particular use is lawful depends on your jurisdiction, purpose, retention, and handling of personal data.

You are responsible for:

- following applicable laws and contractual obligations;
- respecting privacy, deletion, and data-subject requests;
- applying appropriate minimization and retention controls;
- avoiding harassment, profiling, doxxing, or harmful surveillance;
- verifying that your downstream use has a valid legal basis.

Public availability does not remove ethical or compliance responsibilities.
Consult qualified counsel for regulated or high-risk projects.

### FAQ

#### Can I scrape Reddit history without an API key?

Yes.
This Actor reads an anonymous public archive and does not require Reddit OAuth credentials.

#### How far back can it search?

As far as Arctic Shift has records for the chosen subreddit, author, and date window.
Coverage is not guaranteed for every period.

#### Can I search all Reddit globally by keyword?

No.
To protect the archive from unbounded work, this Actor requires at least one subreddit or author.
Keyword searches stay inside that scope.

#### Why did my successful run return no records?

The selected archive window and filters may have no matching records.
Try a known active subreddit, shorten or adjust the dates, remove `minScore`, and verify spelling without `r/` or `u/` prefixes.

#### Why did the run fail with an archive error?

Arctic Shift may be temporarily unavailable or rate-limited.
The Actor already performs bounded retries; rerun later rather than switching to a login-dependent source.

#### Are comments included automatically?

Both Posts and Comments are preselected.
You can disable either record type to focus the run and reduce output.

#### Where are comments in the output?

Open the run's Storage tab and choose the **Comments** dataset.
Posts remain in the default dataset used by the Run page Export button.

#### Are result rows deduplicated?

Yes, within each run by `recordType + redditId`.
Deduplicate across separate runs downstream if their date windows overlap.

#### Can it return a full threaded conversation?

It returns `linkId` and `parentId`, which let you reconstruct relationships when all required comments are present.
It does not guarantee every branch exists in the archive.

#### Can I schedule it?

Yes.
Use Apify Schedules with fixed non-overlapping date windows for periodic historical exports.

### Related Reddit scrapers

- [Reddit Scraper](https://apify.com/automation-lab/reddit-scraper) — scrape live Reddit posts, comments, searches, and current community data.
- [Reddit Historical Archive Scraper](https://apify.com/automation-lab/reddit-historical-archive-scraper) — use this Actor for bounded historical archive exports.

Choose the live Reddit scraper for current activity and this archive scraper for old date-range backfills.

### Support

If a run behaves unexpectedly, include:

- the run URL;
- the exact input without secrets;
- the expected subreddit, author, and date window;
- whether Posts, Comments, or both were selected;
- a sample missing or malformed record ID.

This makes it easier to distinguish an Actor issue from an archive coverage or availability issue.

# Actor input Schema

## `recordTypes` (type: `array`):

Select historical Reddit entity types. Posts go to the default dataset and comments to the Comments dataset.

## `subreddits` (type: `array`):

Enter subreddit names without r/, for example python. At least one subreddit or author is required.

## `authors` (type: `array`):

Optionally enter Reddit usernames without u/. When subreddits are also set, both constraints apply.

## `keyword` (type: `string`):

Optionally match post titles/selftext and comment bodies inside the selected subreddit or author scope.

## `after` (type: `string`):

Return records created on or after this UTC date in YYYY-MM-DD format.

## `before` (type: `string`):

Return records created before this UTC date in YYYY-MM-DD format. It must be later than After date.

## `minScore` (type: `integer`):

Only save records whose numeric Reddit score is at least this value.

## `sort` (type: `string`):

Sort archive records from oldest to newest or newest to oldest.

## `maxItems` (type: `integer`):

Stop after this many posts and comments combined. Duplicate archive IDs do not count.

## `batchSize` (type: `integer`):

Records requested per Arctic Shift API page. Lower values reduce retry work during upstream instability.

## `maxPages` (type: `integer`):

Safety limit across all scopes. Keyword and score filters are applied locally, so sparse searches may inspect more rows than they save.

## Actor input object example

```json
{
  "recordTypes": [
    "posts",
    "comments"
  ],
  "subreddits": [
    "python"
  ],
  "authors": [],
  "keyword": "",
  "after": "2024-01-01",
  "before": "2024-01-02",
  "minScore": 0,
  "sort": "asc",
  "maxItems": 20,
  "batchSize": 20,
  "maxPages": 20
}
```

# Actor output Schema

## `posts` (type: `string`):

Flat historical post rows with text, engagement, flags, links, requested filters, and archive request provenance.

## `comments` (type: `string`):

Flat historical comment rows with body text, post/parent IDs, engagement, requested filters, and archive request provenance.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "recordTypes": [
        "posts",
        "comments"
    ],
    "subreddits": [
        "python"
    ],
    "after": "2024-01-01",
    "before": "2024-01-02",
    "minScore": 0,
    "sort": "asc",
    "maxItems": 20,
    "batchSize": 20,
    "maxPages": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/reddit-historical-archive-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "recordTypes": [
        "posts",
        "comments",
    ],
    "subreddits": ["python"],
    "after": "2024-01-01",
    "before": "2024-01-02",
    "minScore": 0,
    "sort": "asc",
    "maxItems": 20,
    "batchSize": 20,
    "maxPages": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/reddit-historical-archive-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "recordTypes": [
    "posts",
    "comments"
  ],
  "subreddits": [
    "python"
  ],
  "after": "2024-01-01",
  "before": "2024-01-02",
  "minScore": 0,
  "sort": "asc",
  "maxItems": 20,
  "batchSize": 20,
  "maxPages": 20
}' |
apify call automation-lab/reddit-historical-archive-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=automation-lab/reddit-historical-archive-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Historical Archive Scraper",
        "description": "🗄️ Export old Reddit posts and comments by subreddit, author, keyword, score, and date range from a public archive — no login or API key.",
        "version": "0.1",
        "x-build-id": "MOfila8N30xzcT3Wf"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/automation-lab~reddit-historical-archive-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-automation-lab-reddit-historical-archive-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/automation-lab~reddit-historical-archive-scraper/runs": {
            "post": {
                "operationId": "runs-sync-automation-lab-reddit-historical-archive-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/automation-lab~reddit-historical-archive-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-automation-lab-reddit-historical-archive-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "after",
                    "before"
                ],
                "properties": {
                    "recordTypes": {
                        "title": "Record types",
                        "minItems": 1,
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Select historical Reddit entity types. Posts go to the default dataset and comments to the Comments dataset.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "posts",
                                "comments"
                            ],
                            "enumTitles": [
                                "Posts",
                                "Comments"
                            ]
                        },
                        "default": [
                            "posts",
                            "comments"
                        ]
                    },
                    "subreddits": {
                        "title": "Subreddits",
                        "maxItems": 10,
                        "type": "array",
                        "description": "Enter subreddit names without r/, for example python. At least one subreddit or author is required.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "authors": {
                        "title": "Authors",
                        "maxItems": 10,
                        "type": "array",
                        "description": "Optionally enter Reddit usernames without u/. When subreddits are also set, both constraints apply.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "keyword": {
                        "title": "Keyword or phrase",
                        "type": "string",
                        "description": "Optionally match post titles/selftext and comment bodies inside the selected subreddit or author scope.",
                        "default": ""
                    },
                    "after": {
                        "title": "After date (inclusive)",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Return records created on or after this UTC date in YYYY-MM-DD format.",
                        "default": "2024-01-01"
                    },
                    "before": {
                        "title": "Before date (exclusive)",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Return records created before this UTC date in YYYY-MM-DD format. It must be later than After date.",
                        "default": "2024-01-02"
                    },
                    "minScore": {
                        "title": "Minimum score",
                        "type": "integer",
                        "description": "Only save records whose numeric Reddit score is at least this value.",
                        "default": 0
                    },
                    "sort": {
                        "title": "Chronological order",
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "description": "Sort archive records from oldest to newest or newest to oldest.",
                        "default": "asc"
                    },
                    "maxItems": {
                        "title": "Maximum archive records",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Stop after this many posts and comments combined. Duplicate archive IDs do not count.",
                        "default": 20
                    },
                    "batchSize": {
                        "title": "Archive page size",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Records requested per Arctic Shift API page. Lower values reduce retry work during upstream instability.",
                        "default": 100
                    },
                    "maxPages": {
                        "title": "Maximum archive pages",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Safety limit across all scopes. Keyword and score filters are applied locally, so sparse searches may inspect more rows than they save.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
