{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper - Videos, Search, Channels, Trending",
    "description": "Scrape public Bilibili (B站) data: keyword video search with filters, video details with full stats and tags, channel uploads, trending and ranking boards, channel details, user search, hot searches and danmaku. No login, no proxy setup.",
    "version": "0.1",
    "x-build-id": "9KepXTIeO0rellNJQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/teodor_banea~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-teodor_banea-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/teodor_banea~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-teodor_banea-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/teodor_banea~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-teodor_banea-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": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "search",
              "videoDetails",
              "channelVideos",
              "trending",
              "channelDetails",
              "userSearch",
              "hotSearches",
              "danmaku"
            ],
            "type": "string",
            "description": "Choose what the run collects. Video search: videos matching your keywords. Video details: the videos you link. Channel videos: the uploads of channels. Trending: popular, ranking and must-watch boards. Channel details: one row per channel. Channel search: channels matching your keywords. Hot searches: the current hot search words. Danmaku: the bullet comments of videos.",
            "default": "search"
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Enter keywords, one per line (Chinese or any language). Used by \"Video search\" and \"Channel search\". Bilibili shows at most about 1,000 videos per query; use the filters or more specific keywords to go further.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites",
              "comments"
            ],
            "type": "string",
            "description": "Choose the order of the search results.",
            "default": "relevance"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "under10",
              "from10to30",
              "from30to60",
              "over60"
            ],
            "type": "string",
            "description": "Keep only videos of this length.",
            "default": "any"
          },
          "category": {
            "title": "Category",
            "enum": [
              "all",
              "anime",
              "music",
              "gaming",
              "entertainment",
              "tvSeries",
              "movies",
              "knowledge",
              "kichiku",
              "dance",
              "fashion",
              "lifestyle",
              "documentaries",
              "filmAndTv",
              "tech",
              "food",
              "animals",
              "cars",
              "sports"
            ],
            "type": "string",
            "description": "Keep only videos of this main category.",
            "default": "all"
          },
          "maxVideosPerQuery": {
            "title": "Maximum videos per query",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Limit the videos taken from each search query. Set to 0 for as many as Bilibili shows (about 1,000).",
            "default": 100
          },
          "maxUsersPerQuery": {
            "title": "Maximum channels per query",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Limit the channels taken from each query in \"Channel search\". Set to 0 for as many as Bilibili shows (about 1,000).",
            "default": 50
          },
          "includeChannelDetails": {
            "title": "Include full channel details",
            "type": "boolean",
            "description": "In \"Channel search\", also read each channel's card and its video count: following and likes counts, the verified reason and the number of videos the channel shows. Adds two small requests per channel.",
            "default": true
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Enter channels, one per line: a channel link (https://space.bilibili.com/546195), the channel number (546195) or the exact channel name. Used by \"Channel videos\" and \"Channel details\".",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerChannel": {
            "title": "Maximum videos per channel",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Limit the videos taken from each channel (newest first). Set to 0 for all.",
            "default": 100
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Keep only videos published on or after this date (UTC), or within a recent period such as \"7 days\". Applies to \"Video search\" and \"Channel videos\". Useful for scheduled runs."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Keep only videos published before this date (UTC). Applies to \"Video search\" and \"Channel videos\"."
          },
          "videoUrls": {
            "title": "Video links",
            "type": "array",
            "description": "Enter videos, one per line: a link (https://www.bilibili.com/video/BV1xx411c7mD), a BV id, an av number (av170001) or a b23.tv short link. Used by \"Video details\" and \"Danmaku\". Up to 5,000 per run.",
            "items": {
              "type": "string"
            }
          },
          "maxDanmakuPerVideo": {
            "title": "Maximum danmaku per video",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Limit the danmaku (bullet comments) taken from each video, across all its parts. Cost note: every danmaku line is one billed row, and a long multi-part video can have 10,000 or more. Bilibili shows logged-out visitors up to about 1,000-1,200 of the most recent danmaku per part. Set to 0 for all it shows.",
            "default": 100
          },
          "trendingBoards": {
            "title": "Trending boards",
            "type": "array",
            "description": "Choose the boards to read. Popular now: up to 500 videos trending today. Ranking: the top 100 of a category. Weekly must-watch: the 每周必看 list. All-time must-watch: the 入站必刷 list.",
            "items": {
              "type": "string",
              "enum": [
                "popular",
                "ranking",
                "weekly",
                "mustWatch"
              ],
              "enumTitles": [
                "Popular now (综合热门)",
                "Ranking (排行榜)",
                "Weekly must-watch (每周必看)",
                "All-time must-watch (入站必刷)"
              ]
            },
            "default": [
              "popular"
            ]
          },
          "rankingCategory": {
            "title": "Ranking category",
            "enum": [
              "all",
              "anime",
              "music",
              "gaming",
              "entertainment",
              "tvSeries",
              "movies",
              "knowledge",
              "kichiku",
              "dance",
              "fashion",
              "lifestyle",
              "documentaries",
              "filmAndTv",
              "tech",
              "food",
              "animals",
              "cars",
              "sports"
            ],
            "type": "string",
            "description": "Choose the category of the Ranking board (up to 100 videos).",
            "default": "all"
          },
          "rankingType": {
            "title": "Ranking type",
            "enum": [
              "all",
              "original",
              "newcomers"
            ],
            "type": "string",
            "description": "Choose which ranking to read.",
            "default": "all"
          },
          "weeklyIssue": {
            "title": "Weekly must-watch issue",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Enter an issue number of the weekly must-watch list (e.g. 399). Leave empty or 0 for the latest issue."
          },
          "includeVideoDetails": {
            "title": "Include full video details",
            "type": "boolean",
            "description": "Read each video's own page data too: exact views, danmaku, comments, favourites, coins, shares and likes, all tags, parts, collection, honours and co-creators. Adds one or two requests per video, so runs take longer. Applies to \"Video search\", \"Channel videos\" and \"Trending\" (\"Video details\" always includes them).",
            "default": true
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Limit the rows of the whole run (videos, channels, hot searches or danmaku). Set to 0 for unlimited (capped at 10,000 to protect you from a surprise bill).",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}