# Most viewed Bilibili videos for any keyword

**Use case:** 

Searches Bilibili for a keyword and returns the most played videos first: title, creator, plays, likes, comment count, bullet-comment count, favourites, tags and publish time. The example searches the Chinese word for coffee and returns 5 videos. Replace the word with any keyword, in Chinese or English.

## Input

```json
{
  "searchQueries": [
    "咖啡"
  ],
  "sortBy": "click",
  "maxVideosPerQuery": 5,
  "videoUrls": [
    "BV1Dbsn6gEPz"
  ],
  "creatorIds": [],
  "creatorSearchQueries": [],
  "maxCreatorsPerQuery": 20,
  "maxCommentsPerVideo": 0,
  "commentSort": "hot"
}
```

## Output

```json
{
  "type": {
    "label": "Row",
    "format": "string"
  },
  "title": {
    "label": "Title",
    "format": "string"
  },
  "creatorName": {
    "label": "Creator",
    "format": "string"
  },
  "plays": {
    "label": "Plays",
    "format": "integer"
  },
  "likes": {
    "label": "Likes",
    "format": "integer"
  },
  "comments": {
    "label": "Comments",
    "format": "integer"
  },
  "danmaku": {
    "label": "Bullet comments",
    "format": "integer"
  },
  "favorites": {
    "label": "Favourites",
    "format": "integer"
  },
  "coins": {
    "label": "Coins",
    "format": "integer"
  },
  "shares": {
    "label": "Shares",
    "format": "integer"
  },
  "durationSeconds": {
    "label": "Length (s)",
    "format": "integer"
  },
  "publishedAt": {
    "label": "Published",
    "format": "string"
  },
  "searchQuery": {
    "label": "Search word",
    "format": "string"
  },
  "rank": {
    "label": "Rank",
    "format": "integer"
  },
  "url": {
    "label": "Video",
    "format": "string"
  },
  "input": {
    "label": "Input entry",
    "format": "string"
  },
  "errorKind": {
    "label": "Error kind",
    "format": "string"
  },
  "message": {
    "label": "Message",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Bilibili Scraper: videos, comments, creators (no login) Actor is ready to run with the inputs already set for "Most viewed Bilibili videos for any keyword". [Sign up or log in](https://console.apify.com/create-task-from-example/uV7OhJqsqpN2BLMbn) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Most viewed Bilibili videos for any keyword" task

The Bilibili Scraper: videos, comments, creators (no login) Actor will start running based on the input automatically. You can also change all the input fields, like search words (videos), sort search results by, and more, to match your specific use case.

### 3. Receive the "Most viewed Bilibili videos for any keyword" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as row, title, creator, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Most viewed Bilibili videos for any keyword" task via API](https://apify.com/leadharbor/bilibili-scraper.md).

## FAQ

### Can I search in English?

Yes. Search words work in any language, though most titles are Chinese and are returned as the creator wrote them, without translation.

### How do I sort by newest or by bullet comments?

Use sortBy. The options are totalrank (relevance, default), click (most played), pubdate (newest), dm (most bullet comments) and stow (most favourited).

### How many videos can one search word return?

Up to 1,000, because Bilibili lists at most 50 pages of 20 results per word. A video found twice in one run is delivered once, so a relevance search can return fewer rows than you set.

### Are coins and shares included?

Only on rows read from a video link. On search rows they are null.

### Does it need a login?

No. It reads Bilibili's public pages with plain HTTP and returns the numbers a logged-out visitor sees. It is not affiliated with Bilibili.

## About this Actor

This example demonstrates how to use [Bilibili Scraper: videos, comments, creators (no login)](https://apify.com/leadharbor/bilibili-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/leadharbor/bilibili-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/leadharbor/bilibili-scraper.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
