{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Scraper: Videos, Comments, Trending & UP主 Profiles",
    "description": "Scrape Bilibili (B站) without login: video search, details, comments, trending boards and UP主 profiles. Use this when tracking a brand or trend in China. From $2.50 per 1,000 videos.",
    "version": "0.1",
    "x-build-id": "gAafFCoaDAjHeCIgC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s3nafps~bilibili-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s3nafps-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/s3nafps~bilibili-scraper/runs": {
      "post": {
        "operationId": "runs-sync-s3nafps-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/s3nafps~bilibili-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-s3nafps-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": "Mode",
            "enum": [
              "search",
              "details",
              "comments",
              "trending",
              "profiles"
            ],
            "type": "string",
            "description": "What to collect. search = videos for keywords; details = full stats for given videos; comments = comments for given videos; trending = Bilibili's popular board; profiles = creator profiles.",
            "default": "search"
          },
          "keywords": {
            "title": "Keywords (search mode)",
            "type": "array",
            "description": "One or more search terms, e.g. [\"Nike\", \"耐克\"]. Add the Chinese brand name too for full coverage.",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "title": "Sort search results by",
            "enum": [
              "relevance",
              "newest",
              "views",
              "comments",
              "danmaku",
              "favorites"
            ],
            "type": "string",
            "description": "Order of search results, e.g. newest for monitoring.",
            "default": "relevance"
          },
          "publishedAfter": {
            "title": "Published after (search mode)",
            "type": "string",
            "description": "Only videos published on or after this date, e.g. 2026-09-01. Dates are Beijing time unless you add an offset."
          },
          "publishedBefore": {
            "title": "Published before (search mode)",
            "type": "string",
            "description": "Only videos published on or before this date (end of day), e.g. 2026-09-30. Beijing time unless you add an offset."
          },
          "duration": {
            "title": "Video length (search mode)",
            "enum": [
              "any",
              "under10",
              "10to30",
              "30to60",
              "over60"
            ],
            "type": "string",
            "description": "Limit search results by video length, e.g. under10 for short videos.",
            "default": "any"
          },
          "urls": {
            "title": "Video or creator links / IDs",
            "type": "array",
            "description": "For details and comments: video links or IDs, e.g. https://www.bilibili.com/video/BV1xx411c7mD, BV1xx411c7mD or av170001. For profiles: creator links or numeric IDs, e.g. https://space.bilibili.com/546195.",
            "items": {
              "type": "string"
            }
          },
          "trendingCategory": {
            "title": "Trending category (trending mode)",
            "enum": [
              "all",
              "animation",
              "music",
              "dance",
              "game",
              "knowledge",
              "tech",
              "sports",
              "car",
              "life",
              "food",
              "animal",
              "fashion",
              "entertainment"
            ],
            "type": "string",
            "description": "Which trending board to read, e.g. tech. 'all' is Bilibili's overall popular list.",
            "default": "all"
          },
          "maxItems": {
            "title": "Max results per keyword / trending rows",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many search results to read per keyword, or trending rows in total, e.g. 20 for a quick check or 500 for a sweep.",
            "default": 20
          },
          "includeComments": {
            "title": "Also collect comments (search and details modes)",
            "type": "boolean",
            "description": "Add the top comments under each video found. Without login Bilibili shows only the top 3 comments per video.",
            "default": false
          },
          "maxCommentsPerItem": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Comments (and replies) to collect per video, e.g. 50. Without login Bilibili shows only the top 3 top-level comments per video; turn on 'Include replies' to also collect the replies under them.",
            "default": 20
          },
          "includeReplies": {
            "title": "Include replies (comments mode)",
            "type": "boolean",
            "description": "Also collect the reply threads under each comment, e.g. to read a full discussion.",
            "default": false
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "hot",
              "newest"
            ],
            "type": "string",
            "description": "hot = most liked first, newest = most recent first.",
            "default": "hot"
          },
          "onlyNew": {
            "title": "Only new items (monitoring)",
            "type": "boolean",
            "description": "Return only videos, comments or trending rows that earlier runs with the same monitor name did not deliver. Combine with an Apify schedule, e.g. daily brand monitoring.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Separate 'only new' memory per monitor, e.g. nike-daily. Used only with 'Only new items'.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy is used automatically; the Actor switches to residential proxies only if Bilibili blocks it.",
            "default": {
              "useApifyProxy": true
            }
          },
          "debugLog": {
            "title": "Debug log",
            "type": "boolean",
            "description": "Log every request with its timing, e.g. to troubleshoot slow runs.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}