{
  "openapi": "3.0.1",
  "info": {
    "title": "PTT Scraper & API – Taiwan Forum Posts and Push Comments",
    "description": "PTT scraper and unofficial PTT API for ptt.cc, Taiwan's largest forum. No login or API key: scrape board listings and full posts with every push, boo and arrow comment, floor, author and time. Poster IPs are opt-in. Export JSON, CSV or Excel for Taiwan social listening.",
    "version": "1.0",
    "x-build-id": "XdJ1pDYeZ42IZOEzk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/claude_code_reviewer~ptt-scraper-en/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-claude_code_reviewer-ptt-scraper-en",
        "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/claude_code_reviewer~ptt-scraper-en/runs": {
      "post": {
        "operationId": "runs-sync-claude_code_reviewer-ptt-scraper-en",
        "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/claude_code_reviewer~ptt-scraper-en/run-sync": {
      "post": {
        "operationId": "run-sync-claude_code_reviewer-ptt-scraper-en",
        "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": {
          "mode": {
            "title": "🎯 Mode",
            "enum": [
              "board",
              "post"
            ],
            "type": "string",
            "description": "What do you want to scrape? Pick a mode, then fill in the matching fields below.",
            "default": "board"
          },
          "boards": {
            "title": "📋 Board names",
            "maxItems": 50,
            "uniqueItems": true,
            "type": "array",
            "description": "Board names for board mode, e.g. Stock, Tech_Job, Gossiping. Names are case-sensitive and may contain only letters, digits, \"_\" and \"-\". Boards such as Gossiping and sex are age-restricted (18+): this Actor sends the age-consent cookie automatically, but you are responsible for making sure you and the people who use the data meet the age requirement.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "keywords": {
            "title": "🔍 Title keyword filter",
            "maxItems": 20,
            "uniqueItems": true,
            "type": "array",
            "description": "(Optional) Keep only posts whose title contains any of these keywords. PTT titles are Traditional Chinese, so use Chinese keywords, e.g. 心得, 新聞. Leave empty for no filter.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "dateFrom": {
            "title": "📅 Only posts after this time (optional)",
            "type": "string",
            "description": "Accepts relative times (3d, 12h, 2w) or an absolute date (MM/DD/YY). Judged from the timestamp inside the post ID, accurate to the second. When set, paging stops as soon as a whole page is older than this time, which saves cost on scheduled monitoring."
          },
          "dateTo": {
            "title": "📅 Only posts before this time (optional)",
            "type": "string",
            "description": "Accepts relative times (3d, 12h, 2w) or an absolute date (MM/DD/YY). Judged from the timestamp inside the post ID, accurate to the second."
          },
          "postUrls": {
            "title": "📄 Post URLs",
            "maxItems": 100,
            "uniqueItems": true,
            "type": "array",
            "description": "Full post URLs for single-post mode, e.g. https://www.ptt.cc/bbs/Stock/M.1783087025.A.C75.html. Only www.ptt.cc post URLs are accepted. Posts on 18+ boards carry the same age-restriction responsibility as the boards.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "bulkInput": {
            "title": "📋 Bulk paste",
            "type": "string",
            "description": "**One per line**, press Enter for a new line. Paste board names for board mode or post URLs for post mode; they are merged into the matching field above at run time.",
            "default": ""
          },
          "maxItems": {
            "title": "📊 Max items",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Board mode: maximum number of posts per board. More items cost more. Upper limit 2000.",
            "default": 50
          },
          "includeAuthorIp": {
            "title": "🌐 Output poster / commenter IPs (optional)",
            "type": "boolean",
            "description": "Off by default. When on, the Actor outputs the post's poster IP and each commenter's IP (PTT shows them on some boards). When off, the ip fields are null (kept in the output) and any IP embedded in push timestamps is removed. IP addresses are personal data (Taiwan's Personal Data Protection Act): if you turn this on, you are responsible for lawful collection and use.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy (advanced, usually not needed)",
            "type": "object",
            "description": "PTT is friendly to direct connections, so a proxy is usually not needed. Turn it on only if you get blocked.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}