豆瓣电影API

豆瓣电影中,有几个接口,我用来写小案例能用,有学习需要可以试试。我写的小案例项目地址

获取标签

请求方法:GET

请求URL:https://movie.douban.com/j/search_tags

请求参数:

参数名类型必要缺省说明
typestringmovie电影/电视剧/(不明)
source不明index不明

请求示例:

GET https://movie.douban.com/j/search_tags
GET https://movie.douban.com/j/search_tags?type=tv
{
	"tags": ["热门", "美剧", "英剧", "韩剧", "日剧", "国产剧", "港剧", "日本动画", "综艺", "纪录片"]
}

获取电影

请求方法:GET

请求URL:https://movie.douban.com/j/subject_suggest

请求参数:

参数名类型必要缺省说明
typestringmovie电影/电视剧/(不明)
tagstring标签
page_limitnumber20返回的电影条目数量
page_startnumber0返回电影条目的开始位置

请求示例:

GET https://movie.douban.com/j/search_subjects?tag=热门
{
	"subjects": [{
		"rate": "8.5",
		"cover_x": 3158,
		"title": "1917",
		"url": "https://movie.douban.com/subject/30252495/",
		"playable": false,
		"cover": "https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2570243317.webp",
		"id": "30252495",
		"cover_y": 5000,
		"is_new": false
	}]
}
https://movie.douban.com/j/search_subjects?type=tv&tag=热门
{
	"subjects": [{
		"rate": "9.2",
		"cover_x": 2953,
		"title": "想见你",
		"url": "https://movie.douban.com/subject/30468961/",
		"playable": true,
		"cover": "https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2576977981.webp",
		"id": "30468961",
		"cover_y": 4134,
		"is_new": false
	}]
}

标签不需要按照获取的来,直接传想搜的电影也OK

GET https://movie.douban.com/j/search_subjects?tag=当幸福来敲门
GET https://movie.douban.com/j/search_subjects?tag=钢铁侠

获取电影条目详情

请求方法:GET

请求URL:https://movie.douban.com/j/subject_abstract

请求参数:

参数名类型必要缺省说明
subject_idnumber电影条目的 ID

请求示例:

GET https://movie.douban.com/j/subject_abstract?subject_id=4917832

版权声明:

Anand's Blog文章皆为站长Anand Zhang原创内容,转载请注明出处。

包括商业转载在内,注明下方要求的文章出处信息即可,无需联系站长授权。

请尊重他人劳动成果,用爱发电十分不易,谢谢!

请注明出处:

本文出自:Anand's Blog

本文永久链接:https://anandzhang.com/posts/frontend/6