2020-03-17 11:05:26 +08:00
|
|
|
|
# 用户关系相关
|
|
|
|
|
|
|
|
|
|
## 查询用户粉丝明细
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
<img src="/imgs/relation.svg" width="100" height="100" />
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/followers
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:GET*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
登录(SESSDATA)可看自己全部
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ----------- | ------ | --------------------------- |
|
|
|
|
|
| vmid | 目标用户UID | 必要 | |
|
|
|
|
|
| ps | 每页项数 | 非必要 | 默认为50 |
|
|
|
|
|
| pn | 页码 | 非必要 | 默认为1 非自己只能查看前5页 |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | --------------------------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-400请求错误<br />22007访问超过5页 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---------- | ----- | -------- | ------------ |
|
|
|
|
|
| list | array | 明细列表 | |
|
|
|
|
|
| re_version | num | ??? | 作用尚不明确 |
|
|
|
|
|
| total | num | 粉丝总数 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`中的`list`数组:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 项 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ----- | ---------------- |
|
|
|
|
|
| 0 | obj | 粉丝1 | |
|
|
|
|
|
| n | obj | 粉丝n | 按照关注顺序排列 |
|
|
|
|
|
| …… | obj | …… | …… |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`list`中的对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| --------------- | ---- | ------------ | --------------------------------- |
|
|
|
|
|
| mid | num | 用户UID | |
|
|
|
|
|
| attribute | num | 关注属性 | 0未关注<br />2已关注<br />6已互粉 |
|
|
|
|
|
| mtime | num | 成为粉丝时间 | 时间戳 互关后刷新 |
|
|
|
|
|
| tag | null | | 作用尚不明确 |
|
|
|
|
|
| special | num | 0 | 作用尚不明确 |
|
|
|
|
|
| uname | str | 用户昵称 | |
|
|
|
|
|
| face | str | 用户头像url | jpg gif |
|
|
|
|
|
| sign | str | 用户签名 | |
|
|
|
|
|
| official_verify | obj | 认证信息 | |
|
|
|
|
|
| vip | obj | 会员信息 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`list`中的对象中的`official_verify`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ------------ | --------------- |
|
|
|
|
|
| type | num | 用户认证类型 | -1无<br />1认证 |
|
|
|
|
|
| desc | str | 用户认证信息 | 无为空 |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`list`中的对象中的`vip`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------------- | ---- | ------------ | ----------------------------- |
|
|
|
|
|
| vipType | num | 大会员类型 | 0无<br />1月会员<br />2年会员 |
|
|
|
|
|
| vipDueDate | num | 会员到期时间 | 毫秒 时间戳 |
|
|
|
|
|
| dueRemark | str | 空 | 作用尚不明确 |
|
|
|
|
|
| accessStatus | num | 0 | 作用尚不明确 |
|
|
|
|
|
| vipStatus | num | 大会员状态 | 0无<br />1有 |
|
|
|
|
|
| vipStatusWarn | str | 空 | 作用尚不明确 |
|
|
|
|
|
| themeType | num | 0 | 作用尚不明确 |
|
|
|
|
|
| label | obj | ??? | 作用尚不明确 |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`vip`中的`label`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ---- | ------------ |
|
|
|
|
|
| path | str | 空 | 作用尚不明确 |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
以每页2项的方式获取UID为293793435的用户的第1页的粉丝明细
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
http://api.bilibili.com/x/relation/followers?vmid=293793435&ps=2&pn=1
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"list": [{
|
|
|
|
|
"mid": 387195656,
|
|
|
|
|
"attribute": 0,
|
|
|
|
|
"mtime": 1583839793,
|
|
|
|
|
"tag": null,
|
|
|
|
|
"special": 0,
|
|
|
|
|
"uname": "L_E_M_O_H_E",
|
|
|
|
|
"face": "http://i1.hdslb.com/bfs/face/8ec537db75eeb292faa8dc85a9ff8aba83148c86.jpg",
|
|
|
|
|
"sign": "暂时断更。。Back later",
|
|
|
|
|
"official_verify": {
|
|
|
|
|
"type": -1,
|
|
|
|
|
"desc": ""
|
|
|
|
|
},
|
|
|
|
|
"vip": {
|
|
|
|
|
"vipType": 0,
|
|
|
|
|
"vipDueDate": 0,
|
|
|
|
|
"dueRemark": "",
|
|
|
|
|
"accessStatus": 0,
|
|
|
|
|
"vipStatus": 0,
|
|
|
|
|
"vipStatusWarn": "",
|
|
|
|
|
"themeType": 0,
|
|
|
|
|
"label": {
|
|
|
|
|
"path": ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
"mid": 175989424,
|
|
|
|
|
"attribute": 0,
|
|
|
|
|
"mtime": 1583822019,
|
|
|
|
|
"tag": null,
|
|
|
|
|
"special": 0,
|
|
|
|
|
"uname": "哥本哈根iii",
|
|
|
|
|
"face": "http://i1.hdslb.com/bfs/face/e53c0fe9315176d48bd294b1f381f0da70131cd7.jpg",
|
|
|
|
|
"sign": "",
|
|
|
|
|
"official_verify": {
|
|
|
|
|
"type": -1,
|
|
|
|
|
"desc": ""
|
|
|
|
|
},
|
|
|
|
|
"vip": {
|
|
|
|
|
"vipType": 0,
|
|
|
|
|
"vipDueDate": 0,
|
|
|
|
|
"dueRemark": "",
|
|
|
|
|
"accessStatus": 0,
|
|
|
|
|
"vipStatus": 0,
|
|
|
|
|
"vipStatusWarn": "",
|
|
|
|
|
"themeType": 0,
|
|
|
|
|
"label": {
|
|
|
|
|
"path": ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}],
|
|
|
|
|
"re_version": 3857745402,
|
|
|
|
|
"total": 365
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 查询用户关注明细
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
<img src="/imgs/relation.svg" width="100" height="100" />
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/followings
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:GET*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
登录(SESSDATA)可看自己全部
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ----------- | ------ | --------------------------- |
|
|
|
|
|
| vmid | 目标用户UID | 必要 | |
|
|
|
|
|
| ps | 每页项数 | 非必要 | 默认为50 |
|
|
|
|
|
| pn | 页码 | 非必要 | 默认为1 非自己只能查看前5页 |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | --------------------------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-400请求错误<br />22007访问超过5页 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
|
|
|
|
data 对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---------- | ----- | -------- | ------------ |
|
|
|
|
|
| list | array | 明细列表 | |
|
|
|
|
|
| re_version | num | ??? | 作用尚不明确 |
|
|
|
|
|
| total | num | 关注总数 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`中的`list`数组:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 项 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ----- | ---------------- |
|
|
|
|
|
| 0 | obj | 粉丝1 | |
|
|
|
|
|
| n | obj | 粉丝n | 按照关注顺序排列 |
|
|
|
|
|
| …… | obj | …… | …… |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`list`中的对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| --------------- | ---------------------------------------- | ------------ | --------------------------------- |
|
|
|
|
|
| mid | num | 用户UID | |
|
|
|
|
|
| attribute | num | 关注属性 | 0未关注<br />2已关注<br />6已互粉 |
|
|
|
|
|
| mtime | num | 关注对方时间 | 时间戳 互关后刷新 |
|
|
|
|
|
| tag | null默认分组<br />arrary存在至少一个分组 | 分组ID | 作用尚不明确 |
|
|
|
|
|
| special | num | 特别关注标志 | 0否<br />1是 |
|
|
|
|
|
| uname | str | 用户昵称 | |
|
|
|
|
|
| face | str | 用户头像url | jpg gif |
|
|
|
|
|
| sign | str | 用户签名 | |
|
|
|
|
|
| official_verify | obj | 认证信息 | |
|
|
|
|
|
| vip | obj | 会员信息 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`list`中的对象中的`tag`数组:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 项 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ----------------------- | ---- |
|
|
|
|
|
| 0 | num | 位于分组1的分组ID | |
|
|
|
|
|
| n | num | 位于分组(n+1)的分组ID | |
|
|
|
|
|
| …… | num | …… | …… |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`list`中的对象中的`official_verify`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ------------ | --------------- |
|
|
|
|
|
| type | num | 用户认证类型 | -1无<br />0认证 |
|
|
|
|
|
| desc | str | 用户认证信息 | 无为空 |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`list`中的对象中的`vip`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------------- | ---- | ------------ | ----------------------------- |
|
|
|
|
|
| vipType | num | 大会员类型 | 0无<br />1月会员<br />2年会员 |
|
|
|
|
|
| vipDueDate | num | 会员到期时间 | 毫秒 时间戳 |
|
|
|
|
|
| dueRemark | str | 空 | 作用尚不明确 |
|
|
|
|
|
| accessStatus | num | 0 | 作用尚不明确 |
|
|
|
|
|
| vipStatus | num | 大会员状态 | 0无<br />1有 |
|
|
|
|
|
| vipStatusWarn | str | 空 | 作用尚不明确 |
|
|
|
|
|
| themeType | num | 0 | 作用尚不明确 |
|
|
|
|
|
| label | obj | ??? | 作用尚不明确 |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`vip`中的`label`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ---- | ------------ |
|
|
|
|
|
| path | str | 空 | 作用尚不明确 |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
以每页2项的方式获取UID为293793435的用户的第1页的关注明细
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
http://api.bilibili.com/x/relation/followings?vmid=293793435&ps=2&pn=1
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"list": [{
|
|
|
|
|
"mid": 14082,
|
|
|
|
|
"attribute": 2,
|
|
|
|
|
"mtime": 1584271945,
|
|
|
|
|
"tag": null,
|
|
|
|
|
"special": 0,
|
|
|
|
|
"uname": "山新",
|
|
|
|
|
"face": "http://i0.hdslb.com/bfs/face/74c82caee6d9eb623e56161ea8ed6d68afabfeae.jpg",
|
|
|
|
|
"sign": "都说了是天依爹地,不是妈咪。\r私信有点多回复不过来~商业合作啥的请移步Weibo私信@山新 哦哦哦~",
|
|
|
|
|
"official_verify": {
|
|
|
|
|
"type": 0,
|
|
|
|
|
"desc": "配音演员、声优。洛天依声源提供者。"
|
|
|
|
|
},
|
|
|
|
|
"vip": {
|
|
|
|
|
"vipType": 2,
|
|
|
|
|
"vipDueDate": 1601654400000,
|
|
|
|
|
"dueRemark": "",
|
|
|
|
|
"accessStatus": 0,
|
|
|
|
|
"vipStatus": 1,
|
|
|
|
|
"vipStatusWarn": "",
|
|
|
|
|
"themeType": 0,
|
|
|
|
|
"label": {
|
|
|
|
|
"path": ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
"mid": 420831218,
|
|
|
|
|
"attribute": 2,
|
|
|
|
|
"mtime": 1584208169,
|
|
|
|
|
"tag": [207542],
|
|
|
|
|
"special": 0,
|
|
|
|
|
"uname": "支付宝Alipay",
|
|
|
|
|
"face": "http://i2.hdslb.com/bfs/face/aaf18aeb2d9822e28a590bd8d878572ca8c59e04.jpg",
|
|
|
|
|
"sign": "阿支来了,关注点赞转发投币四连走起!",
|
|
|
|
|
"official_verify": {
|
|
|
|
|
"type": 1,
|
|
|
|
|
"desc": "支付宝官方账号"
|
|
|
|
|
},
|
|
|
|
|
"vip": {
|
|
|
|
|
"vipType": 1,
|
|
|
|
|
"vipDueDate": 1585065600000,
|
|
|
|
|
"dueRemark": "",
|
|
|
|
|
"accessStatus": 0,
|
|
|
|
|
"vipStatus": 1,
|
|
|
|
|
"vipStatusWarn": "",
|
|
|
|
|
"themeType": 0,
|
|
|
|
|
"label": {
|
|
|
|
|
"path": ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}],
|
|
|
|
|
"re_version": 3228575555,
|
|
|
|
|
"total": 699
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 操作用户关系(关注/取关 等)
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
<img src="/imgs/follow.svg" width="200" height="100" />
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/modify
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:POST*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
参数( application/x-www-form-urlencoded ):
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ------------------- | ------ | ---- |
|
|
|
|
|
| fid | 目标用户UID | 必要 | |
|
|
|
|
|
| act | 操作代码 | 必要 | |
|
|
|
|
|
| re_src | 必须为11 | 必要 | |
|
|
|
|
|
| csrf | cookies中的bili_jct | 必要 | |
|
|
|
|
|
|
|
|
|
|
操作代码:
|
|
|
|
|
|
|
|
|
|
| 代码 | 含义 |
|
|
|
|
|
| ---- | ------------ |
|
|
|
|
|
| 1 | 关注 |
|
|
|
|
|
| 2 | 取关 |
|
|
|
|
|
| 3 | 悄悄关注 |
|
|
|
|
|
| 4 | 取消悄悄关注 |
|
|
|
|
|
| 5 | 拉黑 |
|
|
|
|
|
| 6 | 取消拉黑 |
|
|
|
|
|
| 7 | 踢出粉丝 |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-111csrf校验失败<br />-101账号未登录<br />-400请求错误<br />22003用户位于黑名单 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
关注了UID为14082的用户
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
curl -b SESSDATA=xxx -d "fid=14082&act=1&re_src=11&csrf=xxx" http://api.bilibili.com/x/relation/modify
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 查询用户与自己关系1 (仅查关注)
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:GET*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ----------- | ------ | ---- |
|
|
|
|
|
| fid | 目标用户UID | 必要 | |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-101账号未登录<br />-400请求错误 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| --------- | ---------------------------------------- | ------------ | --------------------------------- |
|
|
|
|
|
| mid | num | 目标用户UID | |
|
|
|
|
|
| attribute | num | 关注属性 | 0未关注<br />2已关注<br />6已互粉 |
|
|
|
|
|
| mtime | num | 关注对方时间 | 时间戳 未关注为0 |
|
|
|
|
|
| tag | null默认分组<br />arrary存在至少一个分组 | 分组ID | |
|
|
|
|
|
| special | num | 特别关注标志 | 0否<br />1是 |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`tag`数组:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 项 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ----------------------- | ---- |
|
|
|
|
|
| 0 | num | 位于分组1的分组ID | |
|
|
|
|
|
| n | num | 位于分组(n+1)的分组ID | |
|
|
|
|
|
| …… | num | …… | …… |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
可得对于UID为258150656的用户,在2018/10/28 0:51:41时关注,且设为特别关注,并位于ID为-10分组中
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
http://api.bilibili.com/x/relation?fid=258150656
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"mid": 258150656,
|
|
|
|
|
"attribute": 2,
|
|
|
|
|
"mtime": 1540659101,
|
|
|
|
|
"tag": [-10],
|
|
|
|
|
"special": 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 查询用户与自己关系2(互相)
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/space/acc/relation
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:GET*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ----------- | ------ | ---- |
|
|
|
|
|
| mid | 目标用户UID | 必要 | |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-101账号未登录<br />-400请求错误 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ----------- | ---- | ------------------------ | ---- |
|
|
|
|
|
| relation | obj | 目标用户对于本用户的属性 | |
|
|
|
|
|
| be_relation | obj | 本用户对于目标用户的属性 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`中的`relation`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| --------- | ---------------------------------------- | ------------ | -------------- |
|
|
|
|
|
| mid | num | 对方用户UID | |
|
|
|
|
|
| attribute | num | | |
|
|
|
|
|
| mtime | num | 关注对方时间 | 互关后刷新时间 |
|
|
|
|
|
| tag | null默认分组<br />arrary存在至少一个分组 | | |
|
|
|
|
|
| special | num | | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`中的`be_relation`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| --------- | ---------------------------------------- | ------------ | -------------- |
|
|
|
|
|
| mid | num | | |
|
|
|
|
|
| attribute | num | | |
|
|
|
|
|
| mtime | num | 成为粉丝时间 | 互关后刷新时间 |
|
|
|
|
|
| tag | null默认分组<br />arrary存在至少一个分组 | | |
|
|
|
|
|
| special | num | | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`be_relation`与`relation`中的`tag`数组:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 项 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ----------------------- | ---- |
|
|
|
|
|
| 0 | num | 位于分组1的分组ID | |
|
|
|
|
|
| n | num | 位于分组(n+1)的分组ID | |
|
|
|
|
|
| …… | num | …… | …… |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
可得对于UID为15858903的用户,在2019/1/24 14:24:19时关注了对方,且互相关注,自己将对方特别关注,并同时位于ID为-10和194110的分组中,对方也将自己设为特别关注,并同时位于-10和56502的分组中(虽然我看不到)
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
http://api.bilibili.com/x/space/acc/relation?mid=15858903
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"relation": {
|
|
|
|
|
"mid": 15858903,
|
|
|
|
|
"attribute": 6,
|
|
|
|
|
"mtime": 1548311059,
|
|
|
|
|
"tag": [-10, 194110],
|
|
|
|
|
"special": 1,
|
|
|
|
|
"is_followed": false
|
|
|
|
|
},
|
|
|
|
|
"be_relation": {
|
|
|
|
|
"mid": 293793435,
|
|
|
|
|
"attribute": 6,
|
|
|
|
|
"mtime": 1548311059,
|
|
|
|
|
"tag": [56502, -10],
|
|
|
|
|
"special": 1,
|
|
|
|
|
"is_followed": false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 关注分组相关
|
|
|
|
|
|
|
|
|
|
### 查询关注分组列表
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/tags
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:GET*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ------ | -------- | ------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-101账号未登录 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
| data | arrary | 分组列表 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`数组:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 项 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ------------ | ---- |
|
|
|
|
|
| 0 | obj | 特别关注分组 | |
|
|
|
|
|
| 1 | obj | 默认分组 | |
|
|
|
|
|
| n | obj | 其他分组 | |
|
|
|
|
|
| …… | num | …… | …… |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`data`中的对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ----- | ---- | ---------- | ---------------------------------- |
|
|
|
|
|
| tagid | num | 分组ID | 特别关注恒为-10<br />默认分组恒为0 |
|
|
|
|
|
| name | str | 分组名称 | |
|
|
|
|
|
| count | num | 分组成员数 | |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
查询所有的分组的名字以及ID
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
http://api.bilibili.com/x/relation/tags
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": [{
|
|
|
|
|
"tagid": -10,
|
|
|
|
|
"name": "特别关注",
|
|
|
|
|
"count": 16
|
|
|
|
|
}, {
|
|
|
|
|
"tagid": 0,
|
|
|
|
|
"name": "默认分组",
|
|
|
|
|
"count": 536
|
|
|
|
|
},{
|
|
|
|
|
"tagid": 194111,
|
|
|
|
|
"name": "我的同学",
|
|
|
|
|
"count": 16
|
|
|
|
|
},
|
|
|
|
|
…………
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 查询关注分组明细
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/tag
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:GET*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | -------- | ------ | ---------------------------------- |
|
|
|
|
|
| tagid | 分组ID | 必要 | 特别关注恒为-10<br />默认分组恒为0 |
|
|
|
|
|
| ps | 每页项数 | 非必要 | 默认为50 |
|
|
|
|
|
| pn | 页数 | 非必要 | 默认为1 |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ------ | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-101账号未登录<br />-400请求错误<br />22104该分组不存在<br />-101账号未登录 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
| data | arrary | 成员列表 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`数组:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 项 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | --------- | ---------------- |
|
|
|
|
|
| 0 | obj | 成员信息1 | |
|
|
|
|
|
| n | obj | 成员信息n | 按照添加顺序排序 |
|
|
|
|
|
| …… | num | …… | …… |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`data`中的对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| --------------- | ---- | ----------- | ------- |
|
|
|
|
|
| mid | num | 用户UID | |
|
|
|
|
|
| uname | str | 用户昵称 | |
|
|
|
|
|
| face | str | 用户头像url | jpg gif |
|
|
|
|
|
| sign | str | 用户签名 | |
|
|
|
|
|
| official_verify | obj | 认证信息 | |
|
|
|
|
|
| vip | obj | 会员信息 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`data`中的对象中的`official_verify`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ------------ | --------------- |
|
|
|
|
|
| type | num | 用户认证类型 | -1无<br />1认证 |
|
|
|
|
|
| desc | str | 用户认证信息 | 无为空 |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`data`中的对象中的`vip`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------------- | ---- | ------------ | ----------------------------- |
|
|
|
|
|
| vipType | num | 大会员类型 | 0无<br />1月会员<br />2年会员 |
|
|
|
|
|
| vipDueDate | num | 会员到期时间 | 毫秒 时间戳 |
|
|
|
|
|
| dueRemark | str | 空 | 作用尚不明确 |
|
|
|
|
|
| accessStatus | num | 0 | 作用尚不明确 |
|
|
|
|
|
| vipStatus | num | 大会员状态 | 0无<br />1有 |
|
|
|
|
|
| vipStatusWarn | str | 空 | 作用尚不明确 |
|
|
|
|
|
| themeType | num | 0 | 作用尚不明确 |
|
|
|
|
|
| label | obj | ??? | 作用尚不明确 |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
数组`data`中的对象中的`label`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ---- | ------------ |
|
|
|
|
|
| path | str | 空 | 作用尚不明确 |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
以每页2项的方式获取了分组ID为207542分组的第1页的粉丝明细
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
http://api.bilibili.com/x/relation/tag?tagid=207542&ps=2&pn=1
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": [{
|
|
|
|
|
"mid": 420831218,
|
|
|
|
|
"uname": "支付宝Alipay",
|
|
|
|
|
"face": "http://i2.hdslb.com/bfs/face/aaf18aeb2d9822e28a590bd8d878572ca8c59e04.jpg",
|
|
|
|
|
"sign": "阿支来了,关注点赞转发投币四连走起!",
|
|
|
|
|
"official_verify": {
|
|
|
|
|
"type": 1,
|
|
|
|
|
"desc": "支付宝官方账号"
|
|
|
|
|
},
|
|
|
|
|
"vip": {
|
|
|
|
|
"vipType": 1,
|
|
|
|
|
"vipDueDate": 1585065600000,
|
|
|
|
|
"dueRemark": "",
|
|
|
|
|
"accessStatus": 0,
|
|
|
|
|
"vipStatus": 1,
|
|
|
|
|
"vipStatusWarn": "",
|
|
|
|
|
"themeType": 0,
|
|
|
|
|
"label": {
|
|
|
|
|
"path": ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
"mid": 125086406,
|
|
|
|
|
"uname": "MSI微星科技",
|
|
|
|
|
"face": "http://i1.hdslb.com/bfs/face/a844760e4e491677615b39399bc761e74c579bb4.jpg",
|
|
|
|
|
"sign": "你好,这里是微星显卡官方!专注显卡三十年,欢迎私信咨询或提问MSI",
|
|
|
|
|
"official_verify": {
|
|
|
|
|
"type": 1,
|
|
|
|
|
"desc": "微星科技官方账号"
|
|
|
|
|
},
|
|
|
|
|
"vip": {
|
|
|
|
|
"vipType": 1,
|
|
|
|
|
"vipDueDate": 1540656000000,
|
|
|
|
|
"dueRemark": "",
|
|
|
|
|
"accessStatus": 0,
|
|
|
|
|
"vipStatus": 0,
|
|
|
|
|
"vipStatusWarn": "",
|
|
|
|
|
"themeType": 0,
|
|
|
|
|
"label": {
|
|
|
|
|
"path": ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 查询目标用户所在的分组
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/tag/user
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:GET*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ----------- | ------ | ---- |
|
|
|
|
|
| fid | 目标用户UID | 必要 | |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-101账号未登录<br />-400请求错误 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------------------- | ---- | --------- | ---- |
|
|
|
|
|
| {加入的分组ID 1} | str | 分组1名称 | |
|
|
|
|
|
| {加入的分组ID n} | str | 分组n名称 | |
|
|
|
|
|
| …… | str | …… | |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
查询用户319214221存在的分组的ID和名称
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
http://api.bilibili.com/x/relation/tag/user?fid=319214221
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"-10": "特别关注",
|
|
|
|
|
"194111": "我的同学"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 创建关注分组
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
<img src="/imgs/add.svg" width="100" height="100" />
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/tag/create
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:POST*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
参数( application/x-www-form-urlencoded ):
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ------------------- | ------ | ---------- |
|
|
|
|
|
| tag | 分组名 | 必要 | 最长16字符 |
|
|
|
|
|
| csrf | cookies中的bili_jct | 必要 | |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-111csrf校验失败<br />-101账号未登录<br />-400请求错误<br />22106该分组已经存在<br />22103分组名过长 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
`data`对象:
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ----- | ---- | -------------- | ---- |
|
|
|
|
|
| tagid | num | 创建的分组的ID | |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
创建了名为"vUP"的分组,ID为216677
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
curl -b SESSDATA=xxx -d "tag=vUP&csrf=xxx" http://api.bilibili.com/x/relation/tag/create
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"tagid": 216677
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 重命名关注分组
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/tag/update
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:POST*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
参数( application/x-www-form-urlencoded ):
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ------------------- | ------ | ---------- |
|
|
|
|
|
| tagid | 分组ID | 必要 | |
|
|
|
|
|
| name | 新名称 | 必要 | 最长16字符 |
|
|
|
|
|
| csrf | cookies中的bili_jct | 必要 | |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-111csrf校验失败<br />-101账号未登录<br />-400请求错误<br />22103分组名过长<br />22104该分组不存在 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
把ID为194112的分组更名为"膜法师"
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
curl -b SESSDATA=xxx -d "tagid=194112&name=%e8%86%9c%e6%b3%95%e5%b8%88&csrf=xxx" http://api.bilibili.com/x/relation/tag/update
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 删除关注分组
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
<img src="/imgs/delete.svg" width="100" height="100" />
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/tag/del
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:POST*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
参数( application/x-www-form-urlencoded ):
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ------------------- | ------ | ---- |
|
|
|
|
|
| tagid | 分组ID | 必要 | |
|
|
|
|
|
| csrf | cookies中的bili_jct | 必要 | |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-111csrf校验失败<br />-101账号未登录<br />-400请求错误 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
删除分组ID为216699的分组
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
curl -b SESSDATA=xxx -d "tagid=216699&csrf=xxx" http://api.bilibili.com/x/relation/tag/del
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 修改用户分组关系(添加/删除)
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
<img src="/imgs/add.svg" width="100" height="100" />
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
> http://api.bilibili.com/x/relation/tags/addUsers
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
*方式:POST*
|
|
|
|
|
|
2020-03-21 14:37:55 +08:00
|
|
|
|
需要登录(SESSDATA)
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
参数( application/x-www-form-urlencoded ):
|
2020-03-17 11:05:26 +08:00
|
|
|
|
|
|
|
|
|
| 参数名 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ------------------- | ------ | ------------------------ |
|
|
|
|
|
| fids | 目标用户UID | 必要 | |
|
|
|
|
|
| tagids | 分组ID | 必要 | 每个ID见用","(%2C)间隔 |
|
|
|
|
|
| csrf | cookies中的bili_jct | 必要 | |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0成功<br />-111csrf校验失败<br />-101账号未登录<br />-400请求错误<br />22105未关注 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | 作用尚不明确 |
|
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2020-03-23 16:46:13 +08:00
|
|
|
|
把UID为205631797的用户同时添加到了分组ID为-10和207542的分组中
|
|
|
|
|
|
2020-03-17 11:05:26 +08:00
|
|
|
|
curl -b SESSDATA=xxx -d "fids=205631797&tagids=-10%2C207542&csrf=xxx" http://api.bilibili.com/x/relation/tags/addUsers
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|