{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: Videos, Danmaku & Comments",
    "description": "Scrape Bilibili (B站) videos with views, likes, coins, favorites and tags, plus danmaku (弹幕) with their time in the video, top comments and replies, and UP主 creator profiles. Search by keyword, video link or UID. No login or cookies. $1.49 per 1,000 videos.",
    "version": "0.1",
    "x-build-id": "jP4UjuqDeMaGY1b4e"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cleanscrape~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cleanscrape-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/cleanscrape~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-cleanscrape-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/cleanscrape~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-cleanscrape-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",
        "properties": {
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "One term per line, in Chinese or English, such as 咖啡 (coffee). Chinese terms find more videos. Results come in Bilibili's default relevance order (综合排序).",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerQuery": {
            "title": "Videos per search term",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Bilibili shows up to 1,000 results (50 pages of 20) for one term.",
            "default": 100
          },
          "videoUrls": {
            "title": "Video links",
            "type": "array",
            "description": "One per line: bilibili.com video links, BV ids (BV1xx411c7mD), av ids, b23.tv short links, or the whole text the Bilibili app copies with Share > Copy link (分享 > 复制链接).",
            "items": {
              "type": "string"
            }
          },
          "creatorUrls": {
            "title": "Creator links (UP主)",
            "type": "array",
            "description": "One per line: space.bilibili.com links, UIDs (the creator's number, such as 546195), or b23.tv links shared from the app. Each creator gets a profile row; their videos come from their public collections and series (合集和系列).",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerCreator": {
            "title": "Videos per creator",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Videos taken from the creator's public collections and series. 0 saves only the profile row.",
            "default": 100
          },
          "includeTags": {
            "title": "Tags",
            "type": "boolean",
            "description": "The video's tags.",
            "default": true
          },
          "includeComments": {
            "title": "Top comments and replies (评论)",
            "type": "boolean",
            "description": "The comments Bilibili shows without login: usually the 3 top comments, plus the first 20 replies under each. The full comment count is in the video row.",
            "default": false
          },
          "includeReplies": {
            "title": "Include replies under top comments",
            "type": "boolean",
            "description": "Only with Top comments.",
            "default": true
          },
          "includeDanmaku": {
            "title": "Danmaku (弹幕, bullet comments)",
            "type": "boolean",
            "description": "The on-screen comments with their time in the video, one row each.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Danmaku per video",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Earliest in the video first. Bilibili's player list holds up to a few thousand per part.",
            "default": 1000
          },
          "danmakuAllParts": {
            "title": "Danmaku from every part of multi-part videos",
            "type": "boolean",
            "description": "Off: the first part only.",
            "default": false
          },
          "includeRelated": {
            "title": "Related videos",
            "type": "boolean",
            "description": "Ids of the videos Bilibili recommends next to each video.",
            "default": false
          },
          "parallelConnections": {
            "title": "Parallel connections",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many proxy IPs to use at once. Each keeps to Bilibili's measured pace, so more connections finish sooner. Free Apify plans include 5 datacenter IPs; extra ones are skipped automatically. 0 uses only the run's own connection (slowest).",
            "default": 8
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify's datacenter proxy works well and is included in Apify plans. Residential proxies are not needed and cost more.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}