豆瓣API

作者: 菜鸟飞不动 | 来源:发表于2019-03-20 11:35 被阅读13次

搜索图书

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.

相关文章

  • 豆瓣API

    搜索图书 返回:返回status=200, 注:对于登录用户,若搜索结果图书在当前用户的图书收藏中,会在对应搜索结...

  • 豆瓣api

    1、豆瓣热映 接口:https://api.douban.com/v2/movie/in_theaters 参数:...

  • 微信小程序访问豆瓣api403问题

    通过豆瓣api可以获取很多电影、书籍等的数据信息。昨晚上用微信小程序请求豆瓣api,竟然被豆瓣拒绝了。(豆瓣设置了...

  • 微信小程序访问豆瓣api403问题

    通过豆瓣api可以获取很多电影、书籍等的数据信息。昨晚上用微信小程序请求豆瓣api,竟然被豆瓣拒绝了。(豆瓣设置了...

  • 小程序请求不了豆瓣接口api

    通过豆瓣api可以获取很多电影、书籍等的数据信息。昨晚上用微信小程序请求豆瓣api,竟然被豆瓣拒绝了。(豆瓣设置了...

  • 豆瓣api使用

    获取电影信息 电影条目搜索 正在热映 top250 口碑榜 北美票房榜 新片榜 获取电影信息 获取电影剧照 获取电...

  • 豆瓣API案例

    导入文件和骨架 保证一个 js 文件中的命名不冲突,就要进行 闭包处理 先创建相应的 angular 的模块,测试...

  • 豆瓣最新API

    前段时间豆瓣API不能访问了, 今天军哥自己写了一个php项目技术交流QQ群 277030213豆瓣 api ph...

  • 知乎日报 API 分析

    知乎日报 API 分析 干货集中营 API 文档 精选妹纸图 豆瓣API快速入门 易源数据

  • 微信小程序请求豆瓣api踩坑

    微信小程序请求豆瓣api的时候,会报一个403(Forbidden)的错误,原因是小程序把豆瓣公开的api给禁掉了...

网友评论

    本文标题:豆瓣API

    本文链接:https://www.haomeiwen.com/subject/ufkzmqtx.html