{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Danmaku Scraper - Bullet Comments by Timeline",
    "description": "[💰$0.02/1K] Scrape Bilibili danmaku bullet comments with a time window. Each row keeps timeline offset, render mode, pool, colour, text and sender hash, with a per-part summary row stating declared and delivered counts. Public endpoint, no proxy, no cookies.",
    "version": "0.6",
    "x-build-id": "WA7kTtnkSyisWsOkh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ai-lead-gen-tools~bilibili-danmaku-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ai-lead-gen-tools-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/ai-lead-gen-tools~bilibili-danmaku-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ai-lead-gen-tools-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/ai-lead-gen-tools~bilibili-danmaku-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ai-lead-gen-tools-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",
        "required": [
          "videoUrls"
        ],
        "properties": {
          "videoUrls": {
            "title": "Video URLs or BV ids",
            "type": "array",
            "description": "Full video links, bare BV ids or av ids, one target per video. A `?p=3` suffix limits that target to part 3. A bare cid is not accepted because the public view endpoint cannot resolve it back to a video.",
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many of the listed videos to process, in the order given.",
            "default": 50
          },
          "pageScope": {
            "title": "Which parts of a multi-part video",
            "enum": [
              "all",
              "first",
              "last"
            ],
            "type": "string",
            "description": "A video that is split into parts carries a separate danmaku file per part and each part is its own timeline. `all` reads every part, `first` only part 1, `last` only the final part. A `?p=` suffix on a target overrides this setting for that target.",
            "default": "all"
          },
          "startSec": {
            "title": "Window start, seconds",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only danmaku that appear at or after this second of the timeline. Applied per part, on the file Bilibili already served, so it costs no extra requests. Leave empty to start at zero."
          },
          "endSec": {
            "title": "Window end, seconds",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only danmaku that appear at or before this second of the timeline. Must be greater than the window start when both are set. Leave empty to run to the end of the part."
          },
          "modes": {
            "title": "Danmaku modes",
            "type": "array",
            "description": "Keep only these render modes. Leave empty for all. Numeric ids are accepted as well as names: `scroll` is 1 to 3, `bottom` is 4, `top` is 5, `reverse` is 6, `positioned` is 7, `code` is 8, `bas` is 9.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "pools": {
            "title": "Pools",
            "type": "array",
            "description": "Keep only these pools. Leave empty for all. Numeric ids are accepted as well as names: `normal` is 0, `subtitle` is 1, `special` is 2. Bilibili also serves pool 3 on some videos; it has no name here, so filter it by the number.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "minLength": {
            "title": "Minimum text length",
            "minimum": 0,
            "type": "integer",
            "description": "Drop danmaku shorter than this many characters. Zero keeps everything.",
            "default": 0
          },
          "maxLength": {
            "title": "Maximum text length",
            "minimum": 0,
            "type": "integer",
            "description": "Drop danmaku longer than this many characters. Zero means no upper limit.",
            "default": 0
          },
          "includeText": {
            "title": "Must contain",
            "type": "array",
            "description": "Keep only danmaku whose text contains at least one of these substrings, case-insensitive.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "excludeText": {
            "title": "Must not contain",
            "type": "array",
            "description": "Drop danmaku whose text contains any of these substrings, case-insensitive.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Hard cap on dataset rows for the whole run. One summary row per part is emitted first, so the cap also covers those.",
            "default": 20000
          },
          "requestDelayMs": {
            "title": "Delay between requests",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Gap between requests, in milliseconds. Two requests per part at most: the video card and the danmaku file.",
            "default": 400
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Per-request timeout in seconds.",
            "default": 25
          },
          "runBudgetSecs": {
            "title": "Run budget",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Wall-clock budget. The run stops requesting once it is spent and still writes the rows it already collected."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}