{
  "openapi": "3.0.1",
  "info": {
    "title": "4chan Scraper — Boards, Threads, Archive & Reply Graph",
    "description": "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.",
    "version": "0.1",
    "x-build-id": "Q3vfGswK4lOg64utD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/powernaner~4chan-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-powernaner-4chan-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/powernaner~4chan-scraper/runs": {
      "post": {
        "operationId": "runs-sync-powernaner-4chan-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/powernaner~4chan-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-powernaner-4chan-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",
            "type": "array",
            "description": "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).",
            "items": {
              "type": "string"
            }
          },
          "threadUrls": {
            "title": "Thread URLs",
            "type": "array",
            "description": "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.",
            "items": {
              "type": "string"
            }
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "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.",
            "default": true
          },
          "includeArchived": {
            "title": "Include archived threads",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "maxThreadsPerBoard": {
            "title": "Max threads per board",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "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.",
            "default": 20
          },
          "maxPostsPerThread": {
            "title": "Max posts per thread",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on posts taken from each thread, starting from the OP. 0 means all posts.",
            "default": 0
          },
          "maxItems": {
            "title": "Max posts in total",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "The run stops after delivering this many posts. You are charged per post delivered, so this is your cost ceiling in posts.",
            "default": 1000
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "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.",
            "items": {
              "type": "string"
            }
          },
          "keywordScope": {
            "title": "Keyword filter applies to",
            "enum": [
              "threads",
              "posts"
            ],
            "type": "string",
            "description": "<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.",
            "default": "threads"
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "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": {
            "title": "Posted before",
            "type": "string",
            "description": "Keep only posts made before this moment. Same formats as “Posted after”."
          },
          "minReplies": {
            "title": "Minimum replies per thread",
            "minimum": 0,
            "type": "integer",
            "description": "Skip threads with fewer replies than this. Useful to focus on threads that got traction.",
            "default": 0
          },
          "includeStickyThreads": {
            "title": "Include sticky threads",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "worksafeOnly": {
            "title": "Worksafe boards only",
            "type": "boolean",
            "description": "On by default: adult (NSFW) boards like /b/ are skipped, with a note in the run summary. Turn off to include them.",
            "default": true
          },
          "onlyNew": {
            "title": "Only new posts since the last run",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "outputMode": {
            "title": "Output format",
            "enum": [
              "posts",
              "threads"
            ],
            "type": "string",
            "description": "<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.",
            "default": "posts"
          },
          "includeCommentHtml": {
            "title": "Include original comment HTML",
            "type": "boolean",
            "description": "Adds <code>commentHtml</code>, the post exactly as 4chan's API returns it, next to the cleaned <code>text</code>.",
            "default": true
          },
          "includeBoardInfo": {
            "title": "Include board info rows",
            "type": "boolean",
            "description": "Adds one row per requested board with its rules: limits, bump limit, whether it is worksafe, has an archive, country flags or poster IDs.",
            "default": false
          },
          "includeThreadStats": {
            "title": "Include thread stats (optional analysis)",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "healthCheck": {
            "title": "Health check mode (canary)",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "healthCheckSimulateFailure": {
            "title": "Simulate a canary failure (test only)",
            "type": "boolean",
            "description": "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.",
            "default": 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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}