# 4chan Scraper (`goat255/fourchan-scraper`) Actor

Scrape 4chan boards and threads without a login. Pull the catalog of a board (every live thread's opening post) or a full thread with all its replies. Comment HTML is stripped to clean plain text, with media URLs, counts, and metadata.

- **URL**: https://apify.com/goat255/fourchan-scraper.md
- **Developed by:** [Goutam Soni](https://apify.com/goat255) (community)
- **Categories:** Social media, News, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 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.
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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## 4chan Scraper

Scrape 4chan boards, threads, posts, and images without a login or API key. Give it a board code or a thread URL and get clean structured data: opening posts, every reply, comment text (HTML stripped to plain text), reply and image counts, image and thumbnail URLs, country flags, poster IDs, and timestamps.

### What it does

- **Board catalog scraper.** Give it a board code (for example `g`, `pol`, `v`) and get the opening post of every live thread on that board: subject, comment text, reply count, image count, the OP image, and metadata.
- **Full thread scraper.** Give it a thread URL and get the opening post plus every reply, flattened into clean one-post-per-row data.
- **Board directory.** Optionally emit a one-row-per-board list of every available board with its title, page count, and worksafe flag.
- **Clean text.** Comment HTML is decoded and stripped to readable plain text. Quote references stay readable as `>>123`.
- **Rich media fields.** Each post with an attachment carries the full-size image URL, thumbnail URL, original filename, dimensions, file size, and file hash.
- **No login required.** No account, no password, no API key, no cookies. Works out of the box.

### Use cases

- **Trend and meme monitoring.** Track what is being discussed across boards in near real time for cultural research, brand monitoring, or trend spotting.
- **Market and audience research.** Pull large samples of posts on a topic to analyze sentiment, language, and emerging interests.
- **Dataset building for AI/ML.** Collect text and image-link corpora for training, fine-tuning, or NLP experiments.
- **Academic and OSINT research.** Study discussion dynamics, posting patterns, country distribution, and thread lifecycles at scale.
- **Image and media collection.** Harvest image URLs, thumbnails, and file hashes from a board or thread for archival or analysis.

### Input

| Field | Type | Description |
|---|---|---|
| `boards` | array | Board codes to pull the catalog from (the opening post of every live thread). Use the short code with or without slashes, for example `g` or `/g/`. |
| `threadUrls` | array | Thread links to fetch in full (opening post plus every reply). A short `g/123456789` form also works. |
| `listBoards` | boolean | When on, also emit a one-row-per-board directory of every available board. Default off. |
| `maxItemsPerSource` | integer | Cap on items returned per board or thread. Default 1000. |
| `includeThreadReplies` | boolean | When off, thread mode returns only the opening post of each thread URL. Default on. |
| `concurrency` | integer | How many sources to process in parallel. Default 3. |
| `proxyConfig` | object | Optional proxy configuration. The public read endpoints work without a proxy. |

#### Example input

```json
{
  "boards": ["g", "pol"],
  "threadUrls": ["https://boards.4chan.org/g/thread/123456789"],
  "listBoards": false,
  "maxItemsPerSource": 1000,
  "includeThreadReplies": true,
  "concurrency": 3
}
````

### Output

Each post becomes one clean row. Fields are ordered by importance: identity first, then counts, then content, then author and origin, then media, then metadata.

```json
{
  "type": "post",
  "board": "g",
  "postId": 123456789,
  "threadId": 123456789,
  "isOp": true,
  "url": "https://boards.4chan.org/g/thread/123456789",
  "replyCount": 21,
  "imageCount": 4,
  "subject": "An example thread title",
  "text": "An example post body in plain text.\n>>123456700 quote reference stays readable.",
  "author": "Anonymous",
  "tripcode": null,
  "posterId": "Ab12Cd34",
  "capcode": null,
  "country": "DE",
  "countryName": "Germany",
  "boardFlag": null,
  "boardFlagName": null,
  "image": "https://i.example.com/g/1700000000000.png",
  "thumbnail": "https://i.example.com/g/1700000000000s.jpg",
  "filename": "example.png",
  "fileExt": ".png",
  "fileSizeBytes": 301273,
  "imageWidth": 1280,
  "imageHeight": 720,
  "md5": "zuZHMJMYYp5WY7vM397nWQ==",
  "sticky": false,
  "closed": false,
  "postedAt": "2026-06-01T12:00:00.000Z",
  "time": 1748779200,
  "scrapedAt": "2026-06-18T00:00:00.000Z"
}
```

**Key fields**

- `postId` / `threadId` / `isOp` identify the post and whether it is the opening post of its thread.
- `replyCount` / `imageCount` are populated on opening posts (the values at scrape time); replies carry `null` for these by design.
- `text` is the comment body decoded and stripped to plain text.
- `country` / `countryName` and `boardFlag` / `boardFlagName` appear only on boards that show flags.
- `posterId` appears only on boards that show per-thread poster IDs.
- `image` / `thumbnail` / `filename` / `md5` and the size fields appear only on posts that include an attachment.

When `listBoards` is on, board rows carry `type` (`board`), `board`, `title`, `url`, `worksafe`, `pages`, `perPage`, and `description`.

### FAQ

**Is it free? How is it priced?**
The actor runs on a simple pay-per-result model. You pay for the rows you receive plus the platform compute the run uses. There is no subscription and no per-run start fee.

**Do I need a login, account, or API key?**
No. It reads public content only, with no account, password, cookies, or API key required.

**How many results can I get?**
A board catalog returns the opening post of every live thread (often 150 or more per board). A full thread can return several hundred posts. Use `maxItemsPerSource` to cap how many items come back per board or thread, and pass multiple boards or thread URLs to scale up.

**How fast is it?**
Runs are quick. The actor processes sources in parallel (controlled by `concurrency`) and spaces requests politely. A typical board catalog completes in seconds.

**Does it get replies, or just the first post?**
Board catalog mode returns the opening post of each thread. To get every reply, pass the thread URL in `threadUrls` with `includeThreadReplies` on (the default).

**Can I get the images?**
Yes. Each post with an attachment includes the full-size image URL, a thumbnail URL, the original filename, dimensions, file size, and the file hash.

### Notes

- Counts (replies, images) reflect the values at scrape time.
- This actor reads public content only.

# Actor input Schema

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

Board codes to pull the catalog from (the opening post of every live thread). Use the short board code with or without slashes. Example: g, /g/, pol.

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

Specific thread links to fetch in full (the opening post plus every reply). Example: https://boards.4chan.org/g/thread/123456789. A short g/123456789 form also works.

## `listBoards` (type: `boolean`):

When on, also emit a one-row-per-board directory of every available board with its title and page count.

## `maxItemsPerSource` (type: `integer`):

Cap on items returned per board or thread. A board catalog holds up to about 150 threads; a thread can hold several hundred posts. Default 1000.

## `includeThreadReplies` (type: `boolean`):

When on, thread mode returns the full thread. When off, only the opening post of each thread URL is returned.

## `concurrency` (type: `integer`):

How many sources to process in parallel. Kept modest to stay polite to the source.

## `proxyConfig` (type: `object`):

Optional proxy. The public read endpoints do not require a proxy, but you may route through one if you wish.

## Actor input object example

```json
{
  "boards": [
    "g"
  ],
  "threadUrls": [],
  "listBoards": false,
  "maxItemsPerSource": 1000,
  "includeThreadReplies": true,
  "concurrency": 3,
  "proxyConfig": {
    "useApifyProxy": false
  }
}
```

# 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"
    ],
    "threadUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("goat255/fourchan-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"],
    "threadUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("goat255/fourchan-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 '{
  "boards": [
    "g"
  ],
  "threadUrls": []
}' |
apify call goat255/fourchan-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "4chan Scraper",
        "description": "Scrape 4chan boards and threads without a login. Pull the catalog of a board (every live thread's opening post) or a full thread with all its replies. Comment HTML is stripped to clean plain text, with media URLs, counts, and metadata.",
        "version": "0.1",
        "x-build-id": "p80dnpfQOsL3D8Goh"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/goat255~fourchan-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-goat255-fourchan-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/goat255~fourchan-scraper/runs": {
            "post": {
                "operationId": "runs-sync-goat255-fourchan-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/goat255~fourchan-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-goat255-fourchan-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",
                "properties": {
                    "boards": {
                        "title": "Boards (catalog mode)",
                        "type": "array",
                        "description": "Board codes to pull the catalog from (the opening post of every live thread). Use the short board code with or without slashes. Example: g, /g/, pol.",
                        "default": [
                            "g"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "threadUrls": {
                        "title": "Thread URLs (thread mode)",
                        "type": "array",
                        "description": "Specific thread links to fetch in full (the opening post plus every reply). Example: https://boards.4chan.org/g/thread/123456789. A short g/123456789 form also works.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "listBoards": {
                        "title": "List all boards",
                        "type": "boolean",
                        "description": "When on, also emit a one-row-per-board directory of every available board with its title and page count.",
                        "default": false
                    },
                    "maxItemsPerSource": {
                        "title": "Max items per source",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Cap on items returned per board or thread. A board catalog holds up to about 150 threads; a thread can hold several hundred posts. Default 1000.",
                        "default": 1000
                    },
                    "includeThreadReplies": {
                        "title": "Include thread replies",
                        "type": "boolean",
                        "description": "When on, thread mode returns the full thread. When off, only the opening post of each thread URL is returned.",
                        "default": true
                    },
                    "concurrency": {
                        "title": "Concurrency",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "How many sources to process in parallel. Kept modest to stay polite to the source.",
                        "default": 3
                    },
                    "proxyConfig": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional proxy. The public read endpoints do not require a proxy, but you may route through one if you wish.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
