豆瓣 API 参考手册

推荐

获取推荐

GET http://api.douban.com/recommendation/{recommendationID}

例如

GET http://api.douban.com/recommendation/3673470

返回格式

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:db="http://www.douban.com/xmlns/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/">
    <id>http://api.douban.com/recommendation/3673470</id>
    <title>推荐喵喵喵</title>
    <published>2008-11-07T08:28:40+08:00</published>
    <content type="html"><![CDATA[推荐<a href="http://www.douban.com/photos/album/12573993/">喵喵喵</a>]]></content>
    <db:attribute name="category">photo_album</db:attribute>
    <db:attribute name="comment">团子,我家团子,以前觉得她小时候很丑,现在觉得一 点也不丑啊~哇哈哈哈</db:attribute>
    <db:attribute name="comments_count">6</db:attribute>
</entry>
    

获取用户的所有推荐

GET http://api.douban.com/people/{userID}/recommendations

请求参数

参数 意义 备注
start-index 起始元素
max-results 返回结果的数量

例如

GET http://api.douban.com/people/aka/recommendations?start-index=1&max-results=1

返回格式

<feed xmlns="http://www.w3.org/2005/Atom" xmlns:db="http://www.douban.com/xmlns/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/">
    <title>胖胖的大头鱼 的推荐</title>
    <author>
        <link href="http://api.douban.com/people/1057620" rel="self"/>
        <link href="http://www.douban.com/people/aka/" rel="alternate"/>
        <link href="http://t.douban.com/icon/u1057620-16.jpg" rel="icon"/>
        <name>胖胖的大头鱼</name>
        <uri>http://api.douban.com/people/1057620</uri>
    </author>
    <opensearch:startIndex>1</opensearch:startIndex>
    <entry>
        <id>http://api.douban.com/recommendation/3677685</id>
        <title>推荐麦凯恩的败选演说——2008美国大选之夜(上)</title>
        <published>2008-11-07T13:36:05+08:00</published>
        <content type="html"><![CDATA[推荐<a href="http://9.douban.com/site/entry/74478867/">麦凯恩的败选演说——2008美国大选之夜(上)</a>]]></content>
        <db:attribute name="category">entry</db:attribute>
        <db:attribute name="comment"></db:attribute>
        <db:attribute name="comments_count">0</db:attribute>
    </entry>
    <opensearch:itemsPerPage>1</opensearch:itemsPerPage>
</feed>
    

获取推荐回复

GET http://api.douban.com/recommendation/{recommendationID}/comments

例如

GET http://api.douban.com/recommendation/3673470/comments

返回格式

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:db="http://www.douban.com/xmlns/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/">
    <title>推荐 喵喵喵 的回应</title>
    <author>
        <link href="http://api.douban.com/people/1177592" rel="self"/>
        <link href="http://www.douban.com/people/Autorun/" rel="alternate"/>
        <link href="http://t.douban.com/icon/u1177592-15.jpg" rel="icon"/>
        <name>Autorun</name>
        <uri>http://api.douban.com/people/1177592</uri>
    </author>
    <opensearch:startIndex>1</opensearch:startIndex>
    <opensearch:totalResults>6</opensearch:totalResults>
    <entry>
        <id>http://api.douban.com/recommendation/3673470/comment/178347</id>
        <author>
            <link href="http://api.douban.com/people/1345080" rel="self"/>
            <link href="http://www.douban.com/people/dune.cd/" rel="alternate"/>
            <link href="http://t.douban.com/icon/u1345080-31.jpg" rel="icon"/>
            <name>晴天小超人</name>
            <uri>http://api.douban.com/people/1345080</uri>
        </author>
        <published>2008-11-07T08:31:11+08:00</published>
        <content>哈哈,太好玩啦,可惜没玩到...</content>
    </entry>
    <entry>
        <id>http://api.douban.com/recommendation/3673470/comment/178378</id>
        <author>
            <link href="http://api.douban.com/people/2703736" rel="self"/>
            <link href="http://www.douban.com/people/2703736/" rel="alternate"/>
            <link href="http://t.douban.com/icon/u2703736-5.jpg" rel="icon"/>
            <name>dido</name>
            <uri>http://api.douban.com/people/2703736</uri>
        </author>
        <published>2008-11-07T09:18:15+08:00</published>
        <content>你们两口子生生把个赵飞燕养成了杨玉环啊!</content>
    </entry>
    <entry>
        <author>
            <link href="http://api.douban.com/people/1177592" rel="self"/>
            <link href="http://www.douban.com/people/Autorun/" rel="alternate"/>
            <link href="http://t.douban.com/icon/u1177592-15.jpg" rel="icon"/>
            <name>Autorun</name>
            <uri>http://api.douban.com/people/1177592</uri>
        </author>
        <published>2008-11-07T09:21:57+08:00</published>
        <content>赵飞燕自己狂吃,拦不住,何止杨玉环,已经快成安禄山了</content>
    </entry>
    <entry>
        <id>http://api.douban.com/recommendation/3673470/comment/178437</id>
        <author>
            <link href="http://api.douban.com/people/1169642" rel="self"/>
            <link href="http://www.douban.com/people/katelan/" rel="alternate"/>
            <link href="http://t.douban.com/icon/u1169642-76.jpg" rel="icon"/>
            <name>卡特兰(1206)</name>
            <uri>http://api.douban.com/people/1169642</uri>
        </author>
        <published>2008-11-07T10:18:05+08:00</published>
        <content>你不是说现在长胖变形了吗?</content>
    </entry>
    <entry>
        <id>http://api.douban.com/recommendation/3673470/comment/178441</id>
        <author>
            <link href="http://api.douban.com/people/1177592" rel="self"/>
            <link href="http://www.douban.com/people/Autorun/" rel="alternate"/>
            <link href="http://t.douban.com/icon/u1177592-15.jpg" rel="icon"/>
            <name>Autorun</name>
            <uri>http://api.douban.com/people/1177592</uri>
        </author>
        <published>2008-11-07T10:19:54+08:00</published>
        <content>对,这是刚捡回来的时候,呵呵,现在已经成大屁妹了</content>
    </entry>
    <entry>
        <id>http://api.douban.com/recommendation/3673470/comment/178584</id>
        <author>
            <link href="http://api.douban.com/people/1417108" rel="self"/>
            <link href="http://www.douban.com/people/hacker47/" rel="alternate"/>
            <link href="http://t.douban.com/icon/u1417108-7.jpg" rel="icon"/>
            <name>hacker47</name>
            <uri>http://api.douban.com/people/1417108</uri>
        </author>
        <published>2008-11-07T11:33:49+08:00</published>
        <content>很郁闷的表情啊,为什么?</content>
    </entry>
    <opensearch:itemsPerPage>10</opensearch:itemsPerPage>
</feed>
    

发表推荐

发表新推荐必须先进行API认证授权,关于API认证授权的信息请参阅API 授权说明

POST http://api.douban.com/recommendations

实例

POST http://api.douban.com/recommendations

请求为一个Entry

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
        xmlns:gd="http://schemas.google.com/g/2005"
        xmlns:opensearch="http://a9.com/-/spec/opensearchrss/1.0/"
        xmlns:db="http://www.douban.com/xmlns/">
        <title>标题</title>
        <db:attribute name="comment">神作</db:attribute>
        <link href="http://api.douban.com/movie/subject/1424406" rel="related" />
</entry>
    

成功返回

201 CREATED

删除推荐

发表新推荐必须先进行API认证授权,关于API认证授权的信息请参阅API 授权说明

DELETE http://api.douban.com/recommendation/{recommendationID}

实例

DELETE http://api.douban.com/recommendation/3671284

成功返回

200 OK

发表新回复

发表回复必须先进行API认证授权,关于API认证授权的信息请参阅API 授权说明

POST http://api.douban.com/recommendation/{recommendationID}/comments

实例

POST http://api.douban.com/recommendation/3671284/comments

请求为一个Entry

    <?xml version='1.0' encoding='UTF-8'?>
    <entry>
        <content>一些话</content>
    </entry>
    

成功返回

201 CREATED

删除回复

删除回复必须先进行API认证授权,关于API认证授权的信息请参阅API 授权说明

DELETE http://api.douban.com/recommendation/{recommendationID}/comment/{commentID}

实例

DELETE http://api.douban.com/recommendation/3671284/comment/178651

成功返回

200 OK