{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: Videos, Comments, Danmaku & Uploaders",
    "description": "Scrape Bilibili videos by search, link or uploader without logging in: views, likes, coins, tags, uploader profiles, comments with replies and danmaku, in clean rows.",
    "version": "1.0",
    "x-build-id": "W4EsX8ykywy5ghbuT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/stratumics~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-stratumics-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/stratumics~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-stratumics-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/stratumics~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-stratumics-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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Words to search Bilibili videos for, in Chinese or any language (原神, 美食, minecraft). Each term gives up to the maximum number of videos below, in the order you pick.",
            "items": {
              "type": "string"
            }
          },
          "searchOrder": {
            "title": "Search order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "How Bilibili sorts search results.",
            "default": "totalrank"
          },
          "searchDuration": {
            "title": "Video length (search)",
            "enum": [
              "all",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Keep only search results of this length.",
            "default": "all"
          },
          "videoUrls": {
            "title": "Video links or ids",
            "type": "array",
            "description": "Bilibili video links (https://www.bilibili.com/video/BV1zd4y1Q7BE/), BV ids (BV1zd4y1Q7BE), av ids (av386101383) or b23.tv short links. Each gives one video row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "uploaders": {
            "title": "Uploaders",
            "type": "array",
            "description": "Uploader (UP主) space links (https://space.bilibili.com/401742377) or numeric ids (401742377). Each gives the uploader's profile row and their latest videos, newest first.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerInput": {
            "title": "Videos per search or uploader",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most videos to save for each search term (Bilibili's search stops at 1,000) and each uploader.",
            "default": 50
          },
          "includeUploaders": {
            "title": "Save uploader rows",
            "type": "boolean",
            "description": "For uploader inputs, save one row per uploader with name, bio, level, followers, following, video count and verification. Turn off to save only their videos.",
            "default": true
          },
          "newerThan": {
            "title": "Only videos newer than",
            "pattern": "^$|^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])(T[0-2]\\d:[0-5]\\d(:[0-5]\\d)?(\\.\\d+)?(Z|[+-][0-2]\\d:?[0-5]\\d)?)?$|^(\\d+)\\s*(minute|hour|day|week|month|year)s?$",
            "type": "string",
            "description": "Keep videos published on or after this date. Use a date (2026-10-01), an ISO date-time in UTC (2026-10-01T12:00:00Z), or a relative value such as \"7 days\". Searches pass it to Bilibili's date filter and uploader lists stop at the first older video, so you pay only for videos in the range. Leave empty for no limit.",
            "default": ""
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Save the comments of each video saved, one row per comment with its text, author, date, likes and reply count. Comments are charged per comment.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Comments per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most comments to save for each video. With replies on, replies count toward this number too.",
            "default": 50
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Save the replies under each comment, right after it, with parentId and rootId pointing to the comment they answer.",
            "default": false
          },
          "commentsSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Most liked first (as Bilibili shows them) or newest first.",
            "default": "hot"
          },
          "includeDanmaku": {
            "title": "Include danmaku",
            "type": "boolean",
            "description": "Save the danmaku (the comments that fly across the video) of each video saved: text, the second they appear at, color, mode and send time, in time order. Danmaku are charged per item at a much lower price.",
            "default": false
          },
          "maxDanmakuPerVideo": {
            "title": "Danmaku per video",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most danmaku to save for each video, across its parts. Bilibili serves the current pool of each part (up to a few thousand on popular videos).",
            "default": 1000
          },
          "onlyNewVideos": {
            "title": "Only new videos",
            "type": "boolean",
            "description": "Save only videos that earlier runs with the same inputs have not saved. The Actor remembers video ids in the key-value store bilibili-scraper-monitor in your account and stops reading an uploader once it reaches videos it has seen. Pair it with a schedule to follow uploaders.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional. A name for the remembered list (letters, digits and hyphens), so different schedules keep separate histories even with the same inputs. Leave empty to derive it from the inputs.",
            "default": ""
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "With Apify Proxy on (the default), the Actor connects directly, moves to Apify Proxy datacenter IPs if Bilibili refuses it, and to residential IPs only if the datacenter IPs are refused too. Turn it off to never use a proxy, or pick proxy groups or your own proxy URLs to send every request through them.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}