# Bilibili Search API Documentation

<p><strong>Bilibili Search API</strong> returns structured video search results from Bilibili, China's largest video platform. Search by keyword with filters for search type, ordering, duration and category, then paginate through results. Each result carries the BV id, title, author, play count, danmaku count, reply count, favorite count, duration, thumbnail, publish date and tags. A valid empty result is a successful response.</p>

- **Documentation:** [https://scrappa.co/docs/bilibili-api/bilibili_search](https://scrappa.co/docs/bilibili-api/bilibili_search)
- **API group:** Bilibili API
- **Endpoint:** `GET https://scrappa.co/api/bilibili/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `search_type` | string | Yes | Search type: video, bili_user, media_bangumi, media_ft, article, live, live_user, live_room. |
| `keyword` | string | Yes | Search keyword. |
| `page` | integer | No | Page number, 1-based. Defaults to 1. |
| `order` | string | No | Result ordering: totalrank, click, pubdate, scores, stow, dm, pw. Defaults to totalrank. |
| `duration` | integer | No | Duration filter: 0=all, 1=<10min, 2=10-30min, 3=30-60min, 4=>60min. Defaults to 0. |
| `tids` | integer | No | Category filter, 0=all. |

## Example response

```json
{
    "meta": {
        "endpoint_family": "search"
    },
    "page": 1,
    "count": 1000,
    "pages": 50,
    "results": [
        {
            "aid": 113006243481679,
            "mid": 3546597933714079,
            "pic": "https://i2.hdslb.com/bfs/archive/abc123.jpg",
            "tag": "Python,programming",
            "bvid": "BV1rpWjevEip",
            "play": 20709037,
            "reply": 2457,
            "title": "Python tutorial course",
            "author": "Python Official",
            "danmaku": 132790,
            "pubdate": 1660000000,
            "duration": "39:58",
            "favorite": 69881
        }
    ],
    "has_more": true,
    "page_size": 20
}
```

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
