# Bilibili Web General Search API

> Returns search results from Bilibili based on a search keyword, with sorting options and filters for duration and publication date range.

Source: https://www.sandbase.ai/apis/bilibili/web/general-search
API reference: https://www.sandbase.ai/apis/bilibili/web/general-search/docs

## Facts

- Provider: Bilibili
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/bilibili/web/general-search`
- Price: $0.0015 per call
- Free allowance: 100 calls per organization per UTC day, shared across eligible APIs
- Capabilities: api, bilibili
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/bilibili/web/general-search` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `keyword` | string | yes |  |
| `order` | string | yes |  |
| `page` | integer | yes |  |
| `page_size` | integer | yes |  |
| `duration` | integer | no |  |
| `pubtime_begin_s` | integer | no |  |
| `pubtime_end_s` | integer | no |  |

## FAQ

### How do I use the Bilibili Web General Search API?

Send a POST request to https://api.sandbase.ai/v1/api/bilibili/web/general-search with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Bilibili Web General Search API cost?

$0.0015 per call. Every organization gets 100 free calls per UTC day, shared across eligible SandBase APIs including this one; after that each call is billed at this price from your SandBase balance. There is no subscription.

### What parameters does the Bilibili Web General Search API accept?

Required: keyword (string), order (string), page (integer) and page_size (integer). Optional: duration (integer), pubtime_begin_s (integer) and pubtime_end_s (integer). The Parameters table and the Playground on this page list every field.

### What does the Bilibili Web General Search API return?

A JSON response returned in the same HTTP request (synchronous). The README on this page includes a sample response.

### Do I need a Bilibili developer account or API key?

No. Bilibili Web General Search runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Bilibili API access separately.

## README

### Bilibili Web General Search API

Query video search results across Bilibili by specifying a `keyword` along with pagination and sorting criteria.

#### Use cases

- Search for videos matching specific query terms across Bilibili.
- Filter search results by video duration and publication date timestamps.
- Sort keyword search listings by criteria such as overall ranking.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/bilibili/web/general-search" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword": "OpenAI", "order": "totalrank", "page": 1, "page_size": 20}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `page` | integer | Yes | Page number |
| `order` | string | Yes | Order method |
| `keyword` | string | Yes | Search keyword |
| `page_size` | integer | Yes | Number per page |
| `duration` | integer | No | Duration filter |
| `pubtime_end_s` | integer | No | End date, 10-digit timestamp, must be greater than start date |
| `pubtime_begin_s` | integer | No | Start date, 10-digit timestamp, must be less than end date |

#### Example response

Real response for the request above, trimmed to the main fields. User names and long IDs are masked.

```json
{
  "data": {
    "result": [
      {
        "author": "AI大圆镜",
        "card_status": 0,
        "description": "9月22号，越狱圈名人老普林尼把GPT-6 Sol Codex全套系统提示词传上GitHub，超29万字符，连禁AI味都写进了家规。",
        "duration": "1:0",
        "id": 117385952495187,
        "like": 399,
        "live_status": 0,
        "parent_area_id": 0,
        "pubdate": 1791167590,
        "rank_index": 1
      }
    ]
  }
}
```

#### Notes

- `pubtime_begin_s` and `pubtime_end_s` accept 10-digit timestamps, where the start date must be earlier than the end date.
- Results can be paginated using `page` and `page_size`.

#### Related APIs

- [Bilibili Streaming Areas](/model/bilibili/web/all-live-areas): Returns the complete list of streaming broadcast areas and categories on Bilibili.
- [Bilibili BV to AID Converter](/model/bilibili/web/bv-to-aid): Converts a Bilibili BV identifier to its corresponding numeric AID value.
- [Bilibili User Collection Folders](/model/bilibili/web/collect-folders): Returns the collection folders owned by a specific Bilibili user.
