Trends

跳转到: 导航, 搜索
(使用示例)
 
(未显示3个用户的41个中间版本)
第1行: 第1行:
== trends ==
+
{{api_desc2|
获取某人话题。
+
uri=trends|
 
+
desc=获取某用户的话题。|
=== URL===
+
format=XML/JSON|
http://api.t.sina.com.cn/trends.format
+
httpMethod=GET|
+
needAuth=true|
=== 格式===
+
rateLimit=true|
xml, json
+
params={{api_args|user_id|true|int64|用户id}}
 
+
{{api_args|page|false|int,缺省值为1|页码}}
=== HTTP请求方式===
+
{{api_args|count|false|int,缺省值为10|每页返回的记录数}}|
GET
+
postParam=|
+
getParam=&user_id=12345678&page=1&count=10|
=== 是否需要身份验证===
+
result=
false
+
===XML示例===
 
+
<pre>
=== 请求数限制===
+
<?xml version="1.0" encoding="UTF-8"?>
true
+
<trends>
 
+
  <trend>
=== 请求参数===
+
    <trend_id>1567898</trend_id>
*user_id: 选填参数,要获取用户的uid。
+
    <hotword>ipad</hotword>
* page: 选填参数.页码。缺省为1。
+
    <num>225673</num>
* 示例: http://api.t.sina.com.cn/trends.xml?user_id=12345&page=1
+
  </trend>
* count: 选填参数.单页显示数。缺省为10
+
  <trend>
* 示例: http://api.t.sina.com.cn/trends/weekly.xml?exclude=10
+
    <trend_id>1567733</trend_id>
=== 返回结果 ===
+
    <hotword>NBA</hotword>
XML示例:
+
    <num>106248</num>
<?xml version="1.0" encoding="UTF-8"?>
+
  </trend>
 
+
</trends>
<trends>
+
</pre>
<trend>
+
===JSON示例===
<trend_id>null</trend_id>
+
<pre>
<hotword>ddddsss</hotword>
+
[
<num>1</num>
+
    {
</trend>
+
        "num" : "225673",
<trend>
+
        "hotword" : "ipad",
<trend_id>null</trend_id>
+
        "trend_id" : "1567898"
<hotword>dddd</hotword>
+
    },
<num>14881</num>
+
    {
</trend>
+
        "num" : "106384",
</trends>
+
        "hotword" : "NBA",
</trends>
+
        "trend_id" : "1567733"
 
+
    }
JSON示例:
+
]
 
+
</pre>|
  [{"num":"1","trend_id":"876637","hotword":"ddddsss"},{"num":"14881","trend_id":"876636","hotword":"dddd"}]
+
useAge=无|
 
+
otherInfo=
=== 使用示例===
+
}}
 
+
* xml:
+
curl -u uid:password  http://123.125.104.29/trends.xml -d "source=1392673069&user_id=1734528095&page=1&count=10"
+
 
+
* json:
+
curl -u uid:password http://123.125.104.29/trends.json -d "source=1392673069&user_id=1734528095&page=1&count=10"
+

2012年9月24日 (一) 11:42的最后版本

目录

trends

获取某用户的话题。

URL

http://api.t.sina.com.cn/trends.(json%7Cxml)

支持格式

XML/JSON

HTTP请求方式

GET

是否需要登录

true
关于授权机制,参见授权机制声明

请求数限制

true
关于请求数限制,参见接口访问权限说明

请求参数

  必选 类型及范围 说明
source true string 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数)
user_id true int64 用户id
page false int,缺省值为1 页码
count false int,缺省值为10 每页返回的记录数

注意事项

返回结果

XML示例

<?xml version="1.0" encoding="UTF-8"?>
<trends>
  <trend>
    <trend_id>1567898</trend_id>
    <hotword>ipad</hotword>
    <num>225673</num>
  </trend>
  <trend>
    <trend_id>1567733</trend_id>
    <hotword>NBA</hotword>
    <num>106248</num>
  </trend>
</trends>

JSON示例

[
    {
        "num" : "225673",
        "hotword" : "ipad",
        "trend_id" : "1567898"
    },
    {
        "num" : "106384",
        "hotword" : "NBA",
        "trend_id" : "1567733"
    }
]

其他

文档更新时间: 2012-09-24