豆瓣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:

Property Description Type Basic Advance Premium Default
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:

 

Property Description Type Basic Advance Premium Default
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


 

Property Description Type Basic Advance Premium Default
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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM