豆瓣API

Api V2 索引

图书Api V2

电影Api V2

音乐Api V2

同城Api V2

广播Api V2

用户Api V2

日记Api V2

相册Api V2

线上活动Api V2

论坛Api V2

回复Api V2

我去Api V2

https://developers.douban.com/wiki/?title=api_v2

搜索图书

GET  https://api.douban.com/v2/book/search
参数 意义 备注
q 查询关键字 q和tag必传其一
tag 查询的tag q和tag必传其一
start 取结果的offset 默认为0
count 取结果的条数 默认为20,最大为100

返回:返回status=200,

{
      "start": 0,
      "count": 10,
      "total": 30,
      "books" : [Book, ]
    }

注:对于登录用户,若搜索结果图书在当前用户的图书收藏中,会在对应搜索结果信息中附加当前用户对此书的收藏信息,改部分的 Book 数据结构如下:

{
    … (图书信息的其他部分)
    "current_user_collection": {
        "status":"read",
        "rating": {
            "max":5,
            "value":"5",
            "min":0
        },
        "updated":"2012-11-2012:08:04",
        "user_id":"33388491",
        "book_id":"6548683",
        "id":605519800
    }
}

获取图书信息

GET  https://api.douban.com/v2/book/:id

返回图书信息,返回status=200

对于授权用户,返回数据中会带有该用户对该图书的收藏信息:

{
    … (图书信息的其他部分)
    "current_user_collection": {
        "status":"read",
        "rating": {
            "max":5,
            "value":"5",
            "min":0
        },
        "updated":"2012-11-2012:08:04",
        "user_id":"33388491",
        "book_id":"6548683",
        "id":605519800
    }
}

 https://developers.douban.com/wiki/?title=book_v2

电影条目搜索


Resources URI

/v2/movie/search?q={text}

Required Scope

movie_basic_r

Example:

GET https://api.douban.com/v2/movie/search?q=张艺谋 GET /v2/movie/search?tag=喜剧

Status:

200 OK

Request Properties:

PropertyDescriptionTypeBasicAdvancePremiumDefault
q query string str Y Y Y -
tag tag query string str Y Y Y -
start start int Y Y Y 0
count count int Y Y Y 20

Resources Properties:

PropertyDescriptionTypeBasicAdvancePremiumDefault
start start int Y Y Y 0
count count int Y Y Y 20
total 总数, Basic最多只返回20条记录 int Y Y Y 0
query 搜索字符串 str Y Y Y -
tag 搜索标签 str Y Y Y -
subjects 搜索结果列表,见附录 array Y Y Y -

Simple Subject Properties


PropertyDescriptionTypeBasicAdvancePremiumDefault
id 条目id str Y Y Y -
title 中文名 str Y Y Y -
original_title 原名 str Y Y Y ''
alt 条目URL float(1) Y Y Y -
images 电影海报图,分别提供288px x 465px(大),96px x 155px(中) 64px x 103px(小)尺寸 dict Y Y Y -
rating 评分,见附录 dict Y Y Y -
pubdates 如果条目类型是电影则为上映日期,如果是电视剧则为首播日期 array N Y Y []
year 年代 str Y Y Y ''
subtype 条目分类, movie或者tv str Y Y Y movie

https://developers.douban.com/wiki/?title=movie_v2

获取音乐信息

GET  https://api.douban.com/v2/music/:id

返回音乐信息,返回status=200

搜索音乐

GET  https://api.douban.com/v2/music/search
参数 意义 备注
q 查询关键字 q和tag必传其一
tag 查询的tag q和tag必传其一
start 取结果的offset 默认为0
count 取结果的条数  

返回:返回status=200,

{
      "start": 0,
      "count": 10,
      "total": 30,
      "musics" : [Music, ]
    }

https://developers.douban.com/wiki/?title=music_v2#get_music_search

原文地址:https://www.cnblogs.com/softidea/p/8039351.html