add & fix hot.md (#501)

更改获取热搜列表(web端)返回数据和字段说明
新增 获取热搜列表(手机端)返回数据和字段说明
This commit is contained in:
I Am I
2022-09-28 10:58:57 +08:00
committed by GitHub
parent 97638df4a7
commit a2cd2a61a1

View File

@@ -2,12 +2,13 @@
- [获取默认搜索内容web端](#获取默认搜索内容web端) - [获取默认搜索内容web端](#获取默认搜索内容web端)
- [获取热搜列表web端](#获取热搜列表web端) - [获取热搜列表web端](#获取热搜列表web端)
- [获取热搜列表(手机端)](#获取热搜列表手机端)
--- ---
## 获取默认搜索内容web端 ## 获取默认搜索内容web端
> http://api.bilibili.com/x/web-interface/search/default > https://api.bilibili.com/x/web-interface/search/default
*请求方式GET* *请求方式GET*
@@ -40,7 +41,7 @@
**示例:** **示例:**
```shell ```shell
curl 'http://api.bilibili.com/x/web-interface/search/default' curl 'https://api.bilibili.com/x/web-interface/search/default'
``` ```
<details> <details>
@@ -68,11 +69,11 @@ curl 'http://api.bilibili.com/x/web-interface/search/default'
## 获取热搜列表web端 ## 获取热搜列表web端
> http://s.search.bilibili.com/main/hotword > https://s.search.bilibili.com/main/hotword
*请求方式GET* *请求方式GET*
榜单每隔固定时间统计一次,请求后返回搜索前20的关键词 榜单每隔固定时间统计一次,请求后返回搜索前10的关键词
带有转义 带有转义
@@ -96,26 +97,31 @@ curl 'http://api.bilibili.com/x/web-interface/search/default'
| ---- | ---- | --------------- | ------------ | | ---- | ---- | --------------- | ------------ |
| 0 | obj | 榜单第1名 | | | 0 | obj | 榜单第1名 | |
| n | obj | 榜单第n+1名 | 按照名次顺序 | | n | obj | 榜单第n+1名 | 按照名次顺序 |
| 19 | obj | 榜单第20名 | 最后一项 | | 10 | obj | 榜单第10名 | 最后一项 |
`list`数组中的对象: `list`数组中的对象:
| 字段 | 类型 | 内容 | 备注 | | 字段 | 类型 | 内容 | 备注 |
| ---------- | ---- | -------- | ----------------------------- | | ---------- | ---- | -------- | ------- |
| status | str | 空 | | | status | str | 空 | |
| keyword | str | 关键词 | | | hot_id | num | 热词id | 大概是吧? |
| goto_type | num | 0 | | | keyword | str | 关键词 | |
| pos | num | 名次 | 1-20 | | resource_id| num | 资源id | |
| word_type | num | 条目属性 | 1正常<br />4<br />5 | | goto_type | num | 0 | |
| id | num | 名次 | 1-20 | | res | array| null | |
| goto_value | str | 空 | | | show_name | str | 完整关键词| |
| name_type | str | 空 | | | pos | num | 名次 | 1-10 |
| icon | str | 图标url | | | word_type | num | 条目属性 | 均返回8 |
| id | num | 名次 | 1-10 |
| goto_value | str | 空 | |
| live_id | array| null | |
| name_type | str | 空 | |
| icon | str | 图标url | |
**示例:** **示例:**
```shell ```shell
curl 'http://s.search.bilibili.com/main/hotword' curl 'https://s.search.bilibili.com/main/hotword'
``` ```
<details> <details>
@@ -123,242 +129,440 @@ curl 'http://s.search.bilibili.com/main/hotword'
```json ```json
{ {
"exp_str": "8104#8200#8300#8401#8500#5502#6699", "exp_str": "8104#8200#8300#8401#8500#5502#6699",
"code": 0, "code": 0,
"cost": { "cost": {
"reas_request": "0.001895", "reas_request": "0.001895",
"params_check": "0.000127", "params_check": "0.000127",
"reas_response_format": "0.000098", "reas_response_format": "0.000098",
"deserialize_response": "0.000080", "deserialize_response": "0.000080",
"reas_request_format": "0.000076", "reas_request_format": "0.000076",
"total": "0.002479", "total": "0.002479",
"main_handler": "0.002252" "main_handler": "0.002252"
}, },
"seid": "9318821020548476185", "seid": "9318821020548476185",
"timestamp": 1596034742, "timestamp": 1596034742,
"message": "success", "message": "success",
"list": [ "list": [{
{ "status": "",
"status": "", "hot_id": 11003,
"keyword": "特朗普", "keyword": "流浪地球2刘德华",
"goto_type": 0, "resource_id": 0,
"pos": 1, "goto_type": 0,
"word_type": 1, "res": [
"id": 1,
"goto_value": "", ],
"name_type": "", "show_name": "流浪地球2刘德华造型",
"icon": "" "pos": 1,
}, "word_type": 8,
{ "id": 1,
"status": "", "goto_value": "",
"keyword": "武汉协和医院", "live_id": [
"goto_type": 0,
"pos": 2, ],
"word_type": 5, "name_type": "",
"id": 2, "icon": "http://i0.hdslb.com/bfs/feed-admin/e9e7a2d8497d4063421b685e72680bf1cfb99a0d.png"
"goto_value": "", },
"name_type": "", {
"icon": "http://i0.hdslb.com/bfs/feed-admin/e9e7a2d8497d4063421b685e72680bf1cfb99a0d.png" "status": "",
}, "hot_id": 11012,
{ "keyword": "QQ飞车手游飞跃黄河",
"status": "", "resource_id": 0,
"keyword": "元龙", "goto_type": 0,
"goto_type": 0, "res": [
"pos": 3,
"word_type": 5, ],
"id": 3, "show_name": "QQ飞车手游飞跃黄河",
"goto_value": "", "pos": 2,
"name_type": "", "word_type": 8,
"icon": "http://i0.hdslb.com/bfs/feed-admin/e9e7a2d8497d4063421b685e72680bf1cfb99a0d.png" "id": 2,
}, "goto_value": "",
{ "live_id": [
"status": "",
"keyword": "周深", ],
"goto_type": 0, "name_type": "",
"pos": 4, "icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png"
"word_type": 4, },
"id": 4, {
"goto_value": "", "status": "",
"name_type": "", "hot_id": 10996,
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png" "keyword": "西工大遭网络攻击最新调查",
}, "resource_id": 0,
{ "goto_type": 0,
"status": "", "res": [
"keyword": "徐大sao",
"goto_type": 0, ],
"pos": 5, "show_name": "西工大遭网络攻击最新调查",
"word_type": 4, "pos": 3,
"id": 5, "word_type": 8,
"goto_value": "", "id": 3,
"name_type": "", "goto_value": "",
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png" "live_id": [
},
{ ],
"status": "", "name_type": "",
"keyword": "FPX", "icon": "http://i0.hdslb.com/bfs/feed-admin/e9e7a2d8497d4063421b685e72680bf1cfb99a0d.png"
"goto_type": 0, },
"pos": 6, {
"word_type": 4, "status": "",
"id": 6, "hot_id": 11004,
"goto_value": "", "keyword": "EDG 起诉",
"name_type": "", "resource_id": 0,
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png" "goto_type": 0,
}, "res": [
{
"status": "", ],
"keyword": "BLACKPINK", "show_name": "EDGJieJie已起诉多家企业",
"goto_type": 0, "pos": 4,
"pos": 7, "word_type": 8,
"word_type": 1, "id": 4,
"id": 7, "goto_value": "",
"goto_value": "", "live_id": [
"name_type": "",
"icon": "" ],
}, "name_type": "",
{ "icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png"
"status": "", },
"keyword": "沈力", {
"goto_type": 0, "status": "",
"pos": 8, "hot_id": 10992,
"word_type": 1, "keyword": "隐入尘烟",
"id": 8, "resource_id": 0,
"goto_value": "", "goto_type": 0,
"name_type": "", "res": [
"icon": ""
}, ],
{ "show_name": "隐入尘烟全平台下架",
"status": "", "pos": 5,
"keyword": "老番茄", "word_type": 8,
"goto_type": 0, "id": 5,
"pos": 9, "goto_value": "",
"word_type": 1, "live_id": [
"id": 9,
"goto_value": "", ],
"name_type": "", "name_type": "",
"icon": "" "icon": "http://i0.hdslb.com/bfs/feed-admin/e9e7a2d8497d4063421b685e72680bf1cfb99a0d.png"
}, },
{ {
"status": "", "status": "",
"keyword": "JDG", "hot_id": 10987,
"goto_type": 0, "keyword": "原神半年内最良心封神池",
"pos": 10, "resource_id": 0,
"word_type": 4, "goto_type": 0,
"id": 10, "res": [
"goto_value": "",
"name_type": "", ],
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png" "show_name": "原神半年内最良心封神池",
}, "pos": 6,
{ "word_type": 8,
"status": "", "id": 6,
"keyword": "荒废工厂", "goto_value": "",
"goto_type": 0, "live_id": [
"pos": 11,
"word_type": 1, ],
"id": 11, "name_type": "",
"goto_value": "", "icon": ""
"name_type": "", },
"icon": "" {
}, "status": "",
{ "hot_id": 10988,
"status": "", "keyword": "高校回应设国内首个元宇宙院系",
"keyword": "活着", "resource_id": 0,
"goto_type": 0, "goto_type": 0,
"pos": 12, "res": [
"word_type": 1,
"id": 12, ],
"goto_value": "", "show_name": "高校回应设国内首个元宇宙院系",
"name_type": "", "pos": 7,
"icon": "" "word_type": 8,
}, "id": 7,
{ "goto_value": "",
"status": "", "live_id": [
"keyword": "明日方舟",
"goto_type": 0, ],
"pos": 13, "name_type": "",
"word_type": 1, "icon": ""
"id": 13, },
"goto_value": "", {
"name_type": "", "status": "",
"icon": "" "hot_id": 10994,
}, "keyword": "美宇宙飞船成功撞击小行星",
{ "resource_id": 0,
"status": "", "goto_type": 0,
"keyword": "创造营2020", "res": [
"goto_type": 0,
"pos": 14, ],
"word_type": 1, "show_name": "美宇宙飞船成功撞击小行星",
"id": 14, "pos": 8,
"goto_value": "", "word_type": 8,
"name_type": "", "id": 8,
"icon": "" "goto_value": "",
}, "live_id": [
{
"status": "", ],
"keyword": "黑人抬棺", "name_type": "",
"goto_type": 0, "icon": ""
"pos": 15, },
"word_type": 1, {
"id": 15, "status": "",
"goto_value": "", "hot_id": 10991,
"name_type": "", "keyword": "你薅的羊毛可能已违法",
"icon": "" "resource_id": 0,
}, "goto_type": 0,
{ "res": [
"status": "",
"keyword": "名侦探柯南", ],
"goto_type": 0, "show_name": "你薅的羊毛可能已违法",
"pos": 16, "pos": 9,
"word_type": 1, "word_type": 8,
"id": 16, "id": 9,
"goto_value": "", "goto_value": "",
"name_type": "", "live_id": [
"icon": ""
}, ],
{ "name_type": "",
"status": "", "icon": ""
"keyword": "fpx", },
"goto_type": 0, {
"pos": 17, "status": "",
"word_type": 1, "hot_id": 11013,
"id": 17, "keyword": "辛普森一家",
"goto_value": "", "resource_id": 0,
"name_type": "", "goto_type": 0,
"icon": "" "res": [
},
{ ],
"status": "", "show_name": "辛普森一家",
"keyword": "csgo", "pos": 10,
"goto_type": 0, "word_type": 8,
"pos": 18, "id": 10,
"word_type": 1, "goto_value": "",
"id": 18, "live_id": [
"goto_value": "",
"name_type": "", ],
"icon": "" "name_type": "",
}, "icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png"
{ }
"status": "", ]
"keyword": "正道的光", }
"goto_type": 0, ```
"pos": 19,
"word_type": 1, </details>
"id": 19,
"goto_value": "", ## 获取热搜列表(手机端)
"name_type": "",
"icon": "" > https://app.bilibili.com/x/v2/search/trending/ranking
},
{ *请求方式GET*
"status": "",
"keyword": "bts", 榜单每隔固定时间统计一次请求后返回搜索前20的关键词
"goto_type": 0,
"pos": 20, 带有转义
"word_type": 1,
"id": 20, **json回复**
"goto_value": "",
"name_type": "", 根对象:
"icon": ""
} | 字段 | 类型 | 内容 | 备注 |
] | --------- | ----- | ------------ | ------------- |
| code | num | 返回值 | 0成功 |
| message | str | 错误信息 | 默认为0 |
| ttl | num | 返回值 | 默认为1 |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | --------------- | ------------ |
| trackid | num | | 不知用途 |
| list | array | 热搜列表 | |
`list`数组:
| 项 | 类型 | 内容 | 备注 |
| ---- | ---- | --------------- | ------------ |
| 0 | obj | 榜单第1名 | |
| n | obj | 榜单第n+1名 | 按照名次顺序 |
| 20 | obj | 榜单第20名 | 最后一项 |
`list`数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| ---------- | ---- | -------- | ------- |
| position | num | 名次 | 1-20 |
| keyword | str | 关键词 | |
| show_name | str | 完整关键词| |
| word_type | num | 条目属性 | 均返回8 |
| icon | str | 图标url | |
| hot_id | num | 热词id | 大概是吧? |
**示例:**
```shell
curl 'https://app.bilibili.com/x/v2/search/trending/ranking'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"trackid": "12666380188451258075",
"list": [
{
"position": 1,
"keyword": "流浪地球2刘德华",
"show_name": "流浪地球2刘德华造型",
"word_type": 8,
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png",
"hot_id": 11003
},
{
"position": 2,
"keyword": "QQ飞车手游飞跃黄河",
"show_name": "QQ飞车手游飞跃黄河",
"word_type": 8,
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png",
"hot_id": 11012
},
{
"position": 3,
"keyword": "西工大遭网络攻击最新调查",
"show_name": "西工大遭网络攻击最新调查",
"word_type": 8,
"icon": "http://i0.hdslb.com/bfs/feed-admin/e9e7a2d8497d4063421b685e72680bf1cfb99a0d.png",
"hot_id": 10996
},
{
"position": 4,
"keyword": "EDG 起诉",
"show_name": "EDGJieJie已起诉多家企业",
"word_type": 8,
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png",
"hot_id": 11004
},
{
"position": 5,
"keyword": "隐入尘烟",
"show_name": "隐入尘烟全平台下架",
"word_type": 8,
"icon": "http://i0.hdslb.com/bfs/feed-admin/e9e7a2d8497d4063421b685e72680bf1cfb99a0d.png",
"hot_id": 10992
},
{
"position": 6,
"keyword": "原神半年内最良心封神池",
"show_name": "原神半年内最良心封神池",
"word_type": 8,
"hot_id": 10987
},
{
"position": 7,
"keyword": "高校回应设国内首个元宇宙院系",
"show_name": "高校回应设国内首个元宇宙院系",
"word_type": 8,
"hot_id": 10988
},
{
"position": 8,
"keyword": "美宇宙飞船成功撞击小行星",
"show_name": "美宇宙飞船成功撞击小行星",
"word_type": 8,
"hot_id": 10994
},
{
"position": 9,
"keyword": "你薅的羊毛可能已违法",
"show_name": "你薅的羊毛可能已违法",
"word_type": 8,
"hot_id": 10991
},
{
"position": 10,
"keyword": "火锅店剩锅底重新给顾客",
"show_name": "火锅店剩锅底重新给顾客",
"word_type": 1,
"hot_id": 11014
},
{
"position": 11,
"keyword": "海月",
"show_name": "王者海月逆天",
"word_type": 8,
"hot_id": 10999
},
{
"position": 12,
"keyword": "周琦重返NBL",
"show_name": "徐静雨评周琦重返NBL",
"word_type": 8,
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png",
"hot_id": 11007
},
{
"position": 13,
"keyword": "小超梦剑魔连招",
"show_name": "小超梦剑魔QA连招",
"word_type": 8,
"hot_id": 11006
},
{
"position": 14,
"keyword": "东八区的先生们已下架",
"show_name": "东八区的先生们已下架",
"word_type": 8,
"hot_id": 10955
},
{
"position": 15,
"keyword": "三国杀新武将全惠解",
"show_name": "三国杀新武将全惠解",
"word_type": 8,
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png",
"hot_id": 11009
},
{
"position": 16,
"keyword": "ALGS训练赛",
"show_name": "ALGS训练赛",
"word_type": 8,
"icon": "http://i0.hdslb.com/bfs/feed-admin/4d579fb61f9655316582db193118bba3a721eec0.png",
"hot_id": 11011
},
{
"position": 17,
"keyword": "王者青白蛇皮肤优化",
"show_name": "王者青白蛇皮肤优化",
"word_type": 8,
"hot_id": 11000
},
{
"position": 18,
"keyword": "普京授予斯诺登俄公民身份",
"show_name": "普京授予斯诺登俄公民身份",
"word_type": 1,
"hot_id": 10977
},
{
"position": 19,
"keyword": "赛诺角色演示",
"show_name": "原神赛诺角色演示",
"word_type": 8,
"hot_id": 10998
},
{
"position": 20,
"keyword": "COD19被玩坏了",
"show_name": "COD19被玩坏了",
"word_type": 8,
"hot_id": 10971
}
],
"exp_str": "8000#5509#6605#7708"
}
} }
``` ```