豆瓣的api文档挂了,但是API还能用,在 Github 上找到了别人之前保存的 ,附上链接, 转载以保存备用,谢谢大神的分享
出现 msg: "invalid_apikey" 情况
参考链接CSDN:豆瓣api报错:invalid_apikey
豆瓣API有变化,在请求API的url后面跟一个apikey参数:
类似这个样子:
https://api.douban.com/v2/book/isbn/9787010009230?apikey=0df993c66c0c636e29ecbb5344252a4a
搜索书籍
简要描述
拉取图书列表和搜索图书列表接口
请求描述
https://api.douban.com/v2/book/search
参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
q | 是 | string | 查询关键词 |
start | 否 | number | 从第几条开始 |
count | 否 | number | 一页条数 |
请求示例
https://api.douban.com/v2/book/search?q=我是传奇&start=1
返回示例
{
"count": 10,
"start": 1,
"total": 11,
"books": [{
"rating": {
"max": 10,
"numRaters": 33,
"average": "7.6",
"min": 0
},
"subtitle": "",
"author": ["[美] 理查德·马特森"],
"pubdate": "2013-5",
"tags": [],
"origin_title": "I Am Legend",
"image": "<https://img3.doubanio.com/view/subject/m/public/s26811480.jpg>",
"binding": "平装",
"translator": ["陈宗琛"],
"catalog": "我是传奇\n埋没的天才\n死亡时间\n猎物\n魔女之战\n死亡之舞\n白丝衣\n疯狂之屋\n葬礼\n黯影\n移魂\n导读跨界编剧与作家的传奇人物——理查德·马特森与《我是传奇》 林翰昌",
"pages": "425",
"images": {
"small": "<https://img3.doubanio.com/view/subject/s/public/s26811480.jpg>",
"large": "<https://img3.doubanio.com/view/subject/l/public/s26811480.jpg>",
"medium": "<https://img3.doubanio.com/view/subject/m/public/s26811480.jpg>"
},
"alt": "<https://book.douban.com/subject/24700313/>",
"id": "24700313",
"publisher": "上海译文出版社",
"isbn10": "7532761274",
"isbn13": "9787532761272",
"title": "我是传奇",
"url": "<https://api.douban.com/v2/book/24700313>",
"alt_title": "I Am Legend",
"author_intro": "理查德·马特森(Richard Matheson),1926年出生于美国新泽西,1951年移居加州工作至今。 理查德·马特森是《纽约时报》畅销书作家,在通俗文学领域,他的作品影响了当代的许多知名作家。曾创作经典科幻小说《华氏451》的布拉德伯里,就尊他为20世纪最重要的作家;而恐怖大师斯蒂芬·金更是公开表示:“一般人们谈论恐怖小说,酋先会提到我的名字;但是,如果没仃理查德·马特森,就根本不会有我这号人。他是我的父亲,这就像贝茜·史密斯是猫王的母亲。”理查德·马特森的作品跨越恐怖、科幻、悬疑和奇幻等多个领域,同时,在影观剧写作方面也缔造了许多传奇如大导演斯皮尔伯格的处女作《飞车杀机》上世纪80年代风靡全球的《时光倒流七十年》,以及热播四十载、被欧荚科幻影迷奉为圣经的《星际迷航》,而其代表作《我是传奇》,更是连续三次被好莱坞搬上大银幕。在横跨50年的文坛生涯中,理查德·马特森获奖无数,其中包括世界奇幻文学协会颁发的终身成就奖、恐怖小说家协会颁发的布莱埘‘斯托克终身成就奖、爱伦·坡奖、雨果奖、鹅毛笔奖、美国编剧工会奖……",
"summary": "“它们”很奇怪,一到白天就躲着不敢出来,它们怕大蒜,它们会被尖木棍杀死,它们怕十字架是出了名的。而且,它们无法抵御吸食人血的渴望。\n\n\n\n白天,他在死寂的城市中寻找食物、供给和幸存者。天一黑,他就把自己反锁家中。\n\n\n\n“滚出来吧,内维尔!”此刻,它们正在屋外穿梭徘徊,窃窃私语。它们在等待·····",
"price": "37.00元"
}]
}
返回参数说明
名称 | 说明 |
---|---|
count | 一页条数 |
start | 起始位置 |
total | 总条数 |
books(book 数组) | 书籍信息 |
book.rating | 书籍评价 |
book.author | 作者 |
book.subtitle | 副标题 |
book.pubdate | 发行时间 |
book.catalog | 目录 |
book.pages | 页数 |
book.images | 封面 |
book.title | 书名 |
book.url | 详情链接 |
book.author_intro | 作者简介 |
book.summary | 内容简介 |
book.price | 价钱 |
搜索电影
简要描述
搜索电影
请求描述
https://api.douban.com/v2/movie/search
参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
q | 是 | string | 查询关键词 |
start | 否 | number | 从第几条开始 |
count | 否 | number | 一页条数 |
请求示例
https://api.douban.com/v2/movie/search?q=后天
返回示例
{
"count": 20,
"start": 0,
"total": 8,
"subjects": [{
"rating": {
"max": 10,
"average": 8.1,
"stars": "40",
"min": 0
},
"genres": [
"动作",
"科幻",
"冒险"
],
"title": "后天",
"casts": [{
"alt": "https://movie.douban.com/celebrity/1002679/",
"avatars": {
"small": "https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p52.webp",
"large": "https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p52.webp",
"medium": "https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p52.webp"
},
"name": "丹尼斯·奎德",
"id": "1002679"
},
{
"alt": "https://movie.douban.com/celebrity/1048002/",
"avatars": {
"small": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p12737.webp",
"large": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p12737.webp",
"medium": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p12737.webp"
},
"name": "杰克·吉伦哈尔",
"id": "1048002"
},
{
"alt": "https://movie.douban.com/celebrity/1021998/",
"avatars": {
"small": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p629.webp",
"large": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p629.webp",
"medium": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p629.webp"
},
"name": "埃米·罗森",
"id": "1021998"
}
],
"collect_count": 326849,
"original_title": "The Day After Tomorrow",
"subtype": "movie",
"directors": [],
"year": "2004",
"images": {},
"alt": "https://movie.douban.com/subject/1308779/",
"id": "1308779"
}]
}
返回参数说明
名称 | 说明 |
---|---|
count | 一页条数 |
start | 起始位置 |
total | 总条数 |
subjects(subject 数组) | 电影信息 |
subject.rating | 评价 |
subject.genres | 流派 |
subject.title | 标题 |
subject.casts | 演员阵容 |
subject.directors | 导演 |
subject.year | 发行年份 |
subject.images | 封面 |
搜索音乐
简要描述
拉取音乐列表和搜索音乐列表接口
请求描述
https://api.douban.com/v2/music/search
参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
q | 是 | string | 查询关键词 |
start | 否 | number | 从第几条开始 |
count | 否 | number | 一页条数 |
请求示例
https://api.douban.com/v2/music/search?q=因你而在&start=1
返回示例
{
"count": 4,
"start": 0,
"total": 4,
"musics": [{
"rating": {
"max": 10,
"average": "7.5",
"numRaters": 289,
"min": 0
},
"author": [{
"name": "林俊傑"
}],
"alt_title": "Stories Untold",
"image": "https://img1.doubanio.com/view/subject/s/public/s25814087.jpg",
"tags": [],
"mobile_link": "https://m.douban.com/music/subject/21967671/",
"attrs": {},
"title": "因你 而在 (正式版)",
"alt": "https://music.douban.com/subject/21967671/",
"id": "21967671"
}]
}
返回参数说明
名称 | 说明 |
---|---|
count | 一页条数 |
start | 起始位置 |
total | 总条数 |
musics(music 数组) | 音乐信息 |
music.rating | 书籍评价 |
music.author | 作者 |
music.image | 封面 |
music.title | 歌名 |
music.mobile_link | 歌曲链接 |
电影TOP250
简要描述
搜索电影
请求描述
https://api.douban.com/v2/movie/top250
请求示例
https://api.douban.com/v2/movie/top250
返回示例
{
"count": 20,
"start": 0,
"total": 8,
"subjects": [{
"rating": {
"max": 10,
"average": 8.1,
"stars": "40",
"min": 0
},
"genres": [
"动作",
"科幻",
"冒险"
],
"title": "后天",
"casts": [{
"alt": "https://movie.douban.com/celebrity/1002679/",
"avatars": {
"small": "https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p52.webp",
"large": "https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p52.webp",
"medium": "https://img3.doubanio.com/view/celebrity/s_ratio_celebrity/public/p52.webp"
},
"name": "丹尼斯·奎德",
"id": "1002679"
},
{
"alt": "https://movie.douban.com/celebrity/1048002/",
"avatars": {
"small": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p12737.webp",
"large": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p12737.webp",
"medium": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p12737.webp"
},
"name": "杰克·吉伦哈尔",
"id": "1048002"
},
{
"alt": "https://movie.douban.com/celebrity/1021998/",
"avatars": {
"small": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p629.webp",
"large": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p629.webp",
"medium": "https://img1.doubanio.com/view/celebrity/s_ratio_celebrity/public/p629.webp"
},
"name": "埃米·罗森",
"id": "1021998"
}
],
"collect_count": 326849,
"original_title": "The Day After Tomorrow",
"subtype": "movie",
"directors": [],
"year": "2004",
"images": {},
"alt": "https://movie.douban.com/subject/1308779/",
"id": "1308779"
}]
}
返回参数说明
名称 | 说明 |
---|---|
count | 一页条数 |
start | 起始位置 |
total | 总条数 |
subjects(subject 数组) | 电影信息 |
subject.rating | 评价 |
subject.genres | 流派 |
subject.title | 标题 |
subject.casts | 演员阵容 |
subject.directors | 导演 |
subject.year | 发行年份 |
subject.images | 封面 |