Skip to content

百度网盘接口清单

来源:backend/internal/drives/baidu.go
抓包日志:backend/logs/drive-api-debug/baidu.txt


1. 校验分享提取码

接口概览

项目
方法POST
URLhttps://pan.baidu.com/share/verify
作用提交提取码,成功后 Set-Cookie 写入 BDCLND(即 randsk),后续 share/list 需携带

Query 参数

参数类型必填说明
surlstring短链 ID(不含 1 前缀),如 zdKZBupSazlUyyMPTXzjBQ
pwdstring提取码,可与 Body 重复

请求体(application/x-www-form-urlencoded

参数说明
pwd提取码
vcode验证码,常为空
vcode_str验证码串,常为空

请求示例

bash
curl --request POST \
  --url 'https://pan.baidu.com/share/verify?surl=<surl>&pwd=<pwd>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'Referer: https://pan.baidu.com/s/1<surl>?pwd=<pwd>' \
  --header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36' \
  --data-raw 'pwd=<pwd>&vcode=&vcode_str='

响应示例(成功)

json
{
  "errno": 0,
  "err_msg": "",
  "request_id": 9061438069501856072,
  "randsk": "KjwXNB9crQtToB4mrlUZ3l0%2F%2BCXH7LFKnQid560%2B6Ds%3D"
}

关键响应字段

字段说明
errno0 成功
randsk与 Cookie BDCLND 对应,列表请求需带 Cookie

2. 分享列表(短链根目录)

接口概览

项目
方法GET
URLhttps://pan.baidu.com/share/list
作用通过 shorturl 拉取分享根目录条目(需已验证提取码时 Cookie 含 BDCLND

Query 参数(日志示例)

参数示例说明
web5固定
app_id250528固定
shorturlzdKZBupSazlUyyMPTXzjBQ短链 ID
root1根目录
page1页码
num20每页条数
ordertime排序字段
desc1是否降序
channelchunlei渠道
clienttype0客户端类型

请求示例

bash
curl --request GET \
  --url 'https://pan.baidu.com/share/list?web=5&app_id=250528&desc=1&showempty=0&page=1&num=20&order=time&shorturl=<surl>&root=1&view_mode=1&channel=chunlei&web=1&clienttype=0' \
  --header 'Cookie: BDUSS=<...>; STOKEN=<...>; BDCLND=<randsk>' \
  --header 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36'

响应示例(成功,目录项)

json
{
  "errno": 0,
  "request_id": 9061438131561061721,
  "title": "/影视分享2026/电影更新/Z-战-Z-机-Q",
  "list": [
    {
      "category": "6",
      "fs_id": "666139025199417",
      "isdir": "1",
      "server_filename": "Z-战-Z-机-Q",
      "path": "/影视分享2026/电影更新/Z-战-Z-机-Q",
      "size": "0",
      "server_mtime": "1772859571"
    }
  ],
  "share_id": 12127610344,
  "uk": 590430130,
  "show_msg": "success"
}

响应示例(未验证提取码)

json
{
  "errno": -9,
  "request_id": 9061437942957455308,
  "show_msg": "提取码验证失败,请重试"
}

3. 分享列表(uk + shareid + 子路径)

接口概览

项目
方法GET
URLhttps://pan.baidu.com/share/list
作用在已知 ukshare_id 时按 dir 进入子目录

Query 参数(日志示例)

参数说明
is_from_webtrue
uk分享者 uk
shareid分享 ID
dirURL 编码后的绝对路径
page / num分页
order / desc排序
app_id250528

说明

  • Cookie 需包含登录态(BDUSS/STOKEN)及验证后的 BDCLND
  • 具体 dirfs_id 关系以业务层拼接为准,见 baidu.go

4. 其他(代码中存在,本次日志未单独成节)

  • GET https://mbd.baidu.com/userx/v1/info/get — 用户信息辅助接口
  • 移动端分支 share/listshareid/uk/fid/sekey 等) — 见源码