{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper API – Danmaku Summary & Videos (B站弹幕)",
    "description": "Paste Bilibili video URLs or BV IDs to export video stats and a danmaku summary with a peak minute and timed text samples. Summaries cover the public danmaku pool, which can be capped. No login.",
    "version": "0.7",
    "x-build-id": "aVXRyLpWvV5qvrBQh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dheerajitbhu~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dheerajitbhu-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/dheerajitbhu~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-dheerajitbhu-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/dheerajitbhu~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-dheerajitbhu-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": "Bilibili data to export",
            "enum": [
              "search",
              "video_detail",
              "video_comments",
              "popular",
              "user_profile",
              "selftest"
            ],
            "type": "string",
            "description": "Use video_detail for known videos, video_comments for discussion, search for keywords, popular for trending videos or user_profile for creator stats.",
            "default": "search"
          },
          "searchQueries": {
            "title": "Video search keywords",
            "type": "array",
            "description": "Enter search terms such as 原神 or 机械键盘. An empty search uses 原神 as the sample.",
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Bilibili video links or BV IDs",
            "type": "array",
            "description": "Paste public video links or BV IDs such as BV1qm41197pQ. Use in video_detail or video_comments mode.",
            "items": {
              "type": "string"
            }
          },
          "userIds": {
            "title": "Creator profile URLs or IDs",
            "type": "array",
            "description": "In user_profile mode, enter numeric creator IDs or public Bilibili creator profile links.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max videos per keyword or popular list",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Caps the number of videos delivered. Public keyword search goes up to about 1,000 per keyword.",
            "default": 20
          },
          "sortOrder": {
            "title": "Video search order",
            "enum": [
              "totalrank",
              "pubdate",
              "click",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "Choose how search results are ordered, such as relevance, newest, views or danmaku count.",
            "default": "totalrank"
          },
          "durationFilter": {
            "title": "Video duration",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "Limit keyword search to a video length range or choose any duration.",
            "default": "any"
          },
          "publishedAfter": {
            "title": "Videos published after",
            "type": "string",
            "description": "Optional search date bound. Enter YYYY-MM-DD, YYYYMMDD or an ISO 8601 timestamp. Values without a time zone use UTC. Check the run status if a date is invalid."
          },
          "publishedBefore": {
            "title": "Videos published before",
            "type": "string",
            "description": "Optional upper search date bound. Use the same date formats as Videos published after."
          },
          "includeVideoDetails": {
            "title": "Add details to search and popular rows",
            "type": "boolean",
            "description": "Adds available details such as coin and share counts, part count and whether subtitle tracks exist. Same price per video row.",
            "default": false
          },
          "includeComments": {
            "title": "Include video comments",
            "type": "boolean",
            "description": "Adds discussion rows in search, video_detail and popular modes. Each delivered comment is billed as a separate row.",
            "default": false
          },
          "maxComments": {
            "title": "Max top-level comments per video",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Applies to video_comments mode or when Include video comments is on. Replies have their own cap.",
            "default": 20
          },
          "sortComments": {
            "title": "Comment order",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "Choose hot for popular comments or newest for recent comments.",
            "default": "hot"
          },
          "includeReplies": {
            "title": "Include comment replies",
            "type": "boolean",
            "description": "Adds delivered replies as separate billable rows associated with their top-level comment.",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per top-level comment",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Applies when Include comment replies is on.",
            "default": 10
          },
          "includeDanmaku": {
            "title": "Include one danmaku summary per video",
            "type": "boolean",
            "description": "Adds a summary of the public pool with a peak minute, counts and timed text samples. Costs $0.01 for each delivered summary.",
            "default": false
          },
          "danmakuSampleSize": {
            "title": "Max danmaku text samples per summary",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Limits how many timed examples appear in a summary. Use 0 to return the summary without example messages.",
            "default": 25
          },
          "outputFormat": {
            "title": "Dataset format",
            "enum": [
              "standard",
              "compact"
            ],
            "type": "string",
            "description": "Standard writes the regular dataset. Compact also supplies a smaller copy for AI workflows at the same event price.",
            "default": "standard"
          },
          "maxChargeUsd": {
            "title": "Max run charge (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Caps event charges for the run. Rows already delivered remain available.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Advanced connection settings",
            "type": "object",
            "description": "Optional. Leave this setting at its default for a standard export.",
            "default": {
              "useApifyProxy": true
            }
          },
          "requestIntervalSecs": {
            "title": "Time between reads (seconds)",
            "minimum": 0.5,
            "maximum": 10,
            "type": "number",
            "description": "Sets the wait between page reads. The default suits a routine export.",
            "default": 1
          },
          "outputMode": {
            "title": "Full export or changes only",
            "enum": [
              "all",
              "changesOnly"
            ],
            "type": "string",
            "description": "Use all for a snapshot. Use changesOnly to establish a baseline and compare later runs for new, changed and removed items.",
            "default": "all"
          },
          "monitorName": {
            "title": "Saved comparison name",
            "type": "string",
            "description": "For changesOnly. Reuse the same name for runs that share a baseline. Leave it blank to use an automatic name."
          },
          "includeRemoved": {
            "title": "Include removed items",
            "type": "boolean",
            "description": "For changesOnly. Include items no longer found in the current comparison. On by default.",
            "default": true
          },
          "ignoreFields": {
            "title": "Fields to ignore in comparisons",
            "type": "array",
            "description": "For changesOnly. List fields whose changes alone should not trigger a changed row, such as viewCount or likeCount.",
            "items": {
              "type": "string"
            }
          },
          "labels": {
            "title": "Add AI labels to video rows",
            "type": "boolean",
            "description": "Adds optional spam and brand relevance labels to videos in search, video_detail and popular. Each labeled video adds $0.0005.",
            "default": false
          },
          "brandQuery": {
            "title": "Brand or topic for video labels",
            "type": "string",
            "description": "With AI labels enabled, enter a brand or topic for the relevance label. Leave blank to request only the spam label."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}