{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili (哔哩哔哩) Video Transcript & Subtitle Extractor",
    "description": "Turn any Bilibili (哔哩哔哩) video link or BV number into clean, LLM-ready text with timestamps.",
    "version": "0.2",
    "x-build-id": "3GKud94XPpPTHMPp2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lanternlab318~bilibili-transcript/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lanternlab318-bilibili-transcript",
        "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/lanternlab318~bilibili-transcript/runs": {
      "post": {
        "operationId": "runs-sync-lanternlab318-bilibili-transcript",
        "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/lanternlab318~bilibili-transcript/run-sync": {
      "post": {
        "operationId": "run-sync-lanternlab318-bilibili-transcript",
        "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": "Bilibili video links",
            "type": "array",
            "description": "One Bilibili video per line: a full link (https://www.bilibili.com/video/BV1z9nt6aE5H/), a BV number (BV1z9nt6aE5H), an av number (av117489384035786) or a b23.tv short link. Share text copied from the app works too. For a multi-part (分P) video, add ?p=3 to pick a part; without it the first part is transcribed.",
            "items": {
              "type": "string"
            }
          },
          "preferPlatformCaptions": {
            "title": "Use the video's own captions when there are any",
            "type": "boolean",
            "description": "Read Bilibili's own caption track first, which is faster and cheaper than recognising the audio. Note that Bilibili serves its caption list to signed-in callers only, and this Actor signs in to nothing, so in practice almost every video falls through to speech recognition. Leave this on anyway: when a track is there, it is the better text.",
            "default": true
          },
          "allowAsr": {
            "title": "Transcribe the audio when there are no captions",
            "type": "boolean",
            "description": "Run open-source speech recognition (SenseVoice-Small) inside this Actor on the video's public audio stream. Nothing is sent to a transcription service and no key is needed. Turn this off to get only the videos that publish a caption track; the rest are then returned with partialReason \"no_captions\" and cost nothing.",
            "default": true
          },
          "includeSegments": {
            "title": "Include the time-coded segments",
            "type": "boolean",
            "description": "Add segments[{start, end, text}] to every row alongside the plain text, so you can jump to a moment in the video. Turn it off for smaller rows when you only need the text.",
            "default": true
          },
          "includeAllParts": {
            "title": "Transcribe every part of a multi-part video",
            "type": "boolean",
            "description": "A Bilibili video can hold many parts (分P). With this off, a link without ?p= gives you the first part only. With it on, every part becomes its own row, bounded by maxItems.",
            "default": false
          },
          "maxDurationSec": {
            "title": "Longest video to transcribe (seconds)",
            "minimum": 1,
            "maximum": 7200,
            "type": "integer",
            "description": "Speech recognition is charged by how much talking it transcribes, so a video longer than this is skipped instead of surprising you with the bill. The row is still written, with partialReason \"too_long\", and is not charged. Videos that publish a caption track are not affected.",
            "default": 600
          },
          "maxItems": {
            "title": "Max transcripts",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Upper bound on the transcripts this run writes and charges for. Videos past it are written with partialReason \"max_items_reached\" and are not charged.",
            "default": 50
          },
          "asrModel": {
            "title": "Speech recognition model",
            "enum": [
              "sensevoice-small"
            ],
            "type": "string",
            "description": "SenseVoice-Small, running on the CPU inside this Actor. It reads Mandarin and Cantonese well, writes punctuation, and names the language it heard. It is the only model this Actor carries, and the one the price below was measured on.",
            "default": "sensevoice-small"
          },
          "asrLanguage": {
            "title": "Spoken language",
            "type": "string",
            "description": "Force the language of the speech, as a short code such as \"zh\", \"yue\", \"en\" or \"ja\". Leave empty - which is what you usually want on Bilibili - and the model names the language itself; language on each row then says what it decided."
          },
          "maxUpstreamRequests": {
            "title": "Max Bilibili requests",
            "minimum": 1,
            "type": "integer",
            "description": "Hard ceiling on the HTTP requests this run sends to Bilibili: video details, the player, caption files, audio downloads and retries together. At the ceiling collection stops - the videos not reached are written with partialReason \"upstream_request_cap\" and the run ends normally. Leave empty and the Actor works a ceiling out from your links and limits, so a run is never unbounded."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Bilibili refuses some datacenter addresses. If a run comes back with rows marked \"blocked\", the Actor retries once through a Chinese residential address by itself; you can also pick a different proxy here.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}