{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper - Videos, Comments, Danmaku 哔哩哔哩",
    "description": "Scrape Bilibili (哔哩哔哩, B站) without login: video search, popular and ranking lists, comments with replies, danmaku (弹幕), user profiles and hot searches. Up to 1,000 videos per search. Export to Excel, CSV or API.",
    "version": "0.1",
    "x-build-id": "1D3baVKQoCfHFoxoE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pshivam~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pshivam-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/pshivam~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pshivam-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/pshivam~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pshivam-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 texts",
            "type": "array",
            "description": "What to search for on Bilibili, one per line: Chinese (原神, 猫) or English (minecraft). Each text returns up to 1,000 videos.",
            "items": {
              "type": "string"
            }
          },
          "searchOrder": {
            "title": "Search order",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites"
            ],
            "type": "string",
            "description": "How Bilibili sorts search results.",
            "default": "relevance"
          },
          "searchDuration": {
            "title": "Video length",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Only search videos of this length.",
            "default": "any"
          },
          "lists": {
            "title": "Lists",
            "type": "array",
            "description": "Bilibili's own lists to read: popular videos, the ranking (pick zones below), the must-watch list and today's hot search keywords.",
            "items": {
              "type": "string",
              "enum": [
                "popular",
                "ranking",
                "precious",
                "hotSearch"
              ],
              "enumTitles": [
                "Popular now (综合热门)",
                "Ranking by zone (排行榜)",
                "Must-watch (入站必刷)",
                "Hot searches (热搜)"
              ]
            },
            "default": []
          },
          "rankingZones": {
            "title": "Ranking zones",
            "type": "array",
            "description": "Which zones the ranking list is read for.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "animation",
                "music",
                "games",
                "entertainment",
                "ghost",
                "dance",
                "fashion",
                "life",
                "tech",
                "film",
                "food",
                "animals",
                "cars",
                "knowledge"
              ],
              "enumTitles": [
                "All site",
                "Animation",
                "Music",
                "Games",
                "Entertainment",
                "Ghost videos",
                "Dance",
                "Fashion",
                "Life",
                "Technology",
                "Film and TV",
                "Food",
                "Animals",
                "Cars",
                "Knowledge"
              ]
            },
            "default": [
              "all"
            ]
          },
          "rankingType": {
            "title": "Ranking type",
            "enum": [
              "all",
              "origin",
              "rookie"
            ],
            "type": "string",
            "description": "Which videos the ranking list holds.",
            "default": "all"
          },
          "startUrls": {
            "title": "Video and user links",
            "type": "array",
            "description": "Links, one per line: a video (bilibili.com/video/BV17x411w7KC, BV or av numbers) to read its comments and danmaku, or a user (space.bilibili.com/2) for the profile.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "User numbers",
            "type": "array",
            "description": "Bilibili user numbers such as 2 or 946974, one per line. You get the profile with followers, level and video count.",
            "items": {
              "type": "string"
            }
          },
          "maxCommentsPerVideo": {
            "title": "Comments per video",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Also read this many comments of every video found. 0 means none. Video links read 50 when comments and danmaku are both 0.",
            "default": 0
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "new"
            ],
            "type": "string",
            "description": "Which comments come first.",
            "default": "hot"
          },
          "maxRepliesPerComment": {
            "title": "Replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Also read this many replies of every comment. 0 means none. Each reply is one more record.",
            "default": 0
          },
          "maxDanmakuPerVideo": {
            "title": "Danmaku per video",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Also read this many danmaku (the scrolling comments) of every video found, from its first part. Bilibili serves up to about 6,000 of them.",
            "default": 0
          },
          "maxItemsPerSearch": {
            "title": "Videos per search or list",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Stop each search text and each list after this many videos. Bilibili shows 1,000 per search at most.",
            "default": 100
          },
          "onlyNew": {
            "title": "Only new records",
            "type": "boolean",
            "description": "Skip records that earlier runs of this same input already returned, so you get and pay for new ones only. The first run works as usual and remembers what it returned, in your key-value store 'bilibili-scraper-only-new'.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 10000000,
            "type": "integer",
            "description": "Stop after this many records in total (videos, comments, danmaku, users and keywords all count). You are charged per record.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Requests at the same time",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages are read in parallel. Raise it for large searches.",
            "default": 5
          },
          "secondsBetweenRequests": {
            "title": "Seconds between requests",
            "minimum": 0,
            "maximum": 60,
            "type": "number",
            "description": "Pause between requests. After a refusal the Actor doubles the pause and switches to Apify Proxy when it can.",
            "default": 0.1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}