{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: Videos, Comments, Danmaku & Creators",
    "description": "Scrape Bilibili (哔哩哔哩): video search, video stats, comment threads, danmaku reaction profiles, creator profiles and the popular board. No login, no cookie.",
    "version": "1.0",
    "x-build-id": "Hl9JOogw0eI3tBm3D"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mrdoe~bilibili-scraper-videos-comments-danmaku/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mrdoe-bilibili-scraper-videos-comments-danmaku",
        "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/mrdoe~bilibili-scraper-videos-comments-danmaku/runs": {
      "post": {
        "operationId": "runs-sync-mrdoe-bilibili-scraper-videos-comments-danmaku",
        "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/mrdoe~bilibili-scraper-videos-comments-danmaku/run-sync": {
      "post": {
        "operationId": "run-sync-mrdoe-bilibili-scraper-videos-comments-danmaku",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "video_detail",
              "video_comments",
              "user_videos",
              "user_profile",
              "popular"
            ],
            "type": "string",
            "description": "search = videos by keyword, video_detail = full stats for video URLs, video_comments = comment threads, user_videos = a creator's videos, user_profile = creator stats, popular = the trending board.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword in Chinese or English (search mode). Chinese keywords return the most videos.",
            "default": ""
          },
          "searchAliases": {
            "title": "Extra search terms",
            "type": "array",
            "description": "More keywords to search and merge, for example the Chinese name of a brand.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "autoLocalize": {
            "title": "Auto-search Chinese brand names",
            "type": "boolean",
            "description": "Also searches the Chinese name of a common brand or game (for example Nike also searches 耐克) and merges the results. Add other names in Extra search terms.",
            "default": true
          },
          "videoUrls": {
            "title": "Video URLs or BV ids",
            "type": "array",
            "description": "Bilibili video links or BV ids (video_detail and video_comments).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "Creator ids",
            "type": "array",
            "description": "Creator ids (mid), space.bilibili.com links or UID:<mid> (user_videos and user_profile).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Videos (or creators) to return, up to 5000. One search reaches about 1000 videos.",
            "default": 20
          },
          "sortOrder": {
            "title": "Sort order (search)",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "totalrank = relevance, click = most views, pubdate = newest, dm = most danmaku, stow = most favorites, scores = most comments.",
            "default": "totalrank"
          },
          "durationFilter": {
            "title": "Duration (search)",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "any, short (under 10 min), medium (10-30), long (30-60) or verylong (over 60).",
            "default": "any"
          },
          "pubtimeBegin": {
            "title": "Published after (search)",
            "type": "string",
            "description": "YYYY-MM-DD or ISO date-time (UTC).",
            "default": ""
          },
          "pubtimeEnd": {
            "title": "Published before (search)",
            "type": "string",
            "description": "YYYY-MM-DD or ISO date-time (UTC).",
            "default": ""
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Also return each video's comments as rows. Every comment is a billed row, so keep maxComments low.",
            "default": false
          },
          "maxComments": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Comments per video when comments are on.",
            "default": 20
          },
          "sortComments": {
            "title": "Comment order",
            "enum": [
              "hot",
              "time",
              "likes"
            ],
            "type": "string",
            "description": "hot = top comments, time = newest, likes = most liked.",
            "default": "hot"
          },
          "includeReplies": {
            "title": "Include comment replies",
            "type": "boolean",
            "description": "Returns replies under each comment as their own rows (with rootRpid and isThreadReply). They count toward Max comments per video.",
            "default": false
          },
          "includeDanmaku": {
            "title": "Include danmaku profiles",
            "type": "boolean",
            "description": "Adds one reaction profile per video (up to 200 videos): count, unique senders, rate, peak minute and a timeline sample of the scrolling comments.",
            "default": false
          },
          "danmakuSampleSize": {
            "title": "Danmaku sample size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many danmaku texts to include in each profile.",
            "default": 25
          },
          "sentimentAnalysis": {
            "title": "Sentiment scoring",
            "type": "boolean",
            "description": "Adds a sentiment field (positive, neutral or negative plus a score from -1 to 1) to videos and comments. Uses a built-in word list, so treat it as a quick signal.",
            "default": false
          },
          "deltaMode": {
            "title": "New videos only",
            "type": "boolean",
            "description": "Search and popular only: return only videos not returned by an earlier run with the same state key.",
            "default": false
          },
          "deltaStateKey": {
            "title": "Delta state key",
            "type": "string",
            "description": "Name for the saved state when new-videos-only is on, for example nike-weekly.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy is on by default for reliable access. Change the country or group if you need to.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}