{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Full Scraper",
    "description": "Download Bilibili videos, plus Bilibili comments, danmaku, uploaders, search, rankings, manga and games. 18 modes, no login or cookies needed.",
    "version": "1.0",
    "x-build-id": "VVnfuJvNpRusCnkXf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ecommerce_leads~bilibili-full-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ecommerce_leads-bilibili-full-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/ecommerce_leads~bilibili-full-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ecommerce_leads-bilibili-full-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/ecommerce_leads~bilibili-full-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ecommerce_leads-bilibili-full-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": "What do you want to do?",
            "enum": [
              "download",
              "video",
              "comments",
              "danmaku",
              "uploader",
              "search",
              "popular",
              "ranking",
              "related",
              "channels",
              "manga",
              "games",
              "promos",
              "heatmap",
              "videoshot",
              "pages",
              "card",
              "activity"
            ],
            "type": "string",
            "description": "Pick the Bilibili task to run. **Download videos** is the default and the most used: paste Bilibili links and get direct video download URLs back. Every mode's fields are shown below — the run warns you if you fill in a field the selected mode ignores.",
            "default": "download"
          },
          "videoUrls": {
            "title": "Bilibili video links",
            "type": "array",
            "description": "Bilibili videos to download. Paste anything Bilibili gives you — full links (`https://www.bilibili.com/video/BV1xx411c7mD`), `b23.tv` short links, a bare BV id, or an old `av` number. Each link becomes one row in the output.",
            "items": {
              "type": "string"
            }
          },
          "quality": {
            "title": "Preferred video quality",
            "enum": [
              "16",
              "32",
              "64",
              "80",
              "112",
              "116",
              "120"
            ],
            "type": "string",
            "description": "Target quality. The best stream at or below this is picked, so a lower value really does give a smaller file. ⚠️ Without a logged-in Bilibili account the API caps downloads at **480P** no matter what you ask for — the row's `quality_capped` field says so when that happens, and you still get the file.",
            "default": "80"
          },
          "codec": {
            "title": "Video codec",
            "enum": [
              "any",
              "avc",
              "hevc",
              "av1"
            ],
            "type": "string",
            "description": "`avc` (H.264) plays everywhere and is the safe choice. `hevc` (H.265) and `av1` produce smaller files but need a newer player. If the video has no track in the codec you pick, the best available one is used instead rather than returning nothing.",
            "default": "any"
          },
          "audioTrack": {
            "title": "Audio track",
            "enum": [
              "best",
              "worst",
              "none"
            ],
            "type": "string",
            "description": "Bilibili serves video and audio as **separate files** (DASH). `best` returns the highest-bitrate audio track alongside the video. Pick `none` if you only want the silent video file.",
            "default": "best"
          },
          "includeRawData": {
            "title": "Include Bilibili's raw API response",
            "type": "boolean",
            "description": "Adds a `raw` field with the full untouched Bilibili payload. Leave off unless you need a Bilibili field this actor does not already map — it makes each row much larger.",
            "default": false
          },
          "videoUrl": {
            "title": "Bilibili video link",
            "type": "string",
            "description": "The Bilibili video whose comments, danmaku, related videos, heatmap or preview thumbnails you want. Accepts a full Bilibili link, a `b23.tv` short link, a BV id or an av number. Example: `https://www.bilibili.com/video/BV1xx411c7mD`"
          },
          "maxComments": {
            "title": "Max Bilibili comments",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "How many top-level Bilibili comments to fetch. Bilibili serves these in pages of 20 and the actor keeps paging until it reaches this number or Bilibili runs out.",
            "default": 50
          },
          "includeReplies": {
            "title": "Also fetch Bilibili comment replies",
            "type": "boolean",
            "description": "Fetches the reply thread under every Bilibili comment that has one. Each reply that comes back is billed as one Bilibili comment.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per Bilibili comment",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Cap on replies fetched per Bilibili comment. Only applies when replies are enabled.",
            "default": 10
          },
          "maxDanmaku": {
            "title": "Max Bilibili danmaku",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How many danmaku (弹幕) to return from the video, ordered by their position in the video. This is the historical snapshot Bilibili stores — live danmaku travels over a websocket and cannot be scraped.",
            "default": 500
          },
          "maxRelated": {
            "title": "Max related Bilibili videos",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many Bilibili videos recommended alongside the target video to return.",
            "default": 20
          },
          "uploaderUrls": {
            "title": "Bilibili uploader links",
            "type": "array",
            "description": "Bilibili uploaders (UP主) to scrape. Paste the space link (`https://space.bilibili.com/546195`) or the bare numeric uploader id (mid).",
            "items": {
              "type": "string"
            }
          },
          "maxUploaderVideos": {
            "title": "Max videos per Bilibili uploader",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "How many of the uploader's recent Bilibili videos to include alongside their profile. Leave at 0 for profile stats only.",
            "default": 0
          },
          "keyword": {
            "title": "Bilibili search keyword",
            "type": "string",
            "description": "What to search Bilibili for. Works with Chinese and English terms. Example: `原神` or `minecraft`."
          },
          "maxSearchResults": {
            "title": "Max Bilibili search results",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many Bilibili search results to return. Bilibili pages these 20 at a time.",
            "default": 20
          },
          "maxPopular": {
            "title": "Max popular Bilibili videos",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many videos to pull from Bilibili's overall popular feed (综合热门).",
            "default": 20
          },
          "rankingPartition": {
            "title": "Bilibili ranking partition (tid)",
            "minimum": 0,
            "type": "integer",
            "description": "Which Bilibili partition's ranking board to read. `0` is the site-wide board. Run the 🧭 Bilibili channel list mode to get every partition's `tid`. Note that 番剧 / 影视 partitions are PGC and have no ranking board.",
            "default": 0
          },
          "maxRanking": {
            "title": "Max Bilibili ranking entries",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many entries to return from the Bilibili ranking board.",
            "default": 50
          },
          "mangaBlock": {
            "title": "Bilibili manga board",
            "enum": [
              "hot",
              "fans",
              "recommend"
            ],
            "type": "string",
            "description": "Which Bilibili Manga (漫画) board to read. Bilibili Manga is a separate service from the video site — its `comic_id` opens the manga reader and does not work as a video id.",
            "default": "hot"
          },
          "maxManga": {
            "title": "Max Bilibili manga titles",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many Bilibili manga titles to return from the selected board.",
            "default": 50
          },
          "promoSlots": {
            "title": "Bilibili promo slot ids",
            "type": "string",
            "description": "Comma-separated Bilibili homepage slot ids. `3449` is the homepage carousel, `4694` the homepage promo row, `142` the player overlay. Video promos come back with a BV id in `target` that you can feed straight into the Download mode.",
            "default": "3449,4694"
          },
          "activityId": {
            "title": "Bilibili campaign id (sid)",
            "type": "string",
            "description": "The Bilibili campaign / 征稿企划 id to look up. Bilibili cannot find a campaign from a video link alone, so this id is required — it appears as `mission_id` on a video's detail data, or in the campaign page URL. Optionally also fill in the Bilibili video link above to tie the campaign to a video."
          },
          "crawlerUrl": {
            "title": "Crawler API base URL",
            "type": "string",
            "description": "Base URL of the Bilibili crawler backend, e.g. `https://ping.example.com`. Falls back to the `CRAWLER_URL` environment variable."
          },
          "crawlerApiKey": {
            "title": "Crawler API key",
            "type": "string",
            "description": "API key for the Bilibili crawler backend. Falls back to the `CRAWLER_API_KEY` environment variable."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}