{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Video & Trend Data – B站 Stats, Comments & Danmaku",
    "description": "Monitor public Bilibili (哔哩哔哩, B站) video data: views, likes, coins, tags, UP主 creator profiles, comments, danmaku (弹幕) insights and public subtitles. Keyword, trending and creator modes. No login. Unofficial, not affiliated with Bilibili.",
    "version": "0.1",
    "x-build-id": "8IL4RhBW8qlARwuA9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/realletoangt~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-realletoangt-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/realletoangt~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-realletoangt-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/realletoangt~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-realletoangt-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": {
          "searchKeywords": {
            "title": "Search keywords",
            "type": "array",
            "description": "Video search terms (Chinese or English), e.g. 原神, 美妆, iPhone 17.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or BV ids",
            "type": "array",
            "description": "e.g. https://www.bilibili.com/video/BV1xx411c7mD or just BV1xx411c7mD.",
            "items": {
              "type": "string"
            }
          },
          "channelUrls": {
            "title": "Channel (UP主) URLs or user ids",
            "type": "array",
            "description": "e.g. https://space.bilibili.com/670061998 or 670061998. Returns the channel profile and its latest videos.",
            "items": {
              "type": "string"
            }
          },
          "scrapePopular": {
            "title": "Scrape popular / trending (热门)",
            "type": "boolean",
            "description": "Include videos from Bilibili's popular board.",
            "default": false
          },
          "maxVideos": {
            "title": "Max videos (per keyword / channel / popular)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Per keyword, channel or popular board (search is capped by Bilibili at 1,000).",
            "default": 20
          },
          "searchOrder": {
            "title": "Search sort",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow"
            ],
            "type": "string",
            "description": "Order of keyword search results.",
            "default": "totalrank"
          },
          "includeDetails": {
            "title": "Full video details",
            "type": "boolean",
            "description": "Coins, shares, full tags, cid, parts. One extra request per video.",
            "default": true
          },
          "maxComments": {
            "title": "Max comments per video",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no comments.",
            "default": 0
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "hot",
              "new"
            ],
            "type": "string",
            "description": "Which comments to fetch first.",
            "default": "hot"
          },
          "includeCommenterNames": {
            "title": "Include commenter usernames",
            "type": "boolean",
            "description": "Off by default (data minimisation). User IDs and avatars are never collected.",
            "default": false
          },
          "includeDanmaku": {
            "title": "Danmaku (弹幕) analysis",
            "type": "boolean",
            "description": "Per-video danmaku item: count, per-minute curve and peak minute. Sender IDs are never collected.",
            "default": false
          },
          "maxDanmakuLines": {
            "title": "Max raw danmaku lines",
            "minimum": 0,
            "type": "integer",
            "description": "Also include up to N raw danmaku lines (time + text) in the danmaku item.",
            "default": 0
          },
          "includeSubtitles": {
            "title": "Subtitles (字幕)",
            "type": "boolean",
            "description": "Uploader-provided subtitles when publicly available (AI-generated subtitles need login and are not returned).",
            "default": false
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 300,
            "type": "integer",
            "description": "Bilibili rate-limits aggressively; lower values risk HTTP 412.",
            "default": 1200
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Usually not needed. Use Apify Proxy or your own proxyUrls if you hit HTTP 412."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}