{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper",
    "description": "Scrape Bilibili (哔哩哔哩 / B站) videos by keyword or link, creators (UP主) and their uploads, comments with replies, danmaku and the popular and ranking lists: views, likes, coins, favorites, shares, tags and follower counts. No login or cookies.",
    "version": "0.1",
    "x-build-id": "6zmpr7k7p0o7LDrJ0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automly~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automly-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/automly~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-automly-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/automly~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-automly-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": "Keywords to search on Bilibili, one per line, e.g. 原神, minecraft or 人工智能. Chinese and English both work. Each term is searched on its own; see Search for, Sort by and the date filters below.",
            "items": {
              "type": "string"
            }
          },
          "searchFor": {
            "title": "Search for",
            "enum": [
              "videos",
              "creators"
            ],
            "type": "string",
            "description": "What the search terms find: videos (default) or creators (UP主). A creator found by search is saved with their newest uploads (see Videos per creator).",
            "default": "videos"
          },
          "maxResults": {
            "title": "Max results per search or list",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Most videos (or creators) to save from each search term and from the trending list, e.g. 100. Bilibili shows 1,000 results per search; past that, the rest of a video search is read newest first, so large numbers work too.",
            "default": 100
          },
          "startUrls": {
            "title": "Bilibili links",
            "type": "array",
            "description": "Video links, BV or av ids, creator links or UIDs, b23.tv share links or search links, one per line, e.g. https://www.bilibili.com/video/BV14Enb6LEBX, BV14Enb6LEBX, av170001, https://space.bilibili.com/546195, 546195 or https://b23.tv/xxxx. A video link gives that video; a creator gives the creator's profile and newest uploads; a search link searches its keyword.",
            "items": {
              "type": "string"
            }
          },
          "videosPerCreator": {
            "title": "Videos per creator",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "How many of each creator's newest uploads to save, e.g. 20. Set 0 for the creator's profile row only. The date filters below apply to uploads too.",
            "default": 20
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites",
              "comments"
            ],
            "type": "string",
            "description": "Order of video search results, as on Bilibili's own search page.",
            "default": "relevance"
          },
          "duration": {
            "title": "Video length",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Keep only videos of this length in video searches.",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this date, e.g. 2026-01-01, or within a time span, e.g. 3 months. Applies to video searches and creators' uploads."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published on or before this date, e.g. 2026-06-30. Applies to video searches and creators' uploads."
          },
          "trending": {
            "title": "Trending videos",
            "enum": [
              "none",
              "popular",
              "precious",
              "ranking-all",
              "ranking-anime",
              "ranking-music",
              "ranking-dance",
              "ranking-game",
              "ranking-knowledge",
              "ranking-tech",
              "ranking-sports",
              "ranking-car",
              "ranking-life",
              "ranking-food",
              "ranking-animal",
              "ranking-kichiku",
              "ranking-fashion",
              "ranking-entertainment",
              "ranking-film"
            ],
            "type": "string",
            "description": "Also save one of Bilibili's trending lists, e.g. Popular now or the ranking of a category, with each video's place on the list. Works with no search terms or links too. Max results per search or list caps it.",
            "default": "none"
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also save the comments of every video saved (from searches, links, creators and trending lists). Each comment is its own row.",
            "default": false
          },
          "commentsPerVideo": {
            "title": "Comments per video",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Most top-level comments to save per video, e.g. 100.",
            "default": 100
          },
          "commentsSort": {
            "title": "Sort comments by",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Which comments come first.",
            "default": "hot"
          },
          "repliesPerComment": {
            "title": "Replies per comment",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Also save up to this many replies (楼中楼) to each saved comment, e.g. 10. 0 saves no replies. Each reply is its own comment row.",
            "default": 0
          },
          "includeDanmaku": {
            "title": "Include danmaku",
            "type": "boolean",
            "description": "Also save each video's danmaku (弹幕, the bullet comments shown over the video) as one row per video: every danmaku with its second in the video, text, time sent, color and position.",
            "default": false
          },
          "maxItems": {
            "title": "Max rows in total",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Most rows to save in the whole run (videos, creators, comments and danmaku together), e.g. 1000. 0 means no limit beyond the settings above.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Leave the default.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}