4chan API

Entertainment API · Works globally · Read-only board data · No API key

TL;DR

The 4chan API provides read-only access to 4chan's boards, threads, and posts. Data is served as JSON from the a.4cdn.org domain and includes board catalogs, thread listings, post content, timestamps, file attachments, and metadata. This is the official API used by 4chan's own interface and countless third-party apps. No authentication required. Notable for its real-time nature — threads are served as static JSON snapshots that update as new posts are made.

Quick start: https://a.4cdn.org/boards.json

No API key needed — just make a request!

How to Use This API

1. List All Boards

https://a.4cdn.org/boards.json

2. Get Board Catalog (All Threads)

https://a.4cdn.org/g/catalog.json

3. Get Specific Thread

https://a.4cdn.org/g/thread/12345.json

4. JavaScript — Browse Board

fetch('https://a.4cdn.org/g/catalog.json')
  .then(r => r.json())
  .then(pages => {
    pages.forEach(page => {
      page.threads.forEach(thread => {
        console.log(`[${thread.sub || 'No subject'}] ${thread.com?.slice(0, 80)}`);
      });
    });
  });

5. Python — Live Thread Tracker

import requests
import time

board = 'g'
while True:
    data = requests.get(
        f'https://a.4cdn.org/{board}/catalog.json'
    ).json()
    total = sum(len(page['threads']) for page in data)
    print(f"{board}: {total} active threads")
    time.sleep(60)
Browse all boards: https://a.4cdn.org/boards.json

Frequently Asked Questions

What board information is available?
The boards list includes board ID, title, subtitle, and whether posting requires a tripcode. Each board can be queried for its catalog, threads, and archives.
How does thread data work?
Each thread JSON contains the OP post and all replies. Fields include no (post number), now (timestamp), sub (subject), com (comment HTML), filename, ext, w/h (image dimensions), and tim (file ID).
Are file attachments accessible?
Yes. Images are served from https://i.4cdn.org/{board}/{tim}{ext}. Thumbnails are at https://i.4cdn.org/{board}/{tim}s.jpg. The tim field is the file's unique ID.
Is there rate limiting?
4chan asks developers to limit requests to 1 per second. The API caches responses for a few seconds, so rapid polling won't get fresh data anyway.
How are archived threads handled?
Archived threads are available under https://a.4cdn.org/{board}/archive.json, which lists thread IDs that are no longer active. Threads are archived after reaching post limit or being deleted by a moderator.
What format is the post comment in?
The com field contains HTML. Use ?format=json for raw JSON. Note that quotes (>) and greentext are wrapped in <span class="quote"> tags.

API Details

API URL
https://a.4cdn.org
Documentation
github.com/4chan/4chan-API
Category
Entertainment
Authentication
Not Required
Geographic Coverage
Global

What You Can Build