定制化图片能力

优质
小牛编辑
146浏览
2023-12-01

按照上传时间获取文件列表

接口概述

接口功能

本文档主要针对需要集成http api的技术工程师。 如果您的应用已经获取用户授权,则可以通过该接口按照上传时间获取图片列表,可以返回指定时间前或指定时间后的结果。

使用条件

频控限制:有
接口鉴权:有
接入流程:https://www.xnip.cn/shouce/629/47115.html

依赖说明

access_token: 作为访问用户数据的授权凭证

其他说明

  1. 网盘目前支持的缩略图格式如下,不属于以下格式的图片,不会返回相关的缩略图数据。 "jpg", "jpeg", "png", "gif", "bmp", "webp", "heic", "heif", "avci", "livp"
  2. 用户上传图片后,会异步生成缩略图,生成时间一般在30min内。
  3. 图片大小超过20M不会生成缩略图。
  4. 用户可使用图片缩略图地址实现图片预览,缩略图地址的有效期通常为8小时。
  5. 缩略图地址示例如下,其中size参数为请求缩略图的大小,c表示宽度,u表示高度: https://thumbnail0.baidupcs.com/thumbnail/fe576033bnd89833c370ab6912246b85?fid=2082810368-250528-116244312814490&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-i%2FauszAq1ebIf7TZVxLILp76E2E%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203061438062334&dp-callid=0&time=1597309200&size=c140_u90&quality=100&vuk=2082810368&ft=image

参数说明

请求方式

GET 

接口地址

https://pan.baidu.com/rest/2.0/xpan/multimedia?method=recentlist

请求参数

名称类型必须示例参数位置描述
access_tokenstring12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328query接口鉴权参数
categoryint3query文件类型,图片为3
startint0query查询起点,默认0
limitint100query查询数据,默认1000,最大1000,如果resolution=on,则最大100
sortbystringtimequery排序字段
time按修改时间排序,name按文件名称排序,size按文件大小排序,不传默认按上传时间排序
orderstringdescquery降序-desc, 升序-asc,默认降序
stimeint1609430400query查询起始时间戳,如传入,则返回这个时间戳之后的图片集合
mtimeint1614528000query查询结束时间戳,如传入,则返回这个时间戳之前的图片集合
resolutionstringoffquery是否需要图片原始分辨率,on未需要,off未不需要,默认为off

响应参数

参数类型描述
has_moreint1 表示还有数据,0表示没有数据
cursorint下一次查询的起点
listjson array返回的图片列表
list[0] [" filename"]string文件名
list[0] [" fs_id"]uint64文件在云端的唯一标识ID
list[0] [" md5"]string文件md5
list[0] [" parent_path"]`string文件所在目录
list[0] [" server_ctime"]int文件上传时间
list[0] [" server_mtime"]int文件修改时间
list[0] [" size"]uint64文件大小,单位B
list[0] [" width"]int文件原始宽度
list[0] ["height"]int文件原始高度
list[0] ["thumbs"]json缩略图地址,包含icon以及三个不同尺寸的缩略图地址

示例说明

假设示例请求数据如下。

参数参数数据描述
access_token12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328接口鉴权参数
category3表示图片
start0查询起点
limit5查询数目
resolutionon需要图片原始分辨率

curl示例

curl -L -X GET 'http://pan.baidu.com/rest/2.0/xpan/multimedia?method=recentlist&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&category=3&start=0&limit=5&resolution=on' \
-H 'User-Agent: pan.baidu.com' 

Python示例

import requests

url = "http://pan.baidu.com/rest/2.0/xpan/multimedia?method=recentlist&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&category=3&start=0&limit=5&resolution=on"

payload = {} headers = { 'User-Agent': 'pan.baidu.com' }

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

响应示例

{
    "cursor": 5,
    "errmsg": "succ",
    "errno": 0,
    "has_more": 1,
    "list": [
        {
            "filename": "mmexport1589760367195.gif",
            "fs_id": 116244312814490,
            "height": 88,
            "md5": "fe576033bnd89833c370ab6912246b85",
            "parent_path": "/测试目录/testnac",
            "server_ctime": 1594367179,
            "server_mtime": 1596077866,
            "size": 30728,
            "thumbs": {
                "icon": "https://thumbnail0.baidupcs.com/thumbnail/fe576033bnd89833c370ab6912246b85?fid=2082810368-250528-116244312814490&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-i%2FauszAq1ebIf7TZVxLILp76E2E%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203061438062334&dp-callid=0&time=1597309200&size=c60_u60&quality=100&vuk=2082810368&ft=image",
                "url1": "https://thumbnail0.baidupcs.com/thumbnail/fe576033bnd89833c370ab6912246b85?fid=2082810368-250528-116244312814490&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-i%2FauszAq1ebIf7TZVxLILp76E2E%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203061438062334&dp-callid=0&time=1597309200&size=c140_u90&quality=100&vuk=2082810368&ft=image",
                "url2": "https://thumbnail0.baidupcs.com/thumbnail/fe576033bnd89833c370ab6912246b85?fid=2082810368-250528-116244312814490&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-i%2FauszAq1ebIf7TZVxLILp76E2E%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203061438062334&dp-callid=0&time=1597309200&size=c360_u270&quality=100&vuk=2082810368&ft=image",
                "url3": "https://thumbnail0.baidupcs.com/thumbnail/fe576033bnd89833c370ab6912246b85?fid=2082810368-250528-116244312814490&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-i%2FauszAq1ebIf7TZVxLILp76E2E%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203061438062334&dp-callid=0&time=1597309200&size=c850_u580&quality=100&vuk=2082810368&ft=image"
            },
            "width": 100
        },
        {
            "filename": "mmexport1589760383746.gif",
            "fs_id": 1060489721865574,
            "height": 89,
            "md5": "a095133d1qf350ebae1304f28ad3e885",
            "parent_path": "/测试目录/testnac",
            "server_ctime": 1594367178,
            "server_mtime": 1596077866,
            "size": 69326,
            "thumbs": {
                "icon": "https://thumbnail0.baidupcs.com/thumbnail/a095133d1qf350ebae1304f28ad3e885?fid=2082810368-250528-1060489721865574&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-xloaGzIEDxPS0Cxyk68YRcaisiE%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203100846359528&dp-callid=0&time=1597309200&size=c60_u60&quality=100&vuk=2082810368&ft=image",
                "url1": "https://thumbnail0.baidupcs.com/thumbnail/a095133d1qf350ebae1304f28ad3e885?fid=2082810368-250528-1060489721865574&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-xloaGzIEDxPS0Cxyk68YRcaisiE%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203100846359528&dp-callid=0&time=1597309200&size=c140_u90&quality=100&vuk=2082810368&ft=image",
                "url2": "https://thumbnail0.baidupcs.com/thumbnail/a095133d1qf350ebae1304f28ad3e885?fid=2082810368-250528-1060489721865574&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-xloaGzIEDxPS0Cxyk68YRcaisiE%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203100846359528&dp-callid=0&time=1597309200&size=c360_u270&quality=100&vuk=2082810368&ft=image",
                "url3": "https://thumbnail0.baidupcs.com/thumbnail/a095133d1qf350ebae1304f28ad3e885?fid=2082810368-250528-1060489721865574&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-xloaGzIEDxPS0Cxyk68YRcaisiE%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203100846359528&dp-callid=0&time=1597309200&size=c850_u580&quality=100&vuk=2082810368&ft=image"
            },
            "width": 92
        },
        {
            "filename": "mmexport1589760376325.gif",
            "fs_id": 1080068084464802,
            "height": 60,
            "md5": "958ad5dbek3169a0cc2f420971f0adfb",
            "parent_path": "/测试目录/testnac",
            "server_ctime": 1594367178,
            "server_mtime": 1596077866,
            "size": 20525,
            "thumbs": {
                "icon": "https://thumbnail0.baidupcs.com/thumbnail/958ad5dbek3169a0cc2f420971f0adfb?fid=2082810368-250528-1080068084464802&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-fZpZzPrG8zCzzzyIycmL6I5EhUI%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203131150646275&dp-callid=0&time=1597309200&size=c60_u60&quality=100&vuk=2082810368&ft=image",
                "url1": "https://thumbnail0.baidupcs.com/thumbnail/958ad5dbek3169a0cc2f420971f0adfb?fid=2082810368-250528-1080068084464802&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-fZpZzPrG8zCzzzyIycmL6I5EhUI%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203131150646275&dp-callid=0&time=1597309200&size=c140_u90&quality=100&vuk=2082810368&ft=image",
                "url2": "https://thumbnail0.baidupcs.com/thumbnail/958ad5dbek3169a0cc2f420971f0adfb?fid=2082810368-250528-1080068084464802&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-fZpZzPrG8zCzzzyIycmL6I5EhUI%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203131150646275&dp-callid=0&time=1597309200&size=c360_u270&quality=100&vuk=2082810368&ft=image",
                "url3": "https://thumbnail0.baidupcs.com/thumbnail/958ad5dbek3169a0cc2f420971f0adfb?fid=2082810368-250528-1080068084464802&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-fZpZzPrG8zCzzzyIycmL6I5EhUI%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203131150646275&dp-callid=0&time=1597309200&size=c850_u580&quality=100&vuk=2082810368&ft=image"
            },
            "width": 60
        },
        {
            "filename": "1592882780362.jpg",
            "fs_id": 663796967169505,
            "height": 2104,
            "md5": "d339fea44vfcc3da0281ee15378377a7",
            "parent_path": "/xiaotiancai",
            "server_ctime": 1593315085,
            "server_mtime": 1593315085,
            "size": 1110857,
            "thumbs": {
                "icon": "https://thumbnail0.baidupcs.com/thumbnail/d339fea44vfcc3da0281ee15378377a7?fid=2082810368-250528-663796967169505&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-zp791uG1NUVGp%2Bs%2BzSJHgLIYkd8%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203168822813250&dp-callid=0&time=1597309200&size=c60_u60&quality=100&vuk=2082810368&ft=image",
                "url1": "https://thumbnail0.baidupcs.com/thumbnail/d339fea44vfcc3da0281ee15378377a7?fid=2082810368-250528-663796967169505&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-zp791uG1NUVGp%2Bs%2BzSJHgLIYkd8%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203168822813250&dp-callid=0&time=1597309200&size=c140_u90&quality=100&vuk=2082810368&ft=image",
                "url2": "https://thumbnail0.baidupcs.com/thumbnail/d339fea44vfcc3da0281ee15378377a7?fid=2082810368-250528-663796967169505&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-zp791uG1NUVGp%2Bs%2BzSJHgLIYkd8%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203168822813250&dp-callid=0&time=1597309200&size=c360_u270&quality=100&vuk=2082810368&ft=image",
                "url3": "https://thumbnail0.baidupcs.com/thumbnail/d339fea44vfcc3da0281ee15378377a7?fid=2082810368-250528-663796967169505&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-zp791uG1NUVGp%2Bs%2BzSJHgLIYkd8%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203168822813250&dp-callid=0&time=1597309200&size=c850_u580&quality=100&vuk=2082810368&ft=image"
            },
            "width": 1560
        },
        {
            "filename": "IMG_20200612_073203.jpg",
            "fs_id": 425385800281871,
            "height": 3968,
            "md5": "070ad8d6eu51061eccff5411860c91f4",
            "parent_path": "/来自:EML-AL00/DCIM/Camera",
            "server_ctime": 1591940981,
            "server_mtime": 1591940981,
            "size": 3081629,
            "thumbs": {
                "icon": "https://thumbnail0.baidupcs.com/thumbnail/070ad8d6eu51061eccff5411860c91f4?fid=2082810368-250528-425385800281871&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-65EiS3tKNjZK3bEECRCo3vE72h0%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203198122761550&dp-callid=0&time=1597309200&size=c60_u60&quality=100&vuk=2082810368&ft=image",
                "url1": "https://thumbnail0.baidupcs.com/thumbnail/070ad8d6eu51061eccff5411860c91f4?fid=2082810368-250528-425385800281871&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-65EiS3tKNjZK3bEECRCo3vE72h0%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203198122761550&dp-callid=0&time=1597309200&size=c140_u90&quality=100&vuk=2082810368&ft=image",
                "url2": "https://thumbnail0.baidupcs.com/thumbnail/070ad8d6eu51061eccff5411860c91f4?fid=2082810368-250528-425385800281871&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-65EiS3tKNjZK3bEECRCo3vE72h0%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203198122761550&dp-callid=0&time=1597309200&size=c360_u270&quality=100&vuk=2082810368&ft=image",
                "url3": "https://thumbnail0.baidupcs.com/thumbnail/070ad8d6eu51061eccff5411860c91f4?fid=2082810368-250528-425385800281871&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-65EiS3tKNjZK3bEECRCo3vE72h0%3D&expires=8h&chkbd=0&chkv=0&dp-logid=1214203198122761550&dp-callid=0&time=1597309200&size=c850_u580&quality=100&vuk=2082810368&ft=image"
            },
            "width": 2976
        }
    ],
    "request_id": "1214445147216738928"
}

错误码说明

错误码描述
42211获取图片分辨率失败
31034命中频控

更多错误码请参考: https://www.xnip.cn/shouce/629/47126.html

获取用户图片智能分类标签

接口概述

接口功能

本文档主要针对需要集成http api的技术工程师。 如果您的应用已经获取用户授权,则可以通过该接口获取用户网盘图片指定智能分类下的标签详情。

使用条件

频控限制:有
接口鉴权:有
接入流程:https://www.xnip.cn/shouce/629/47115.html

依赖说明

access_token: 作为访问用户数据的授权凭证

参数说明

请求方式

GET

接口地址

https://pan.baidu.com/rest/2.0/xpan/imageproc?method=gettags

请求参数

名称类型必须示例参数位置描述
access_tokenstring12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328query接口鉴权参数
keystringtagquery固定传tag
typeint1querytag类型,1为事物,2为地点

响应参数

参数类型描述
cover_fidstring封面图片的fs_id
typeinttag类型,1事物,2地点
tag_idint分类id
ctimeint分类创建时间
mtimeint分类修改时间
tag_namestring分类名称
is_showint1 为该分类可以显示 ,0 为该分类不可以显示
is_searchint1 为该分类可以搜索 ,0为 该分类不可以搜索
thumbstring封面图片的缩略图地址

示例说明

假设示例请求数据如下。

参数参数数据描述
access_token12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328接口鉴权参数
keytag固定值
type1获取类型为事物的标签

curl示例

curl -L -X GET 'https://pan.baidu.com/rest/2.0/xpan/imageproc?method=gettags&key=tag&type=1&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328'\
-H 'User-Agent: pan.baidu.com'

Python示例

import requests

url = "https://pan.baidu.com/rest/2.0/xpan/imageproc?method=gettags&key=tag&type=1&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328"

payload = {} headers = { 'User-Agent': 'pan.baidu.com' }

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

响应示例

{
    "errno": 0,
    "request_id": 1763956883,
    "list": [ 
        {
            "cover_fid": "618638941422741",
            "type": 1,
            "tag_id": 2,
            "ctime": 1545219539,
            "mtime": 1576120955,
            "status": 0,
            "count": 11,
            "tag_name": "装修",
            "is_show": 1,
            "is_search": 1
        },
        {
            "cover_fid": "0",
            "type": 1,
            "tag_id": 506,
            "ctime": 1535328845,
            "mtime": 1592202928,
            "status": 0,
            "count": 548,
            "tag_name": "天空",
            "is_show": 1,
            "is_search": 1
        }
    ]
}

错误码说明

更多错误码请参考: https://www.xnip.cn/shouce/629/47126.html

根据关键字检索图片

接口概述

接口功能

本文档主要针对需要集成http api的技术工程师。 如果您的应用已经获取用户授权,则可以通过该接口根据关键字(gettags接口获取的tag_id或汉字)检索图片,获取相应的图片信息。

使用条件

频控限制:有
接口鉴权:有
接入流程:https://www.xnip.cn/shouce/629/47115.html

依赖说明

access_token: 作为访问用户数据的授权凭证

参数说明

请求方式

GET

接口地址

https://pan.baidu.com/rest/2.0/xpan/imageproc?method=search

请求参数

名称类型必须示例参数位置描述
access_tokenstring12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328query接口鉴权参数
search_typeint1query1为按tag_id检索,2为按汉字检索
keywordstring%E9%A3%8E%E6%99%AFquery检索关键字,汉字需要urlencode
startint0query查询起点
limitint100query查询数目
formatint0query是否格式化
sizestringc200_u200query自定义缩略图大小,最多三个,例:sizes=c200_u200,c300_u300,c400_u400,如果没有默认按照c200_u200返回缩略图

响应参数

参数类型描述
has_morebooltrue:表示还有数据
list[0] ["category"]int文件类型, 3为图片
list[0] ["fs_id"]string文件在网盘中的临时唯一标识id
list[0] ["parent_path"]string文件所在目录
list[0] ["date_taken"]string拍摄时间戳
list[0] ["year"]string拍摄年份
list[0] ["month"]string拍摄月份
list[0] ["day"]string拍摄日期
list[0] ["path"]string文件路径
list[0] ["md5"]string文件MD5
list[0] ["size"]int文件大小
list[0] ["server_ctime"]int文件创建时间
list[0] ["server_mtime"]int文件修改时间
list[0] ["isdelete"]int0 文件存在,1 文件被删除
list[0] ["server_filename"]string文件名称
list[0] ["resolution"]string文件分辨率信息
list[0] ["orientation"]string图片方向
list[0] ["thumb"]string图片缩略图地址

示例说明

假设示例请求数据如下。

参数参数数据描述
access_token12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328接口鉴权参数
search_type1按照tag_id检索
keyword506gettags接口获取的tagid
start0查询起点
limit2查询数目
sizec200_u200,c300_u300,c400_u400需要的缩略图大小

curl示例

curl -L -X GET 'https://pan.baidu.com/rest/2.0/xpan/imageproc?method=search&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&search_type=1&keyword=506&start=0&limit=2&size=c200_u200,c300_u300,c400_u400&format=1' \
-H 'User-Agent: pan.baidu.com' 

Python示例

import requests

url = "https://pan.baidu.com/rest/2.0/xpan/imageproc?method=search&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&search_type=1&keyword=506&start=0&limit=2&size=c200_u200,c300_u300,c400_u400&format=1"

payload = {} headers = { 'User-Agent': 'pan.baidu.com', 'Cookie': 'BAIDUID=05D3EADCDBF0CDD529C84D4864E28F49:FG=1' }

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

响应示例

{
    "errno": 0,
    "request_id": 2018098118,
    "has_more": true,
    "list": [
        {
            "category": 3,
            "fs_id": "127673828813781",
            "parent_path": "568:/来自:EML-AL00/DCIM/Camera/IMG_20200531_145102.jpg",
            "date_taken": "1590907862",
            "year": "2020",
            "month": "05",
            "day": "31",
            "path": "/来自:EML-AL00/DCIM/Camera/IMG_20200531_145102.jpg",
            "md5": "39228b3c7j43982ca14b3b8e7ef3fb11",
            "size": 2563620,
            "server_ctime": 1590934498,
            "server_mtime": 1590934498,
            "isdelete": 0,
            "server_filename": "IMG_20200531_145102.jpg",
            "orientation": "UndefinedOrientation",
            "resolution": "width:3968,height:2976",
            "thumb": "https://thumbnail4.baidupcs.com/thumbnail/39228b3c7j43982ca14b3b8e7ef3fb11?fid=2082810368-250528-127673828813781&time=1597316400&rt=yt&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-%2FKOAFwH3VsnQ4b9wGADGb6lfnLc%3D&expires=24h&chkv=0&chkbd=0&chkpc=&dp-logid=2018098118&dp-callid=0&size=c200_u200&quality=90&vuk=-&ft=video"
        },
        {
            "category": 3,
            "fs_id": "814314996778198",
            "parent_path": "568:/来自:EML-AL00/DCIM/Camera/IMG_20200531_145018.jpg",
            "date_taken": "1590907819",
            "year": "2020",
            "month": "05",
            "day": "31",
            "path": "/来自:EML-AL00/DCIM/Camera/IMG_20200531_145018.jpg",
            "md5": "2c3318b1ap9a01dae4f5374ff413cb13",
            "size": 3564147,
            "server_ctime": 1590934506,
            "server_mtime": 1590934506,
            "isdelete": 0,
            "server_filename": "IMG_20200531_145018.jpg",
            "orientation": "UndefinedOrientation",
            "resolution": "width:3968,height:2976",
            "thumb": "https://thumbnail5.baidupcs.com/thumbnail/2c3318b1ap9a01dae4f5374ff413cb13?fid=2082810368-250528-814314996778198&time=1597316400&rt=yt&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-ARRAx2SVQ5XNfSFy9Xn0t7k94eM%3D&expires=24h&chkv=0&chkbd=0&chkpc=&dp-logid=2018098118&dp-callid=0&size=c200_u200&quality=90&vuk=-&ft=video"
        }
    ]
}

错误码说明

更多错误码请参考: https://www.xnip.cn/shouce/629/47126.html

获取待添加的图片列表

接口概述

接口功能

本文档主要针对需要集成http api的技术工程师。此接口主要用于为智能设备提供相册服务, 如果您的应用已经获取用户授权, 且设备已完成和用户网盘账号的绑定,则可通过此接口获取网盘中待添加至设备上的图片列表。

使用条件

频控限制:有
接口鉴权:有
接入流程:https://www.xnip.cn/shouce/629/47115.html

依赖说明

access_token: 作为访问用户数据的授权凭证
device_id: 设备注册、设备绑定, 参考设备管理接口文档https://www.xnip.cn/shouce/629/47115.html

其他说明

  1. 返回的图片按照拍摄时间倒序排列

参数说明

请求方式

GET

接口地址

https://pan.baidu.com/rest/2.0/xpan/multimedia?method=selectlist

请求参数

名称类型必须示例参数位置描述
access_tokenstring12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328query接口鉴权参数
device_idstring91119331626125597vquery设备id,参考设备管理文档进行注册和绑定后获得
ct_iduint643query相册标识,固定传3
categoryint3query文件类型,传3表示图片
startint0query查询起点,默认0
limitint100query查询数目,默认100,最大100

响应参数

参数类型描述
has_moreint1:表示还有数据, 0:表示没有数据
cursorint下一次查询的起点
file_countint相册中当前的文件数
list[0] ["category"]int文件类型, 3为图片
list[0] ["marked"]int该图片是否在集合中,0 表示不在,1表示在
list[0] ["fs_id"]string文件在网盘中的临时唯一标识id
list[0] ["parent_path"]string文件所在目录
list[0] ["date_taken"]string拍摄时间戳
list[0] ["year"]string拍摄年份
list[0] ["month"]string拍摄月份
list[0] ["day"]string拍摄日期
list[0] ["path"]string文件路径
list[0] ["md5"]string文件MD5
list[0] ["size"]int文件大小
list[0] ["server_ctime"]int文件创建时间
list[0] ["server_mtime"]int文件修改时间
list[0] ["isdelete"]int0 文件存在,1 文件被删除
list[0] ["server_filename"]string文件名称
list[0] ["resolution"]string文件分辨率信息
list[0] ["orientation"]string图片方向
list[0] ["thumb"]string图片缩略图地址

示例说明

假设示例请求数据如下。

参数参数数据描述
access_token12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328接口鉴权参数
device_id1451387236s4819r7s设备id
category3筛选图片类型的文件
ct_id3相册id,固定传3
start0查询起点
limit3查询数目

curl示例

curl -L -X GET 'https://pan.baidu.com/rest/2.0/xpan/multimedia?method=selectlist&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&ct_id=3&category=3&start=0&limit=3' \
-H 'User-Agent: pan.baidu.com' 

Python示例

import requests

url = "https://pan.baidu.com/rest/2.0/xpan/multimedia?method=selectlist&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&ct_id=3&category=3&start=0&limit=3"

payload = {} headers = { 'User-Agent': 'pan.baidu.com' }

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

响应示例

{
    "cursor": 3,
    "errmsg": "succ",
    "errno": 0,
    "file_count": 0,
    "has_more": 1,
    "list": [
        {
            "category": 3,
            "date_taken": 1592882779,
            "day": "23",
            "fs_id": 663796967169505,
            "height": 2104,
            "isdelete": 0,
            "marked": 0,
            "md5": "d339fea44vfcc3da0281ee15378377a7",
            "month": "06",
            "parent_path": "568:/test.jpg",
            "path": "/test.jpg",
            "resolution": "width:1560,height:2104",
            "server_ctime": 1593315085,
            "server_filename": "1592882780362.jpg",
            "server_mtime": 1593315085,
            "size": 1110857,
            "thumb": "http://thumbnail5.baidupcs.com/thumbnail/d339fea44vfcc3da0281ee15378377a7?fid=2082810368-250528-663796967169505&time=1597381200&rt=yt&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-HwuK8ykfgXchgfJQI%2Ftf5SW6%2Fts%3D&expires=24h&chkv=0&chkbd=0&chkpc=&dp-logid=10409995&dp-callid=0&size=c200_u200&quality=91&vuk=-&ft=video",
            "width": 1560,
            "year": "2020"
        },
        {
            "category": 3,
            "date_taken": 1591934886,
            "day": "12",
            "fs_id": 452773646181457,
            "height": 2448,
            "isdelete": 0,
            "marked": 0,
            "md5": "6ccb95f20sf53815a226a9762aec8917",
            "month": "06",
            "parent_path": "568:/来自:EML-AL00/DCIM/Camera/2020-06-12-12-08-06-587.jpg",
            "path": "/来自:EML-AL00/DCIM/Camera/2020-06-12-12-08-06-587.jpg",
            "resolution": "width:3264,height:2448",
            "server_ctime": 1591940960,
            "server_filename": "2020-06-12-12-08-06-587.jpg",
            "server_mtime": 1591940960,
            "size": 1607175,
            "thumb": "http://thumbnail6.baidupcs.com/thumbnail/6ccb95f20sf53815a226a9762aec8917?fid=2082810368-250528-452773646181457&time=1597381200&rt=yt&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-Guq3dYiLHy2Bvs3m5MJoaplelHU%3D&expires=24h&chkv=0&chkbd=0&chkpc=&dp-logid=10409995&dp-callid=0&size=c200_u200&quality=91&vuk=-&ft=video",
            "width": 3264,
            "year": "2020"
        },
        {
            "category": 3,
            "date_taken": 1591934851,
            "day": "12",
            "fs_id": 1008989899780891,
            "height": 3968,
            "isdelete": 0,
            "marked": 0,
            "md5": "6d7bda2a2q78f81170716fc0044a29a7",
            "month": "06",
            "parent_path": "568:/来自:EML-AL00/DCIM/Camera/IMG_20200612_120731.jpg",
            "path": "/来自:EML-AL00/DCIM/Camera/IMG_20200612_120731.jpg",
            "resolution": "width:2976,height:3968",
            "server_ctime": 1591940973,
            "server_filename": "IMG_20200612_120731.jpg",
            "server_mtime": 1591940973,
            "size": 3807930,
            "thumb": "http://thumbnail3.baidupcs.com/thumbnail/6d7bda2a2q78f81170716fc0044a29a7?fid=2082810368-250528-1008989899780891&time=1597381200&rt=yt&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-Bs9ilAsdJi%2Fb7hKXrRT1ZfFxs1A%3D&expires=24h&chkv=0&chkbd=0&chkpc=&dp-logid=10409995&dp-callid=0&size=c200_u200&quality=91&vuk=-&ft=video",
            "width": 2976,
            "year": "2020"
        }
    ],
    "request_id": "11108365889012021"
}

错误码说明

错误码描述
42211获取图片分辨率失败

更多错误码请参考: https://www.xnip.cn/shouce/629/47126.html

添加文件到相册中

接口概述

接口功能

本文档主要针对需要集成http api的技术工程师。此接口主要用于为智能设备提供相册服务, 如果您的应用已经获取用户授权, 且设备已完成和用户网盘账号的绑定,则可通过此接口添加图片到设备的相册中。

使用条件

频控限制:有
接口鉴权:有
接入流程:https://www.xnip.cn/shouce/629/47115.html

依赖说明

access_token: 作为访问用户数据的授权凭证

device_id: 设备注册、设备绑定, 参考设备管理接口文档https://www.xnip.cn/shouce/629/47115.html

其他说明

1.相册容量上限:10000张图片

参数说明

请求方式

POST

接口地址

https://pan.baidu.com/rest/2.0/xpan/multimedia?method=additem

请求参数

query参数

名称类型必须示例参数位置描述
access_tokenstring12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328query接口鉴权参数
device_idstring1451387236s4819r7squery设备id,参考设备管理文档,注册和绑定后获得
categoryint3query文件类型,图片传3

body参数

名称类型必须示例参数位置描述
ct_iduint643body相册标识,固定传3
fs_idjson array[414244021542671]body文件fsid数组,上限100

响应参数

参数类型描述
succ_countint添加成功的文件个数

示例说明

假设示例请求数据如下。

query参数

参数参数数据描述
access_token12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328接口鉴权参数
device_id1451387236s4819r7s设备id
category3文件类型,图片传3

body参数

参数参数数据描述
ct_id3相册标识,固定传3
fs_id[663796967169505,452773646181457]文件fsid数组

curl示例

curl -L -X GET 'https://pan.baidu.com/rest/2.0/xpan/multimedia?method=additem&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&category=3&fs_id' \
-H 'User-Agent: pan.baidu.com' \
-F 'ct_id=3' \
-F 'fs_id=[663796967169505,452773646181457]'

Python示例

import requests

url = "https://pan.baidu.com/rest/2.0/xpan/multimedia?method=additem&access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&category=3"

payload = {'ct_id': '3', 'fs_id': '[663796967169505,452773646181457]'} files = [

] headers = { 'User-Agent': 'pan.baidu.com' }

response = requests.request("GET", url, headers=headers, data = payload, files = files)

print(response.text.encode('utf8'))

响应示例

{
    "errmsg": "succ",
    "errno": 0,
    "request_id": "222483670756630758",
    "succ_count": 2
}

错误码说明

错误码描述
42202文件个数超过相册容量上限
42203相册不存在
42210部分文件添加失败
42211获取图片分辨率失败
42214获取文件详情失败

更多错误码请参考: https://www.xnip.cn/shouce/629/47126.html

获取相册中文件的fsid

接口概述

接口功能

本文档主要针对需要集成http api的技术工程师。此接口主要用于为智能设备提供相册服务, 如果您的应用已经获取用户授权, 且设备已完成和用户网盘账号的绑定,则可通过此接口获取设备上相册中的文件id。

使用条件

频控限制:有
接口鉴权:有
接入流程:https://www.xnip.cn/shouce/629/47115.html

依赖说明

access_token: 作为访问用户数据的授权凭证

device_id: 设备注册、设备绑定, 参考设备管理接口文档https://www.xnip.cn/shouce/629/47115.html

参数说明

请求方式

GET

接口地址

https://pan.baidu.com/rest/2.0/xpan/multimedia?method=filterlist

请求参数

名称类型必须示例参数位置描述
access_tokenstring12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328query接口鉴权参数
device_idstring1451387236s4819r7squery设备id,参考设备管理文档,注册和绑定后获得
categoryint3query文件类型,图片传3
ct_iduint643query相册标识,固定传3

响应参数

参数类型描述
listjson array设备相册中的fsid数组

示例说明

假设示例请求数据如下。

参数参数数据描述
access_token12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328接口鉴权参数
device_id1451387236s4819r7s设备id
ct_id3相册标示,固定传3
category3文件类型,图片传3

curl示例

curl -L -X GET 'https://pan.baidu.com/rest/2.0/xpan/multimedia?access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&ct_id=3&category=3&method=filterlist' \
-H 'User-Agent: pan.baidu.com' \

Python示例

import requests

url = "https://pan.baidu.com/rest/2.0/xpan/multimedia?access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&ct_id=3&category=3&method=filterlist"

payload = {} files = {} headers = { 'User-Agent': 'pan.baidu.com' }

response = requests.request("GET", url, headers=headers, data = payload, files = files)

print(response.text.encode('utf8'))

响应示例

{
    "errmsg": "succ",
    "errno": 0,
    "list": [
        276767910917285,
        452773646181457,
        663796967169505
    ],
    "request_id": "396923207405781539"
}

错误码说明

更多错误码请参考: https://www.xnip.cn/shouce/629/47126.html

获取相册中的文件列表

接口概述

接口功能

本文档主要针对需要集成http api的技术工程师。此接口主要用于为智能设备提供相册服务, 如果您的应用已经获取用户授权, 且设备已完成和用户网盘账号的绑定,则可通过此接口获取通过上述additem接口添加到设备相册中的图片列表。

使用条件

频控限制:有
接口鉴权:有
接入流程:https://www.xnip.cn/shouce/629/47115.html

依赖说明

access_token: 作为访问用户数据的授权凭证

device_id: 设备注册、设备绑定, 参考设备管理接口文档https://www.xnip.cn/shouce/629/47115.html

其他说明

1.返回的图片按拍摄时间倒序排列。

参数说明

请求方式

GET

接口地址

 https://pan.baidu.com/rest/2.0/xpan/multimedia?method=itemlist

请求参数

名称类型必须示例参数位置描述
access_tokenstring12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328query接口鉴权参数
device_idstring----query设备id,参考设备管理文档,注册和绑定后获得
categoryint3queyr文件类型,图片传3
ct_iduint643query相册标识,固定传3
startint0query查询起点,默认为0
limitint100query查询数目,最大100,默认100
thumbnailstringoffquery是否需要图片缩略图地址,on 需要,off 不需要,默认off

响应参数

参数类型描述
has_moreint1:表示还有数据, 0:表示没有数据
list[0] ["category"]int文件类型, 3为图片
list[0] ["fs_id"]string文件在网盘中的临时唯一标识id
list[0] ["parent_path"]string文件所在目录
list[0] ["date_taken"]string拍摄时间戳
list[0] ["year"]string拍摄年份
list[0] ["month"]string拍摄月份
list[0] ["day"]string拍摄日期
list[0] ["path"]string文件路径
list[0] ["md5"]string文件MD5
list[0] ["size"]int文件大小
list[0] ["server_ctime"]int文件创建时间
list[0] ["server_mtime"]int文件修改时间
list[0] ["isdelete"]int0 文件存在,1 文件被删除
list[0] ["server_filename"]string文件名称
list[0] ["resolution"]string文件分辨率信息
list[0] ["orientation"]string图片方向
list[0] ["thumb"]string图片缩略图地址

示例说明

假设示例请求数据如下。

参数参数数据描述
access_token12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328接口鉴权参数
device_id1451387236s4819r7s设备id
ct_id3相册标识,固定传3
category3文件类型,图片传3
limit2查询数目
thumbnailon需要缩略图

curl示例

curl -L -X GET 'https://pan.baidu.com/rest/2.0/xpan/multimedia?access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&ct_id=3&category=3&thumbnail=on&limit=2&method=itemlist' \
-H 'User-Agent: pan.baidu.com'

Python示例

import requests

url = "https://pan.baidu.com/rest/2.0/xpan/multimedia?access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&ct_id=3&category=3&thumbnail=on&limit=2&method=itemlist"

payload = {} files = {} headers = { 'User-Agent': 'pan.baidu.com' }

response = requests.request("GET", url, headers=headers, data = payload, files = files)

print(response.text.encode('utf8'))

响应示例

{
    "errmsg": "succ",
    "errno": 0,
    "has_more": 1,
    "list": [
        {
            "category": 3,
            "date_taken": 1592882779,
            "day": "23",
            "fs_id": 663796967169505,
            "height": 2104,
            "isdelete": 0,
            "md5": "d339fea44vfcc3da0281ee15378377a7",
            "month": "06",
            "parent_path": "56500:/test.jpg",
            "path": "/test.jpg",
            "resolution": "width:1560,height:2104",
            "server_ctime": 1593315085,
            "server_filename": "1592882780362.jpg",
            "server_mtime": 1593315085,
            "size": 1110857,
            "thumbs": {
                "icon": "https://thumbnail0.baidupcs.com/thumbnail/d339fea44vfcc3da0281ee15378377a7?fid=2082810368-250528-663796967169505&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-NuL2q8k6CCwk%2BhB5b551%2Fnu2M8Q%3D&expires=8h&chkbd=0&chkv=0&dp-logid=502701231288025249&dp-callid=0&time=1597388400&size=c60_u60&quality=100&vuk=2082810368&ft=image",
                "url1": "https://thumbnail0.baidupcs.com/thumbnail/d339fea44vfcc3da0281ee15378377a7?fid=2082810368-250528-663796967169505&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-NuL2q8k6CCwk%2BhB5b551%2Fnu2M8Q%3D&expires=8h&chkbd=0&chkv=0&dp-logid=502701231288025249&dp-callid=0&time=1597388400&size=c140_u90&quality=100&vuk=2082810368&ft=image",
                "url2": "https://thumbnail0.baidupcs.com/thumbnail/d339fea44vfcc3da0281ee15378377a7?fid=2082810368-250528-663796967169505&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-NuL2q8k6CCwk%2BhB5b551%2Fnu2M8Q%3D&expires=8h&chkbd=0&chkv=0&dp-logid=502701231288025249&dp-callid=0&time=1597388400&size=c360_u270&quality=100&vuk=2082810368&ft=image",
                "url3": "https://thumbnail0.baidupcs.com/thumbnail/d339fea44vfcc3da0281ee15378377a7?fid=2082810368-250528-663796967169505&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-NuL2q8k6CCwk%2BhB5b551%2Fnu2M8Q%3D&expires=8h&chkbd=0&chkv=0&dp-logid=502701231288025249&dp-callid=0&time=1597388400&size=c850_u580&quality=100&vuk=2082810368&ft=image"
            },
            "width": 1560,
            "year": "2020"
        },
        {
            "category": 3,
            "date_taken": 1591934886,
            "day": "12",
            "fs_id": 452773646181457,
            "height": 2448,
            "isdelete": 0,
            "md5": "6ccb95f20sf53815a226a9762aec8917",
            "month": "06",
            "parent_path": "568200:/来自:EML-AL00/DCIM/Camera/2020-06-12-12-08-06-587.jpg",
            "path": "/来自:EML-AL00/DCIM/Camera/2020-06-12-12-08-06-587.jpg",
            "resolution": "width:3264,height:2448",
            "server_ctime": 1591940960,
            "server_filename": "2020-06-12-12-08-06-587.jpg",
            "server_mtime": 1591940960,
            "size": 1607175,
            "thumbs": {
                "icon": "https://thumbnail0.baidupcs.com/thumbnail/6ccb95f20sf53815a226a9762aec8917?fid=2082810368-250528-452773646181457&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iIe57%2F9CGg7s0gNH%2ByPjyKeoKAM%3D&expires=8h&chkbd=0&chkv=0&dp-logid=502701275693398056&dp-callid=0&time=1597388400&size=c60_u60&quality=100&vuk=2082810368&ft=image",
                "url1": "https://thumbnail0.baidupcs.com/thumbnail/6ccb95f20sf53815a226a9762aec8917?fid=2082810368-250528-452773646181457&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iIe57%2F9CGg7s0gNH%2ByPjyKeoKAM%3D&expires=8h&chkbd=0&chkv=0&dp-logid=502701275693398056&dp-callid=0&time=1597388400&size=c140_u90&quality=100&vuk=2082810368&ft=image",
                "url2": "https://thumbnail0.baidupcs.com/thumbnail/6ccb95f20sf53815a226a9762aec8917?fid=2082810368-250528-452773646181457&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iIe57%2F9CGg7s0gNH%2ByPjyKeoKAM%3D&expires=8h&chkbd=0&chkv=0&dp-logid=502701275693398056&dp-callid=0&time=1597388400&size=c360_u270&quality=100&vuk=2082810368&ft=image",
                "url3": "https://thumbnail0.baidupcs.com/thumbnail/6ccb95f20sf53815a226a9762aec8917?fid=2082810368-250528-452773646181457&rt=pr&sign=FDTAER-DCb740ccc5511e5e8fedcff06b081203-iIe57%2F9CGg7s0gNH%2ByPjyKeoKAM%3D&expires=8h&chkbd=0&chkv=0&dp-logid=502701275693398056&dp-callid=0&time=1597388400&size=c850_u580&quality=100&vuk=2082810368&ft=image"
            },
            "width": 3264,
            "year": "2020"
        }
    ],
    "request_id": "502009287262772795"
}

错误码说明

更多错误码请参考: https://www.xnip.cn/shouce/629/47126.html

删除相册中的图片

接口概述

接口功能

本文档主要针对需要集成http api的技术工程师。此接口主要用于为智能设备提供相册服务, 如果您的应用已经获取用户授权, 且设备已完成和用户网盘账号的绑定,则可通过此接口删除通过上述additem接口添加到设备相册中的图片。

使用条件

频控限制:有
接口鉴权:有
接入流程:https://www.xnip.cn/shouce/629/47115.html

依赖说明

access_token: 作为访问用户数据的授权凭证

device_id: 设备注册、设备绑定, 参考设备管理接口文档https://www.xnip.cn/shouce/629/47115.html

参数说明

请求方式

POST

接口地址

https://pan.baidu.com/rest/2.0/xpan/multimedia?method=delitem

请求参数

query参数

名称类型必须示例参数位置描述
access_tokenstring12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328query接口鉴权参数
device_idstring1451387236s4819r7squery设备id,参考设备管理文档,注册和绑定后获得
categoryint3query文件类型,图片传3

body参数

名称类型必须示例参数位置描述
ct_iduint643body相册标识,固定传3
fs_idjson array[414244021542671]body文件fsid数组,上限100

响应参数

参数类型描述
errnoint错误码。0为返回正常

示例说明

假设示例请求数据如下。

query参数

参数参数数据描述
access_token12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328接口鉴权参数
device_id1451387236s4819r7s设备id
category3文件类型,图片传3

body参数

参数参数数据描述
ct_id3相册标识,固定传3
fs_id[663796967169505]文件fsid数组

curl示例

curl -L -X POST 'https://pan.baidu.com/rest/2.0/xpan/multimedia?access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&category=3&method=delitem' \
-H 'User-Agent: pan.baidu.com' \
-F 'ct_id=3' \
-F 'fs_id=[663796967169505]'

Python示例

import requests

url = "https://pan.baidu.com/rest/2.0/xpan/multimedia?access_token=12.a6b7dbd428f731035f771b8d15063f61.86400.1292922000-2346678-124328&device_id=1451387236s4819r7s&category=3&method=delitem"

payload = {'ct_id': '3', 'fs_id': '[663796967169505]'} files = [

] headers = { 'User-Agent': 'pan.baidu.com' }

response = requests.request("POST", url, headers=headers, data = payload, files = files)

print(response.text.encode('utf8'))

响应示例

{
    "errmsg": "succ",
    "errno": 0,
    "request_id": "620837041105438175"
}

错误码说明

更多错误码请参考: https://www.xnip.cn/shouce/629/47126.html