{
  "openapi": "3.0.1",
  "info": {
    "title": "Bilibili Video Search, Ranking & Metadata Scraper",
    "description": "Search Bilibili videos by keyword, look up specific videos by URL or ID, or pull the popular feed and partition ranking charts, with view, like and danmaku counts.",
    "version": "2.0",
    "x-build-id": "ZsdGtcAjKAaeE8fhO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nimbryxo-studio~bilibili-video-search-ranking-and-metadata-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nimbryxo-studio-bilibili-video-search-ranking-and-metadata-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/nimbryxo-studio~bilibili-video-search-ranking-and-metadata-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nimbryxo-studio-bilibili-video-search-ranking-and-metadata-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/nimbryxo-studio~bilibili-video-search-ranking-and-metadata-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nimbryxo-studio-bilibili-video-search-ranking-and-metadata-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",
              "byVideoUrl",
              "popular",
              "ranking"
            ],
            "type": "string",
            "description": "What to collect.",
            "default": "search"
          },
          "searchQueries": {
            "title": "Search queries / aliases (mode=search)",
            "maxItems": 10,
            "type": "array",
            "description": "One keyword per entry, e.g. `python`, `原神`, `Genshin`. Provide Chinese and English aliases explicitly; Bilibili does not translate them.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "videoUrls": {
            "title": "Video URLs or IDs (mode=byVideoUrl)",
            "maxItems": 1000,
            "type": "array",
            "description": "Accepts https://www.bilibili.com/video/BV..., https://b23.tv/... short links, bare BV IDs, av123... IDs, or numeric aids.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on emitted video records. Error records do not count toward it.",
            "default": 20
          },
          "sort": {
            "title": "Search sort (mode=search)",
            "enum": [
              "totalrank",
              "click",
              "pubdate",
              "dm",
              "stow",
              "scores"
            ],
            "type": "string",
            "description": "Result ordering. `dm` is most danmaku and `scores` is most comments.",
            "default": "totalrank"
          },
          "publishedAfter": {
            "title": "Published after (UTC)",
            "type": "string",
            "description": "Only videos published on or after this date, `YYYY-MM-DD` (mode=search). Can be used alone."
          },
          "publishedBefore": {
            "title": "Published before (UTC)",
            "type": "string",
            "description": "Only videos published on or before this date, `YYYY-MM-DD` (mode=search). Can be used alone."
          },
          "duration": {
            "title": "Duration filter (mode=search)",
            "enum": [
              "all",
              "short",
              "medium",
              "long",
              "verylong"
            ],
            "type": "string",
            "description": "Keep only videos in this length range.",
            "default": "all"
          },
          "partition": {
            "title": "Partition",
            "enum": [
              "0",
              "1",
              "3",
              "4",
              "5",
              "36",
              "119",
              "129",
              "155",
              "160",
              "181",
              "188",
              "211",
              "217",
              "223"
            ],
            "type": "string",
            "description": "Search partition filter (mode=search) or ranking chart (mode=ranking). Ignored for weekly charts.",
            "default": "0"
          },
          "rankingType": {
            "title": "Ranking type (mode=ranking)",
            "enum": [
              "all",
              "origin",
              "rookie",
              "weekly"
            ],
            "type": "string",
            "description": "All-time, originals-only, rookie, or the weekly series.",
            "default": "all"
          },
          "weekNumber": {
            "title": "Weekly issue number (mode=ranking)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Specific weekly issue. Omit to use the latest issue."
          },
          "enrichDetails": {
            "title": "Enrich with video details",
            "type": "boolean",
            "description": "Add one detail request per unique video in search, popular, and ranking modes to fill tags, coin/share counts, cid, parts, resolution, and uploader followers. Usually adds 3-10 seconds per video, depending on Bilibili latency. byVideoUrl lookups are always enriched.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration (optional)",
            "type": "object",
            "description": "Optional. The actor starts direct and retries through fresh and anonymous browser sessions; this proxy is used only as the final escalation stage."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}