{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Danmaku Scraper - Bullet Comments by Video",
    "description": "Scrape the danmaku (弹幕 bullet comments) of public Bilibili videos: text, video time, sent time, display mode, colour and weight. From video links, channels or search. Priced per line. No login, no proxy setup.",
    "version": "0.1",
    "x-build-id": "ReurNJRuly2HYRL15"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/teodor_banea~bilibili-danmaku-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-teodor_banea-bilibili-danmaku-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/teodor_banea~bilibili-danmaku-scraper/runs": {
      "post": {
        "operationId": "runs-sync-teodor_banea-bilibili-danmaku-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/teodor_banea~bilibili-danmaku-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-teodor_banea-bilibili-danmaku-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": {
          "videoUrls": {
            "title": "Videos",
            "type": "array",
            "description": "Enter videos, one per line: a link (https://www.bilibili.com/video/BV17x411w7KC), a BV id, an av number (av170001) or a b23.tv short link. A link to one part (…?p=3) reads that part only; other entries follow \"Parts of multi-part videos\". BV ids are case-sensitive — copy them exactly.",
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels",
            "type": "array",
            "description": "Enter channels, one per line: a channel link (https://space.bilibili.com/546195), the channel number or the exact channel name. The danmaku of each channel's latest videos are read.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerChannel": {
            "title": "Videos per channel",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "How many of each channel's newest videos to read.",
            "default": 10
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Enter keywords, one per line. The danmaku of the top videos of each search are read.",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "views",
              "newest",
              "danmaku",
              "favorites",
              "comments"
            ],
            "type": "string",
            "description": "Choose which videos count as the top results of a search.",
            "default": "relevance"
          },
          "maxVideosPerQuery": {
            "title": "Videos per search query",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many of the top videos of each search to read.",
            "default": 10
          },
          "parts": {
            "title": "Parts of multi-part videos",
            "enum": [
              "all",
              "first"
            ],
            "type": "string",
            "description": "Read every part (分P) of a multi-part video, or the first part only.",
            "default": "all"
          },
          "maxDanmakuPerVideo": {
            "title": "Maximum danmaku per video",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Limit the lines taken from each video; the earliest lines by part and video time are kept. Set to 0 for all Bilibili shows visitors.",
            "default": 0
          },
          "textContains": {
            "title": "Text contains",
            "type": "array",
            "description": "Keep only lines containing any of these words (not case-sensitive). Leave empty to keep all lines.",
            "items": {
              "type": "string"
            }
          },
          "minVideoTimeSec": {
            "title": "From video time",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only lines shown at or after this moment of the part (seconds from its start)."
          },
          "maxVideoTimeSec": {
            "title": "To video time",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep only lines shown at or before this moment of the part (seconds from its start)."
          },
          "sentAfter": {
            "title": "Sent after",
            "type": "string",
            "description": "Keep only lines sent on or after this date (UTC), or within a recent period such as \"7 days\". Use it in scheduled runs to collect only new lines."
          },
          "sentBefore": {
            "title": "Sent before",
            "type": "string",
            "description": "Keep only lines sent before this date (UTC)."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Limit the danmaku lines of the whole run. Set to 0 for unlimited (capped at 500,000 lines to protect you from a surprise bill).",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}