{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper (B站): Video Search, Rankings & 弹幕 Analytics",
    "description": "Scrape Bilibili (哔哩哔哩 / B站) videos: keyword search past the 1,000-result cap, popular and ranking lists with rank movement, video stats and engagement rates, growth tracker, creator uploads, anonymous danmaku (弹幕) analytics, hot searches. No login. No comments or profiles.",
    "version": "0.4",
    "x-build-id": "7bzVcu1abXEUWmODh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/den_den~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-den_den-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/den_den~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-den_den-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/den_den~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-den_den-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "search",
              "popular",
              "ranking",
              "video_detail",
              "creator_videos",
              "hot_searches"
            ],
            "type": "string",
            "description": "Search: videos for your search terms. Popular / Ranking: Bilibili's trending lists with rank movement. Video details: stats for your videos, optionally tracking growth between runs. Creator videos: a creator's uploads plus a performance summary. Hot search terms: what people search right now (free).",
            "default": "search"
          },
          "searchQueries": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords to search, each searched separately. Chinese works best (咖啡, 人工智能); add English or brand variants as extra terms (Nike, 耐克).",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort videos by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites",
              "comments"
            ],
            "type": "string",
            "description": "Order of video search results.",
            "default": "relevance"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Only videos of this length (video search only).",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Published on or after",
            "type": "string",
            "description": "Only videos published on or after this date (YYYY-MM-DD) or within a relative period such as \"7 days\", \"3 months\" or \"1 year\"."
          },
          "publishedBefore": {
            "title": "Published on or before",
            "type": "string",
            "description": "Only videos published on or before this date (YYYY-MM-DD)."
          },
          "fullCoverage": {
            "title": "Full coverage (beyond 1,000)",
            "type": "boolean",
            "description": "Bilibili stops at 1,000 results per search. Turn on to split the date range (default: last 30 days) into windows small enough to get every matching video, newest first. Sort is then by newest.",
            "default": false
          },
          "videoUrls": {
            "title": "Videos",
            "type": "array",
            "description": "Video links, b23.tv short links or IDs (BV1xx411c7mD, av170001), for Video details.",
            "items": {
              "type": "string"
            }
          },
          "trackChanges": {
            "title": "Track growth between runs",
            "type": "boolean",
            "description": "Video details only: remember each video's stats and add the views, likes, coins and other counts gained since the previous run with the same Track key. Schedule it daily to follow a campaign.",
            "default": false
          },
          "trackKey": {
            "title": "Track key",
            "type": "string",
            "description": "Name of the saved stats for growth tracking. Use one key per campaign or video list.",
            "default": "default"
          },
          "creatorIds": {
            "title": "Creators",
            "type": "array",
            "description": "Creator IDs or space links (https://space.bilibili.com/946974), for Creator videos.",
            "items": {
              "type": "string"
            }
          },
          "includeCreatorSummary": {
            "title": "Creator performance summary",
            "type": "boolean",
            "description": "Creator videos only: add one free row per creator with average and median views, upload frequency and latest upload, computed from the videos scraped.",
            "default": true
          },
          "rankingCategories": {
            "title": "Ranking categories",
            "type": "array",
            "description": "Categories for Ranking mode, each a separate top-100 list. Leave empty for the overall ranking.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "animation",
                "music",
                "dance",
                "game",
                "knowledge",
                "tech",
                "sports",
                "car",
                "life",
                "food",
                "animal",
                "fashion",
                "entertainment",
                "film",
                "kichiku"
              ],
              "enumTitles": [
                "All",
                "Animation",
                "Music",
                "Dance",
                "Gaming",
                "Knowledge",
                "Tech",
                "Sports",
                "Cars",
                "Life",
                "Food",
                "Animals",
                "Fashion",
                "Entertainment",
                "Film & TV",
                "Kichiku (remix)"
              ]
            },
            "default": [
              "all"
            ]
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum videos per search term, per creator, or per list. With Full coverage a term can return many thousands.",
            "default": 100
          },
          "enrichVideos": {
            "title": "Full video stats",
            "type": "boolean",
            "description": "Search and Creator videos return basic counts only. Turn on to add coins, shares, the full description and complete engagement metrics (one extra request per video, no extra charge).",
            "default": false
          },
          "includeDanmakuAnalytics": {
            "title": "Danmaku analytics",
            "type": "boolean",
            "description": "Add one anonymous analytics row per video ($0.003 per analysed video): danmaku (弹幕) per minute, a minute-by-minute reaction curve, peak moments and phrases repeated by at least 3 viewers. No sender data, no single messages, and phrases with @mentions, uids or long numbers are dropped.",
            "default": false
          },
          "monitorMode": {
            "title": "New videos only (monitor)",
            "type": "boolean",
            "description": "Skip videos returned by earlier runs with the same Monitor key, so a scheduled run gives only new videos and you pay only for those.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Name of the saved list of seen videos. Use a different key per list you track.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}