{
  "openapi": "3.0.1",
  "info": {
    "title": "Baidu Tieba 贴吧 Scraper",
    "description": "Scrape Baidu Tieba 百度贴吧 posts, comments and replies from keyword search, forum tabs, hot topics, user profiles and post links. Get text, images, videos, views, likes, author level, IP region and forum data. No login. Export JSON, CSV, Excel or use the API.",
    "version": "1.0",
    "x-build-id": "jKGa1pRridfWgiwbK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parsebird~baidu-tieba-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parsebird-baidu-tieba-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/parsebird~baidu-tieba-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parsebird-baidu-tieba-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/parsebird~baidu-tieba-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parsebird-baidu-tieba-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Enter keywords to search Tieba posts. Each keyword runs as a separate search and gets up to <b>Max posts</b> results.",
            "items": {
              "type": "string"
            }
          },
          "sortSearchBy": {
            "title": "Sort search by",
            "enum": [
              "most_relevant",
              "latest",
              "oldest"
            ],
            "type": "string",
            "description": "Choose the order of search results.",
            "default": "most_relevant"
          },
          "searchWithinForum": {
            "title": "Search within forum",
            "type": "string",
            "description": "Enter a forum (吧) name, ID or URL to search inside that forum only, like <code>电影吧</code> or <code>https://tieba.baidu.com/f?kw=电影</code>. Leave empty to search all of Tieba."
          },
          "forums": {
            "title": "Forums",
            "type": "array",
            "description": "Add forums (吧) to scrape by tab. Each entry takes <code>forum</code> (name, ID or URL), <code>tabs</code> (any of <code>highlights</code>, <code>popular</code>, <code>latest</code>, <code>video</code>), optional <code>customTabs</code> (the forum's own tab names in Chinese, exactly as shown on Tieba, like <code>影视评论</code>) and optional <code>maxPostsPerTab</code>. Without tabs, the <code>latest</code> tab is scraped."
          },
          "urls": {
            "title": "Direct URLs",
            "type": "array",
            "description": "Add Tieba links: post links (<code>https://tieba.baidu.com/p/10860925843</code>), user profile links (<code>https://tieba.baidu.com/home/main?id=tb.1.…</code> or <code>?un=name</code>), hot topic links (<code>https://tieba.baidu.com/hottopic/browse/hottopic?topic_id=…</code>) and forum links (<code>https://tieba.baidu.com/f?kw=…</code>, latest tab).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "topics": {
            "title": "Topics",
            "type": "array",
            "description": "Enter Tieba hot topic (话题) names, like <code>剧情</code> or <code>#剧情</code>. Topic links also work in <b>Direct URLs</b>.",
            "items": {
              "type": "string"
            }
          },
          "sortTopicPostsBy": {
            "title": "Sort topic posts by",
            "enum": [
              "hottest",
              "latest"
            ],
            "type": "string",
            "description": "Choose the order for topics and hot topic links: <b>Hottest</b> (Tieba's 最热) or <b>Latest</b> (newest first, 最新).",
            "default": "hottest"
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Set how many top-level comments (楼层 floors) to save for each post. Use <b>0</b> to skip comments.",
            "default": 0
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Set how many replies (楼中楼) to save under each comment. Use <b>0</b> to skip replies.",
            "default": 0
          },
          "sortCommentsBy": {
            "title": "Sort comments by",
            "enum": [
              "popular",
              "latest",
              "oldest"
            ],
            "type": "string",
            "description": "Choose the comment order: <b>Popular</b> (Tieba's hot floors first, then thread order), <b>Latest</b> (newest first) or <b>Oldest</b> (thread order).",
            "default": "latest"
          },
          "maxPosts": {
            "title": "Max posts",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Set how many posts to save for each search term, topic, hot topic, user profile or forum link. Forum tabs use <code>maxPostsPerTab</code> when set. Use <b>0</b> for no limit.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed: Tieba's public data works without a proxy. Set one only if Tieba starts refusing requests.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}