{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Videos & Comments Scraper",
    "description": "Search public Bilibili videos with independent limits per query, or collect comments and replies from video links.",
    "version": "1.1",
    "x-build-id": "4CiNv6GIdLxWuispm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/devcake~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-devcake-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/devcake~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-devcake-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/devcake~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-devcake-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",
        "properties": {
          "searchQueries": {
            "title": "Search words",
            "type": "array",
            "description": "Enter one video search query per line. Each query has its own limit: 3 queries × 30 = up to 90 unique videos if available. Leave Video links or IDs empty to search.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerQuery": {
            "title": "Videos per query",
            "minimum": 30,
            "maximum": 5000,
            "type": "integer",
            "description": "Limit videos for each Search words entry independently. Default and minimum: 30. Chinese brand-name variants share the original query limit. Duplicate videos are output once; later queries continue looking for new videos. Each unique video row saved costs $0.004.",
            "default": 30
          },
          "sortOrder": {
            "title": "Search order",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "Choose how to order videos found by search. This does not change comment order.",
            "default": "totalrank"
          },
          "durationFilter": {
            "title": "Video length",
            "enum": [
              "any",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "Filter videos found by search by their duration. This does not filter comments.",
            "default": "any"
          },
          "pubtimeBegin": {
            "title": "Published after",
            "pattern": "^$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Choose the first publication date for Search videos, inclusive, in Bilibili time (UTC+8)."
          },
          "pubtimeEnd": {
            "title": "Published before",
            "pattern": "^$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Choose the last publication date for Search videos, inclusive, in Bilibili time (UTC+8)."
          },
          "videoUrls": {
            "title": "Video links or IDs",
            "type": "array",
            "description": "Enter one BV ID, av ID, or full bilibili.com/video/ URL per line. Collects comments from the first 10 distinct videos per run by default. Short b23.tv and profile links are not accepted. Video links take priority over Search words; leave this list empty to search.",
            "items": {
              "type": "string"
            }
          },
          "includeComments": {
            "title": "Comments on Search",
            "type": "boolean",
            "description": "Add comments to videos found by Search. Video links collect comments automatically, without requiring this toggle.",
            "default": false
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Collect available thread replies as separate rows within Comments per video. Parent comments may still contain reply previews when this is off.",
            "default": false
          },
          "anonymizeCommenters": {
            "title": "Anonymize commenters",
            "type": "boolean",
            "description": "Clear structured commenter identities, profile details, and preview identities. Comment text and source-provided location labels remain unchanged.",
            "default": false
          },
          "maxComments": {
            "title": "Comments per video",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Limit the combined comment and reply rows for each video. Bilibili may expose fewer rows to anonymous requests. Each unique comment or separate reply row saved costs $0.0015; inline reply previews are not charged.",
            "default": 20
          },
          "sortComments": {
            "title": "Comment order",
            "enum": [
              "hot",
              "time",
              "likes"
            ],
            "type": "string",
            "description": "Choose popular or newest comments. Most liked in results sorts only the collected rows, not all comments on the video.",
            "default": "hot"
          },
          "sentimentAnalysis": {
            "title": "Estimate sentiment",
            "type": "boolean",
            "description": "Add estimated sentiment to collected video and comment text. Uses a Chinese model or a small English keyword list; other languages are not reliably supported.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}