keywordstringจำเป็น
Search keyword (required)
https://api.sandbase.ai/v1/api/bilibili/app/search-by-typeReturns categorized search results from Bilibili based on a target query string. Supports filtering by search type, adjusting sort order, and cursor-based pagination.
[
{
"data": {
"code": 0,
"data": {
"annotation": {
"qv_id": "be32d3463a8d4e438112fa1d9a6f4a90"
},
"exp_str": "100010#5514#6600#81701100#9902#9923#9931#9942#9961",
"items": [
{
"av": {
"author": "b站Clare",
"cover": "https://i0.hdslb.com/bfs/archive/db407c4ea6e4c563d13cc5a4a948426281774379.jpg",
"danmaku": 91,
"duration": "6:11",
"face": "https://i1.hdslb.com/bfs/face/181f0c70d0e5bdba5257b80df1f28e4363acd57c.jpg",
"mid": "383142397",
"play": 374173,
"ptime": "1718722546",
"show_card_desc_2": "· 2024年6月18日",
"title": "全网包会的ChatGPT注册登录,<em class=\"keyword\">openai</em>官网正版",
"view_content": "37.4万"
},
"goto": "av",
"param": "112637799040590",
"uri": "bilibili://video/112637799040590?cid=500001586988529&history_progress=0&player_height=2160&player_preload=%7B%22expire_time%22%3A1787221880%2C%22cid%22%3A500001586988529%2C%22quality%22%3A16%2C%22file_info%22%3A%7B%2216%22%3A%7B%22infos%22%3A%5B%7B%22filesize%22%3A3211965%2C%22timelength%22%3A370916%7D%5D%7D%7D%2C%22video_codecid%22%3A7%2C%22video_project%22%3Atrue%2C%22url%22%3A%22http%3A%2F%2Fupos-hz-mirrorakam.akamaized.net%2Fupgcxcode%2F29%2F85%2F500001586988529%2F500001586988529-1-16.mp4%3Fe%3Dig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_a…",
"user_act": "{\"id\":112637799040590,\"type\":\"video\"}"
},
{
"av": {
"author": "AI先生李豪",
"cover": "https://i0.hdslb.com/bfs/archive/4d57e4a31260c5fc8daf3bb76f84b12292177621.jpg",
"danmaku": 429,
"duration": "5:07",
"face": "https://i0.hdslb.com/bfs/face/5299c073cfe032af8952fc89a2db55edec780173.jpg",
"mid": "517937049",
"play": 47314,
"ptime": "1786449193",
"show_card_desc_2": "· 8月11日",
"title": "锐评当下最强AI大模型,从夯到拉依次排名!",
"view_content": "4.7万"
},
"goto": "av",
"param": "117076714849813",
"uri": "bilibili://video/117076714849813?cid=40813727354&history_progress=0&player_height=1080&player_preload=%7B%22expire_time%22%3A1787221880%2C%22cid%22%3A40813727354%2C%22quality%22%3A16%2C%22file_info%22%3A%7B%2216%22%3A%7B%22infos%22%3A%5B%7B%22filesize%22%3A10173395%2C%22timelength%22%3A306620%7D%5D%7D%7D%2C%22video_codecid%22%3A7%2C%22video_project%22%3Atrue%2C%22url%22%3A%22http%3A%2F%2Fupos-sz-mirrorcosov.bilivideo.com%2Fupgcxcode%2F54%2F73%2F40813727354%2F40813727354-1-16.mp4%3Fe%3Dig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8xNE…",
"user_act": "{\"id\":117076714849813,\"type\":\"video\"}"
},
{
"av": {
"author": "量子位",
"cover": "https://i0.hdslb.com/bfs/archive/ae92e1d766ec8b8e67e617ef02c1d2b05f87c7a6.jpg",
"danmaku": 539,
"duration": "15:14",
"face": "https://i1.hdslb.com/bfs/face/2e05c4f6d77f413ba96269bf635795ed785970e1.jpg",
"mid": "673779175",
"play": 105457,
"ptime": "1682503783",
"show_card_desc_2": "· 2023年4月26日",
"title": "<em class=\"keyword\">OpenAI</em>到底是一家怎样的公司?",
"view_content": "10.5万"
},
"goto": "av",
"param": "485474422",
"uri": "bilibili://video/485474422?cid=1109740179&history_progress=0&player_height=1080&player_preload=%7B%22expire_time%22%3A1787221880%2C%22cid%22%3A1109740179%2C%22quality%22%3A16%2C%22file_info%22%3A%7B%2216%22%3A%7B%22infos%22%3A%5B%7B%22filesize%22%3A19051249%2C%22timelength%22%3A913707%7D%5D%7D%7D%2C%22video_codecid%22%3A7%2C%22video_project%22%3Atrue%2C%22url%22%3A%22http%3A%2F%2Fupos-sz-mirrorcosov.bilivideo.com%2Fupgcxcode%2F79%2F01%2F1109740179%2F1109740179_nb3-1-16.mp4%3Fe%3Dig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8xNEVE5XRE…",
"user_act": "{\"id\":485474422,\"type\":\"video\"}"
},
"… 17 more items in the full response"
],
"keyword": "OpenAI",
"page": "1",
"pages": 50,
"pagination": {
"next": "CAISIGJlMzJkMzQ2M2E4ZDRlNDM4MTEyZmExZDlhNmY0YTkw"
},
"real_exposure_ratio": 0.8,
"result_is_recommend": 1000,
"trackid": "8664857330702026491"
},
"message": "success"
}
}
]เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground
Search Bilibili by keyword within one result type (videos, users, live rooms, articles and more), with sorting and cursor paging. Video results include title, author, play count, danmaku count, duration and publish time.
curl -X POST "https://api.sandbase.ai/v1/api/bilibili/app/search-by-type" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"keyword": "OpenAI"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
keyword | string | Yes | Search keyword (required) |
cursor | string | No | Pagination cursor. Leave empty for the first page; for the next page pass |
order | integer | No | Sort order |
page_size | integer | No | Results per page |
search_type | string | No | Search type |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"code": 0,
"data": {
"annotation": {
"qv_id": "bdbca9b09c444039b387fa922af350e0"
},
"exp_str": "100010#5502#6609#81701100#9902#9921#9931#9947#9961",
"items": [
{
"av": {
"author": "布衣愚者",
"cover": "https://i0.hdslb.com/bfs/archive/41108b0b9bac8eace885911b7f25dcacc9ecf1b7.jpg",
"danmaku": 979,
"duration": "18:38",
"face": "https://i1.hdslb.com/bfs/face/ab22aa8fcbb6e7c442273cc9c492d8d4826c9c19.jpg",
"mid": "362809",
"play": 229119,
"ptime": "1793494190"
},
"goto": "av",
"param": "117538423901588",
"uri": "bilibili://video/117538423901588?cid=43222761497&history_progress=0&player_heigh…",
"user_act": "{\"id\":117538423901588,\"type\":\"video\"}"
}
],
"keyword": "OpenAI",
"page": "1",
"pages": 50,
"pagination": {
"next": "CAISIGJkYmNhOWIwOWM0NDQwMzliMzg3ZmE5MjJhZjM1MGUw"
},
"real_exposure_ratio": 0.8,
"result_is_recommend": 1000,
"trackid": "9348513686332904803"
},
"message": "success"
}
| Field | Meaning |
|---|---|
data.items[] | Results. For videos: av.author, av.play, av.danmaku (bullet comments), av.duration, av.ptime (Unix seconds) and param (the aid). |
data.pages | Total pages available. |
data.pagination.next | Cursor for the next page; pass it as cursor. |
search_type to pick the result type and order to sort. For a mixed result list use Bilibili Search All.$0.001 per successful call. Failed calls, including lookups whose target does not exist, are not charged. It is included in the daily free quota of each organization.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/bilibili/app/search-by-type" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order": 0,
"cursor": "",
"keyword": "OpenAI",
"page_size": 20,
"search_type": "video"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
keywordstringจำเป็นSearch keyword (required)
cursorstringPagination cursor. Leave empty for the first page; for the next page pass
ค่าเริ่มต้น: ""
orderintegerSort order
ค่าเริ่มต้น: 0
page_sizeintegerResults per page
ค่าเริ่มต้น: 20
search_typestringSearch type: "video" (default), "user", "live" or "article". "bili_user" is accepted as an alias of "user".
ค่าเริ่มต้น: "video"
ค่าที่เป็นไปได้: video, user, live, article, bili_user
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
[
{
"data": {
"code": 0,
"data": {
"annotation": {
"qv_id": "be32d3463a8d4e438112fa1d9a6f4a90"
},
"exp_str": "100010#5514#6600#81701100#9902#9923#9931#9942#9961",
"items": [
{
"av": {
"author": "b站Clare",
"cover": "https://i0.hdslb.com/bfs/archive/db407c4ea6e4c563d13cc5a4a948426281774379.jpg",
"danmaku": 91,
"duration": "6:11",
"face": "https://i1.hdslb.com/bfs/face/181f0c70d0e5bdba5257b80df1f28e4363acd57c.jpg",
"mid": "383142397",
"play": 374173,
"ptime": "1718722546",
"show_card_desc_2": "· 2024年6月18日",
"title": "全网包会的ChatGPT注册登录,<em class=\"keyword\">openai</em>官网正版",
"view_content": "37.4万"
},
"goto": "av",
"param": "112637799040590",
"uri": "bilibili://video/112637799040590?cid=500001586988529&history_progress=0&player_height=2160&player_preload=%7B%22expire_time%22%3A1787221880%2C%22cid%22%3A500001586988529%2C%22quality%22%3A16%2C%22file_info%22%3A%7B%2216%22%3A%7B%22infos%22%3A%5B%7B%22filesize%22%3A3211965%2C%22timelength%22%3A370916%7D%5D%7D%7D%2C%22video_codecid%22%3A7%2C%22video_project%22%3Atrue%2C%22url%22%3A%22http%3A%2F%2Fupos-hz-mirrorakam.akamaized.net%2Fupgcxcode%2F29%2F85%2F500001586988529%2F500001586988529-1-16.mp4%3Fe%3Dig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_a…",
"user_act": "{\"id\":112637799040590,\"type\":\"video\"}"
},
{
"av": {
"author": "AI先生李豪",
"cover": "https://i0.hdslb.com/bfs/archive/4d57e4a31260c5fc8daf3bb76f84b12292177621.jpg",
"danmaku": 429,
"duration": "5:07",
"face": "https://i0.hdslb.com/bfs/face/5299c073cfe032af8952fc89a2db55edec780173.jpg",
"mid": "517937049",
"play": 47314,
"ptime": "1786449193",
"show_card_desc_2": "· 8月11日",
"title": "锐评当下最强AI大模型,从夯到拉依次排名!",
"view_content": "4.7万"
},
"goto": "av",
"param": "117076714849813",
"uri": "bilibili://video/117076714849813?cid=40813727354&history_progress=0&player_height=1080&player_preload=%7B%22expire_time%22%3A1787221880%2C%22cid%22%3A40813727354%2C%22quality%22%3A16%2C%22file_info%22%3A%7B%2216%22%3A%7B%22infos%22%3A%5B%7B%22filesize%22%3A10173395%2C%22timelength%22%3A306620%7D%5D%7D%7D%2C%22video_codecid%22%3A7%2C%22video_project%22%3Atrue%2C%22url%22%3A%22http%3A%2F%2Fupos-sz-mirrorcosov.bilivideo.com%2Fupgcxcode%2F54%2F73%2F40813727354%2F40813727354-1-16.mp4%3Fe%3Dig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8xNE…",
"user_act": "{\"id\":117076714849813,\"type\":\"video\"}"
},
{
"av": {
"author": "量子位",
"cover": "https://i0.hdslb.com/bfs/archive/ae92e1d766ec8b8e67e617ef02c1d2b05f87c7a6.jpg",
"danmaku": 539,
"duration": "15:14",
"face": "https://i1.hdslb.com/bfs/face/2e05c4f6d77f413ba96269bf635795ed785970e1.jpg",
"mid": "673779175",
"play": 105457,
"ptime": "1682503783",
"show_card_desc_2": "· 2023年4月26日",
"title": "<em class=\"keyword\">OpenAI</em>到底是一家怎样的公司?",
"view_content": "10.5万"
},
"goto": "av",
"param": "485474422",
"uri": "bilibili://video/485474422?cid=1109740179&history_progress=0&player_height=1080&player_preload=%7B%22expire_time%22%3A1787221880%2C%22cid%22%3A1109740179%2C%22quality%22%3A16%2C%22file_info%22%3A%7B%2216%22%3A%7B%22infos%22%3A%5B%7B%22filesize%22%3A19051249%2C%22timelength%22%3A913707%7D%5D%7D%7D%2C%22video_codecid%22%3A7%2C%22video_project%22%3Atrue%2C%22url%22%3A%22http%3A%2F%2Fupos-sz-mirrorcosov.bilivideo.com%2Fupgcxcode%2F79%2F01%2F1109740179%2F1109740179_nb3-1-16.mp4%3Fe%3Dig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEuENvNC8aNEVEtEvE9IMvXBvE2ENvNCImNEVEIj0Y2J_aug859r1qXg8xNEVE5XRE…",
"user_act": "{\"id\":485474422,\"type\":\"video\"}"
},
"… 17 more items in the full response"
],
"keyword": "OpenAI",
"page": "1",
"pages": 50,
"pagination": {
"next": "CAISIGJlMzJkMzQ2M2E4ZDRlNDM4MTEyZmExZDlhNmY0YTkw"
},
"real_exposure_ratio": 0.8,
"result_is_recommend": 1000,
"trackid": "8664857330702026491"
},
"message": "success"
}
}
]สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Bilibili Search by TypeAPI นี้ Bilibili | $0.001 ต่อการเรียก | JSON |
Bilibili | $0.001 ต่อการเรียก | JSON |
Bilibili | $0.001 ต่อการเรียก | JSON |
Bilibili | $0.001 ต่อการเรียก | JSON |
Bilibili | $0.001 ต่อการเรียก | JSON |
Bilibili | $0.001 ต่อการเรียก | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/bilibili/app/search-by-type โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.001 ต่อครั้ง ทุกองค์กรจะได้รับคำขอฟรี 100 ครั้งต่อวัน UTC โดยใช้ร่วมกันใน SandBase APIs ที่เข้าเงื่อนไขรวมถึงรายการนี้ หลังจากนั้นแต่ละคำขอจะคิดค่าบริการตามราคานี้จากยอดคงเหลือ SandBase ของคุณ ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: keyword (string). ตัวเลือก: cursor (string), order (integer), page_size (integer) และ search_type (หนึ่งใน video, user, live, article, bili_user). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Bilibili Search by Type ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Bilibili API แยกต่างหาก