{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili 哔哩哔哩 Scraper",
    "description": "Scrape Bilibili (哔哩哔哩, B站) videos by keyword, video details, comments, danmaku (弹幕), UP主 profiles and catalogues, plus 热门 trending and 热搜. Views, likes, coins, favourites. Export JSON, CSV, Excel.",
    "version": "1.0",
    "x-build-id": "6HHVwqOtXlxx3hcy3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parsebird~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parsebird-bilibili-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~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parsebird-bilibili-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~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parsebird-bilibili-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",
        "required": [
          "searchType"
        ],
        "properties": {
          "searchType": {
            "title": "Mode",
            "enum": [
              "search",
              "video-detail",
              "comments",
              "danmaku",
              "profile",
              "user-videos",
              "trend"
            ],
            "type": "string",
            "description": "Choose what to scrape. <b>search</b>, <b>user-videos</b> and <b>trend</b> return videos (or hot-search terms); <b>video-detail</b>, <b>comments</b> and <b>danmaku</b> take video URLs; <b>profile</b> and <b>user-videos</b> take UP主 space URLs or UIDs.",
            "default": "search"
          },
          "keywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Enter search terms in Chinese or English, one per line. Each keyword is searched separately. Used by <b>search</b>.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or BV ids",
            "type": "array",
            "description": "Add video links such as <code>https://www.bilibili.com/video/BV1rpWjevEip</code>, bare BV ids (<code>BV1rpWjevEip</code>), av ids or b23.tv short links. Add <code>?p=2</code> to a URL to pick a part of a multi-part video for danmaku. Used by <b>video-detail</b>, <b>comments</b> and <b>danmaku</b>.",
            "items": {
              "type": "string"
            }
          },
          "userUrls": {
            "title": "UP主 space URLs or UIDs",
            "type": "array",
            "description": "Add creator space links such as <code>https://space.bilibili.com/546195</code> or bare numeric UIDs (<code>546195</code>). Used by <b>profile</b> and <b>user-videos</b>.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max results per keyword or target",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Set how many videos, comments or trending rows to save for each keyword, video or UP主. This is the main cost lever. Bilibili search returns at most about 1,000 videos per keyword; use the date filters to go further. Ignored by video-detail, profile and danmaku, which return one record set per target.",
            "default": 20
          },
          "sortOrder": {
            "title": "Sort search results by",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "Order of keyword search results. Used by <b>search</b>.",
            "default": "totalrank"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "Keep only videos of this length. Used by <b>search</b>.",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Published on or after",
            "type": "string",
            "description": "Keep only videos published on or after this date (China Standard Time). Used by <b>search</b>."
          },
          "publishedBefore": {
            "title": "Published on or before",
            "type": "string",
            "description": "Keep only videos published on or before this date (China Standard Time). Used by <b>search</b>."
          },
          "trendType": {
            "title": "Trending list",
            "enum": [
              "videos",
              "keywords"
            ],
            "type": "string",
            "description": "<b>videos</b> returns the 热门 (popular) feed with each video's recommendation reason; <b>keywords</b> returns the 热搜 hot-search terms with rank and heat score. Used by <b>trend</b>.",
            "default": "videos"
          },
          "includeReplies": {
            "title": "Fetch reply threads as separate comments",
            "type": "boolean",
            "description": "Turn on to fetch the replies under each comment (up to 20 per thread, the number Bilibili shows logged-out visitors). Each reply is saved and billed as one comment and counts against Max results. When off, each comment still includes Bilibili's reply previews at no extra cost. Used by <b>comments</b>.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed for normal use. Only set a proxy if your runs are being throttled."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}