bilibili-API-collect/docs/login/login_notice.md
Session小胡 60a0c5d1a2
feat: 各种接口补充与错误修正 (#1066)
* fix(video/collection.md): unclosed xml tags

* feat(video/report.md): uuid not really random

* feat: b23.tv short link

* feat: login/moral/exp log

* feat: v_voucher

* feat: upload video cover & post

* feat(creativecenter/upload.md): upload octet-stream

* feat(creativecenter/upload.md): update some notes

* feat(clientinfo/ip.md): another from live

* feat: live web heartbeat

* feat: update popular series & precious

* fix(creativecenter/upload.md): mistakes in example

* feat: merge duplicate fav info

* feat(README.md): missing link to webmask

* feat(search/hot.md): word_type

* feat(login/login_action): recovery old api

* feat(video/collection.md):  series operation

* feat: video season operation

* feat: add & mod some links

* feat(search/suggest.md): up to date

* feat: web home header image

* feat(misc/sign/bili_ticket.md): demo for nodejs

* feat(creativecenter/upload.md): x-upos-auth validity period

* feat: add referer & buvid3 to request header

* feat: customer service message heartbeat & upload

* feat(customerservice/msg.md): upload code 1200201

* feat(video/report.md): click/web/h5

* feat(video/report.md): view count desc

* feat: laser2

* feat: wbi_key in bili_ticket

* fix: typo & unclosed XML tags

* feat(misc/sign/v_voucher): cookie x-bili-gaia-vtoken

* feat(search/hot.md): square

* feat(video/status_number.md): fold archive_stat/stat

* feat(fav/info.md): resource/infos invalid type 21

* feat: /x/activity/subject/info

* feat: lottery

* feat(docs/misc/b23.tv): remove some unnecessary fields

* feat(creativecenter/upload.md): types/predict

* fix(video/collection.md): invalid end tag

* feat: app version upgrade

* feat(creativecenter/upload.md): tag/recommend #528

* feat(user/status_number.md): navnum

* feat: /x/activity/page/list

* feat(comment/list.md): desc about pagination_str

* feat(comment/list.md): update example

* feat(dynamic/all.md): #1082

* fix(comment/list.md): -352 not -412

* feat: #700

* feat(video/video_stream.md): #606 & cv949156

* feat(message/private_msg.md): single_unread freq

* feat: getUserWallet

* fix: broken form

* feat(Layout.vue): copyright to 2024

* feat: /x/topic/pub/rcmd/search

* feat: #425

* feat(misc/time_stamp.md): rtc/getTimestamp

* fix(misc/time_stamp.md): missing end tag

* feat: #745

* feat(dynamic/all.md): update feed/all

* feat(danmaku/action.md): #220

* feat(live/info.md): gethistory from cv8186413

* fix(danmaku/action.md): missing end tag
2024-08-21 19:02:39 +08:00

7.1 KiB
Raw Blame History

登录记录

查询登录记录

https://api.bilibili.com/x/safecenter/login_notice

请求方式GET

认证方式CookieSESSDATA

url参数

参数名 类型 内容 必要性 备注
mid num 用户mid 必要
buvid str 设备虚拟id 非必要 web端为操作登录接口时Cookie中的buvid3
若登录设备无buvid则留空

json回复

根对象:

字段 类型 内容 备注
code num 返回值 0成功
-101账号未登录
-400请求错误
message str 错误信息 默认为0
ttl num 1
data obj 信息本体

data对象:

字段 类型 内容 备注
mid num 登录用户mid
device_name str 登录设备 依靠操作登录接口时的UA决定
login_type str 登录方式 根据登录接口决定
login_time str 登录时间 YYYY-MM-DD hh:mm:ss
location str 登录位置 依靠ip决定
ip str 登录ip 部分用*打码

示例:

查询用户293793435设备id为fuck_chenrui的登录记录

curl -G 'https://api.bilibili.com/x/safecenter/login_notice' \
--data-urlencode 'mid=293793435' \
--data-urlencode 'buvid=fuck_chenrui' \
-b 'SESSDATA=xxx'
查看响应示例:
{
    "code": 0,
    "message": "0",
    "ttl": 1,
    "data": {
        "mid": 293793435,
        "device_name": "Chrome浏览器",
        "login_type": "扫码登录",
        "login_time": "2020-10-02 22:42:38",
        "location": "中国陕西渭南",
        "ip": "36.40.***.**"
    }
}

最近一周的登录情况

https://api.bilibili.com/x/member/web/login/log

请求方式: GET

认证方式: Cookie (SESSDATA)

URL参数:

参数名 类型 内容 必要性 备注
jsonp str 回调函数名? 非必要 默认 jsonp
web_location str 网页位置? 非必要 默认 333.33

JSON回复:

根对象:

字段 类型 内容 备注
code num 返回值 0成功
-101账号未登录
message str 错误信息 默认为 0
ttl num 1
data obj 信息本体

data对象:

字段 类型 内容 备注
count num 记录总数
list arr 登录记录列表

data中的list数组:

类型 内容 备注
0 obj 登录记录1
…… obj ……
n obj 登录记录(n+1)

list数组中的对象:

字段 类型 内容 备注
ip str 登录 IP 末两位以 * 打码
time num 登录时间 UNIX 秒级时间戳
time_at str 登录时间 格式为 yyyy-MM-dd HH:mm:ss
status bool 是否登录成功?
type num 登录方式?
geo str 登录地理位置

示例:

查询本用户最近一周的登录情况

curl -G "https://api.bilibili.com/x/member/web/login/log" \
-b "SESSDATA=xxx"
查看响应示例:
{
  "code": 0,
  "message": "0",
  "ttl": 1,
  "data": {
    "count": 14,
    "list": [
      {
        "ip": "108.181.*.*",
        "time": 1722036741,
        "time_at": "2024-07-27 07:32:21",
        "status": true,
        "type": 0,
        "geo": "美国加利福尼亚州洛杉矶telus.com"
      },
      {
        "ip": "104.28.*.*",
        "time": 1722040653,
        "time_at": "2024-07-27 08:37:33",
        "status": true,
        "type": 0,
        "geo": "巴西"
      },
      {
        "ip": "104.28.*.*",
        "time": 1721950332,
        "time_at": "2024-07-26 07:32:12",
        "status": true,
        "type": 0,
        "geo": "新加坡cloudflare.com"
      },
      {
        "ip": "104.28.*.*",
        "time": 1721964627,
        "time_at": "2024-07-26 11:30:27",
        "status": true,
        "type": 0,
        "geo": "美国弗吉尼亚州雷斯顿cloudflare.com"
      },
      {
        "ip": "143.92.*.*",
        "time": 1721861861,
        "time_at": "2024-07-25 06:57:41",
        "status": true,
        "type": 0,
        "geo": "中国香港特别行政区"
      },
      {
        "ip": "143.92.*.*",
        "time": 1721861855,
        "time_at": "2024-07-25 06:57:35",
        "status": true,
        "type": 0,
        "geo": "中国香港特别行政区"
      },
      {
        "ip": "104.28.*.*",
        "time": 1721709514,
        "time_at": "2024-07-23 12:38:34",
        "status": true,
        "type": 0,
        "geo": "日本千叶县成田市cloudflare.com"
      },
      {
        "ip": "104.28.*.*",
        "time": 1721709618,
        "time_at": "2024-07-23 12:40:18",
        "status": true,
        "type": 0,
        "geo": "日本千叶县成田市cloudflare.com"
      },
      {
        "ip": "143.92.*.*",
        "time": 1721636125,
        "time_at": "2024-07-22 16:15:25",
        "status": true,
        "type": 0,
        "geo": "中国香港特别行政区"
      },
      {
        "ip": "143.92.*.*",
        "time": 1721636111,
        "time_at": "2024-07-22 16:15:11",
        "status": true,
        "type": 0,
        "geo": "中国香港特别行政区"
      },
      {
        "ip": "104.28.*.*",
        "time": 1721539870,
        "time_at": "2024-07-21 13:31:10",
        "status": true,
        "type": 0,
        "geo": "美国加利福尼亚州东洛杉矶cloudflare.com"
      },
      {
        "ip": "104.28.*.*",
        "time": 1721539965,
        "time_at": "2024-07-21 13:32:45",
        "status": true,
        "type": 0,
        "geo": "美国加利福尼亚州东洛杉矶cloudflare.com"
      },
      {
        "ip": "42.2.*.*",
        "time": 1721477962,
        "time_at": "2024-07-20 20:19:22",
        "status": true,
        "type": 0,
        "geo": "中国香港特别行政区pccw.com"
      },
      {
        "ip": "42.2.*.*",
        "time": 1721477960,
        "time_at": "2024-07-20 20:19:20",
        "status": true,
        "type": 0,
        "geo": "中国香港特别行政区pccw.com"
      }
    ]
  }
}