# 4chan Scraper — Boards, Threads, Archive & Reply Graph (`powernaner/4chan-scraper`) Actor

Scrape 4chan boards, threads, replies and archived threads via the official read-only JSON API. Reply graph (who quotes whom), poster IDs, country flags, media URLs, keyword and date filters, incremental mode. Unofficial, not affiliated with 4chan.

- **URL**: https://apify.com/powernaner/4chan-scraper.md
- **Developed by:** [Renan Teles](https://apify.com/powernaner) (community)
- **Categories:** Social media, News, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.45 / 1,000 posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 4chan Scraper — Boards, Threads, Archive & Reply Graph

**Scrape 4chan boards and threads into clean JSON — every post with its text, media URLs, poster IDs, country flags and a full reply graph (who quotes whom) — through 4chan's official read-only API. No login, no proxies, no browser.**

> Unofficial. This Actor is not affiliated with, endorsed by or sponsored by 4chan. All data comes from 4chan's public read-only JSON API ([github.com/4chan/4chan-API](https://github.com/4chan/4chan-API)), and every row links back to its source post on [4chan.org](https://www.4chan.org).

### Example output

A real row from a test run on `/g/` (13 Nov 2026). One row per post:

```json
{
  "type": "post",
  "board": "g",
  "threadId": 110322749,
  "postId": 110322902,
  "isOP": false,
  "url": "https://boards.4chan.org/g/thread/110322749#p110322902",
  "postedAt": "2026-11-13T14:12:07.000Z",
  "postedAtUnix": 1794579127,
  "subject": null,
  "threadSubject": "/vcg/ — Vibe-Coding General",
  "text": ">>110322809\nhave you used agent before?\nyou should use claude medium for now, don't install anything, enable full access",
  "commentHtml": "<a href=\"#p110322809\" class=\"quotelink\">&gt;&gt;110322809</a><br>have you used agent before?<br>you should use claude medium for now, don&#039;t install anything, enable full access",
  "quotes": [110322809],
  "quotedBy": [110322973],
  "crossThreadQuotes": [],
  "deadQuotes": [],
  "links": [],
  "greentextLines": [],
  "userWasBanned": false,
  "name": "Anonymous",
  "tripcode": null,
  "posterId": null,
  "capcode": null,
  "countryCode": null,
  "countryName": null,
  "boardFlagCode": null,
  "boardFlagName": null,
  "since4pass": null,
  "media": null,
  "threadReplies": 180,
  "threadImages": 30,
  "uniqueIps": null,
  "isSticky": false,
  "isClosed": false,
  "isArchived": false,
  "archivedAt": null,
  "bumpLimitReached": false,
  "imageLimitReached": false,
  "threadLastModified": "2026-11-13T18:29:43.000Z",
  "threadStats": null,
  "source": "4chan.org",
  "scrapedAt": "2026-11-13T18:29:55.659Z"
}
```

`quotes` says this post replies to post 110322809; `quotedBy` says post 110322973 replied to it. Put those two columns together and you have the conversation tree of the whole thread.

### What you get

| Field | What it is |
|---|---|
| `text` | The post as clean text: line breaks kept, HTML removed, entities decoded, `>>quotes` and `>greentext` kept as written |
| `board`, `threadId`, `postId`, `url` | Where the post lives, with a direct link |
| `postedAt`, `postedAtUnix` | When it was posted (ISO 8601 UTC, and the original Unix time) |
| `quotes`, `quotedBy` | **Reply graph**: the posts this one answers, and the posts that answer it. `quotedBy` is `null` (unknown) when replies were not scraped |
| `media` | Attached file: `url`, `thumbnailUrl`, original `filename`, `ext`, `sizeBytes`, `width`, `height`, `md5`, `isSpoiler`, `isDeleted` — or `null` |
| `crossThreadQuotes` | Quotes to posts in other threads or boards: `{ board, threadId, postId }` |
| `deadQuotes` | Quotes to posts that have since been deleted |
| `links`, `greentextLines` | URLs and greentext lines found in the post |
| `subject`, `threadSubject`, `isOP` | The post's subject, its thread's subject, and whether it opened the thread |
| `name`, `tripcode`, `posterId`, `capcode`, `since4pass` | Poster identity, as 4chan shows it. Usually "Anonymous" |
| `countryCode`, `countryName`, `boardFlagCode`, `boardFlagName` | Flags, on boards that show them (/pol/, /int/, /sp/, /bant/, /mlp/) |
| `userWasBanned` | The post carries the red "(USER WAS BANNED FOR THIS POST)" note |
| `threadReplies`, `threadImages`, `isSticky`, `isClosed`, `isArchived`, `archivedAt`, `bumpLimitReached`, `imageLimitReached`, `threadLastModified`, `uniqueIps` | Thread status, repeated on every row so each row stands alone in a spreadsheet |
| `commentHtml` | The original HTML, exactly as the API returns it (optional, on by default) |
| `threadStats` | Optional, off by default: unique posters, posts per hour, duration, most-quoted posts |
| `source`, `scrapedAt` | Always `4chan.org`, and when the row was collected |

Other output shapes:

- **`outputMode: "threads"`** — one row per thread, with its posts nested in `posts`.
- **`includeBoardInfo: true`** — one extra row per board with its rules: worksafe or not, archive, flags, poster IDs, bump and image limits, cooldowns.

### How to use

1. Type one or more **boards** (`g`, `biz`, `pol`, `sci`, …) and/or paste **thread URLs**.
2. Optionally narrow it down: **keywords**, **posted after / before** (`2026-11-10` or `3 days`), **minimum replies**.
3. Run. Each board's live threads are taken in board order (most recently bumped first).

Useful switches:

- **Include replies** off → only the opening post of each thread, straight from the catalog: a whole board in one request.
- **Include archived threads** → also threads from the board's archive (4chan keeps them for a few days).
- **Only new posts since the last run** → for scheduled monitoring: each run returns only what's new, and unchanged threads are not even downloaded.
- **Keyword filter applies to** → whole threads whose opening post matches, or only the individual posts that match.

### Use cases

- **Research on online discourse** — misinformation, extremism, meme spread, with the reply graph to study how conversations unfold.
- **Crypto and market sentiment** — follow /biz/ threads about a ticker, with poster IDs to tell how many people are actually talking.
- **Brand and product monitoring** — schedule a keyword watch on /g/, /v/ or any board and get only new mentions each run.
- **Journalism and OSINT** — capture a thread before it is pruned, with timestamps, media hashes and links.
- **Dataset building** — clean text plus structure (quotes, greentext, links) ready for analysis.

### Pricing

Pay per result. **No start fee**, and platform usage is included.

| Result | Price per 1,000 |
|---|---|
| Post | $0.45 |
| Board info row (`includeBoardInfo`) | $1.00 |

Examples (sizes measured on /g/ on 13 Nov 2026):

- 1,000 posts = **$0.45**.
- The 20 most active threads of /g/ with all their replies: 1,799 posts = **$0.81**.
- Only the opening posts of the whole board (`includeReplies` off): 150 posts = **$0.07**.

You never pay for failed threads, filtered posts, empty results or duplicates. In `threads` mode, a row with N posts counts as N posts, so the price is the same in both formats.

Set **Max posts in total** (`maxItems`) to cap your spend. If you set a spending limit on the run, the Actor stops gracefully when it is reached; the platform may let one last event through, so the final charge can exceed the limit by at most one item.

### Limitations (please read)

- **Live data plus a few days.** 4chan itself only keeps live threads and a short archive (about 3 days on /pol/, measured Nov 2026; some boards like /b/ have no archive). Older threads no longer exist on 4chan, so this Actor cannot return them. There is no historical full-text search.
- **Speed is capped by 4chan's API rules: one request per second.** A thread with all its replies costs one request, so 20 threads take about 25 seconds per board. A board's opening posts alone take one request.
- **Media is returned as URLs, not downloaded.** Files on 4chan disappear when the thread is pruned.
- **Threads disappear fast** on busy boards. A thread pruned between the catalog and the download is skipped and counted in the run summary (`threadsGone`).
- **Some fields only exist on some boards**: country flags (/pol/, /int/, /sp/, /bant/), poster IDs (/pol/, /biz/, /bant/, /qst/, /soc/). Elsewhere they are `null`. `uniqueIps` is rarely provided by the API.
- **`threadImages` counts only images in replies**, as 4chan's API does: an opening post with an image and no image replies shows 0.
- **Adult boards are skipped by default** (`worksafeOnly`). Turn it off to include them.
- **Content is unmoderated.** 4chan posts can be offensive or disturbing. The Actor delivers them as they are.
- **Unofficial.** If 4chan changes or restricts its API, the Actor may stop working until it is updated.

### FAQ

**Do I need a 4chan account, an API key or proxies?**
No. The API is public and read-only, and the Actor respects its rules (one request per second, `If-Modified-Since`).

**Why is `quotedBy` sometimes `null` and not an empty list?**
`null` means "unknown": with **Include replies** off, the Actor only sees the opening post, so it cannot know who replied. An empty list `[]` means it saw the whole thread and nobody replied.

**Can I monitor a board on a schedule and only get new posts?**
Yes. Turn on **Only new posts since the last run** and schedule the Actor. Progress is saved per thread, so even if a run stops early (limit reached), the next one continues where it stopped, without duplicates.

**What happens when a thread is pruned?**
If you pasted its URL, the run summary says it was not found. If it was in a board's list, it is skipped and counted. Archived threads still work while they are in the archive.

**Where is the run summary?**
In the run's key-value store, record `RUN_SUMMARY`: per board or thread, the status, posts delivered, threads processed, unchanged or pruned, notes and errors, plus the number of API requests.

**Is this official?**
No. It is an independent tool that reads 4chan's public API and links every row back to 4chan.org.

# Actor input Schema

## `boards` (type: `array`):

Board codes to scrape, like <code>g</code>, <code>biz</code>, <code>pol</code>, <code>sci</code>. You can also paste <code>/g/</code> or a board URL. Threads are taken in board order (most recently bumped first).

## `threadUrls` (type: `array`):

Specific threads to scrape, e.g. <code>https://boards.4chan.org/g/thread/123456789</code> (also accepts <code>g/123456789</code>). Live and archived threads both work. A thread that was pruned and left the archive no longer exists on 4chan.

## `includeReplies` (type: `boolean`):

On: every post of each thread (one extra request per thread). Off: only the opening post (OP) of each thread, straight from the board catalog. Much faster and cheaper, but the reply graph (<code>quotedBy</code>) is unknown and comes as null.

## `includeArchived` (type: `boolean`):

Also scrape threads from the board's archive (newest first). 4chan keeps archived threads for only a few days, and some boards (like /b/) have no archive at all. Up to <code>maxThreadsPerBoard</code> archived threads are downloaded per board, on top of the live ones.

## `maxThreadsPerBoard` (type: `integer`):

How many live threads to take from each board, after filters. A board holds roughly 150–200 live threads. 4chan allows one request per second, so each thread with replies adds about one second to the run.

## `maxPostsPerThread` (type: `integer`):

Cap on posts taken from each thread, starting from the OP. 0 means all posts.

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

The run stops after delivering this many posts. You are charged per post delivered, so this is your cost ceiling in posts.

## `keywords` (type: `array`):

Keep only content that mentions any of these words (case-insensitive, matched at the start of a word: <code>link</code> matches “Link” and “linkies”, not “chainlink”). Leave empty to keep everything. See <code>keywordScope</code> for what is filtered.

## `keywordScope` (type: `string`):

<b>threads</b>: keep whole threads whose opening post (subject or text) mentions a keyword. <b>posts</b>: scan every post of the selected threads and keep only the posts that mention a keyword.

## `postedAfter` (type: `string`):

Keep only posts made at or after this moment. An absolute date (<code>2026-11-10</code>, UTC) or a relative one (<code>3 days</code>, <code>12 hours</code>).

## `postedBefore` (type: `string`):

Keep only posts made before this moment. Same formats as “Posted after”.

## `minReplies` (type: `integer`):

Skip threads with fewer replies than this. Useful to focus on threads that got traction.

## `includeStickyThreads` (type: `boolean`):

Sticky threads are pinned at the top of a board and usually hold the board rules or a permanent general. Off by default so they don't take the place of real discussion threads. Turn on to include them. Thread URLs you paste are always scraped.

## `worksafeOnly` (type: `boolean`):

On by default: adult (NSFW) boards like /b/ are skipped, with a note in the run summary. Turn off to include them.

## `onlyNew` (type: `boolean`):

For scheduled monitoring: each run returns only posts that were not delivered by a previous run with the same filters. Threads that did not change are not downloaded again. State is kept in a named key-value store (<code>4chan-scraper-state</code>) in your Apify account.

## `outputMode` (type: `string`):

<b>posts</b>: one row per post, each row self-contained (thread fields repeated). <b>threads</b>: one row per thread, with its posts nested in <code>posts</code>. Pricing is per post in both modes.

## `includeCommentHtml` (type: `boolean`):

Adds <code>commentHtml</code>, the post exactly as 4chan's API returns it, next to the cleaned <code>text</code>.

## `includeBoardInfo` (type: `boolean`):

Adds one row per requested board with its rules: limits, bump limit, whether it is worksafe, has an archive, country flags or poster IDs.

## `includeThreadStats` (type: `boolean`):

Adds <code>threadStats</code> to each thread's opening post (or thread row): unique posters, posts per hour, duration, most-quoted posts. Off by default: the raw data is always delivered either way.

## `healthCheck` (type: `boolean`):

For the scheduled daily health check. Ignores every other field, checks a fixed set of 4chan boards (/g/ and /sci/): board list, board rules, live threads, archive and threads by URL. Writes nothing to the dataset (no charge) and FAILS the run if a whole source stops responding. The status message names the broken source.

## `healthCheckSimulateFailure` (type: `boolean`):

Test only: with health check mode, swaps the test boards for nonexistent ones so the board sources really fail. Used to prove the failure alert works.

## Actor input object example

```json
{
  "boards": [
    "g"
  ],
  "includeReplies": true,
  "includeArchived": false,
  "maxThreadsPerBoard": 3,
  "maxPostsPerThread": 0,
  "maxItems": 30,
  "keywordScope": "threads",
  "minReplies": 0,
  "includeStickyThreads": false,
  "worksafeOnly": true,
  "onlyNew": false,
  "outputMode": "posts",
  "includeCommentHtml": true,
  "includeBoardInfo": false,
  "includeThreadStats": false,
  "healthCheck": false,
  "healthCheckSimulateFailure": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `runSummary` (type: `string`):

Per source (board or thread URL): status, posts delivered, threads processed, unchanged or pruned, notes and errors. Also the number of API requests made.

# 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 = {
    "boards": [
        "g"
    ],
    "includeReplies": true,
    "maxThreadsPerBoard": 3,
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("powernaner/4chan-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 = {
    "boards": ["g"],
    "includeReplies": True,
    "maxThreadsPerBoard": 3,
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("powernaner/4chan-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "boards": [
    "g"
  ],
  "includeReplies": true,
  "maxThreadsPerBoard": 3,
  "maxItems": 30
}' |
apify call powernaner/4chan-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,powernaner/4chan-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/J65N1kX9hmMUZTqs9/builds/Q3vfGswK4lOg64utD/openapi.json
