{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili B站 Scraper - Videos, Comments, Danmaku & Subtitles",
    "description": "Scrape Bilibili (哔哩哔哩, B站): search videos by keyword, get video details, public comments with commenter user ID, avatar and level, danmaku (弹幕), subtitles and UP主 creator stats with recent uploads. No login or cookies needed. Export to JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "SIHwwfeaw6UOqOyYv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/clover_folktale~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-clover_folktale-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/clover_folktale~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-clover_folktale-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/clover_folktale~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-clover_folktale-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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "video",
              "comments",
              "danmaku",
              "subtitles",
              "creator",
              "dynamics",
              "replies",
              "popular",
              "hotSearch",
              "favorites",
              "liveRoom",
              "homeFeed",
              "cinemaFeed",
              "bangumiFeed"
            ],
            "type": "string",
            "description": "What to scrape: search videos by keyword, details of specific videos, comments of videos, danmaku (on-screen comments) of videos, subtitles (full transcripts) of videos, creator profiles with their recent videos, a creator's dynamics (posts), all replies under a comment, the popular feed, the trending search board, a creator's public favourite folders, live room status, the home recommended videos, or the cinema and bangumi (anime) tabs.",
            "default": "search"
          },
          "keyword": {
            "title": "Keyword (mode: search)",
            "type": "string",
            "description": "Search keyword. Chinese keywords return the best results.",
            "default": "原神"
          },
          "searchOrder": {
            "title": "Search order (mode: search)",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "How search results are ranked.",
            "default": "totalrank"
          },
          "videos": {
            "title": "Videos (modes: video, comments, danmaku, subtitles)",
            "type": "array",
            "description": "Bilibili video URLs or BV IDs, e.g. https://www.bilibili.com/video/BV1M1421t7hT or BV1M1421t7hT.",
            "items": {
              "type": "string"
            }
          },
          "subtitleLanguage": {
            "title": "Subtitle language (mode: subtitles)",
            "type": "string",
            "description": "Language code of the subtitle track you want, e.g. zh, en or en-US. Leave empty to get the fullest track available. A video without that language counts as not found."
          },
          "creators": {
            "title": "Creators (modes: creator, dynamics, favorites)",
            "type": "array",
            "description": "Creator UIDs or profile URLs, e.g. 19286458 or https://space.bilibili.com/19286458. For favorites, only folders the creator made public are returned; a creator who hides them counts as not found.",
            "items": {
              "type": "string"
            }
          },
          "includeReplies": {
            "title": "Include replies (mode: comments)",
            "type": "boolean",
            "description": "Also return the replies shown under each comment (the first replies the platform includes with the comment; long reply threads may be partial). Each reply is billed like a comment.",
            "default": false
          },
          "commentLinks": {
            "title": "Comment links (mode: replies)",
            "type": "array",
            "description": "Comments whose full reply thread you want: the comment link copied from Bilibili (https://www.bilibili.com/video/BV1M1421t7hT/#reply237107365072) or 'BV1M1421t7hT 237107365072' (video ID, space, comment ID). Use a top-level comment; each reply is billed like a result.",
            "items": {
              "type": "string"
            }
          },
          "liveRooms": {
            "title": "Live rooms (mode: liveRoom)",
            "type": "array",
            "description": "Live room IDs or URLs, e.g. 6 or https://live.bilibili.com/6. One record per room: whether it is live, title, viewers, followers, category.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of items to return in total for this run (for the trending board, at most 50 words). You are charged per item returned.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}