Users/show
(→返回结果) |
(→返回结果) |
||
第101行: | 第101行: | ||
} | } | ||
} | } | ||
+ | |||
+ | JsonP示例: | ||
+ | |||
+ | curl -u uid:wasswd "http://api.t.sina.com.cn/users/show/11075.json?source=appkey&callback=testcallback"<br> | ||
+ | testcallback<br> | ||
+ | |||
+ | ( | ||
+ | {"id":11075,"screen_name":"微博开放平台","name":"微博开放平台","province":"51","city":"33",<br>"location":"四川 甘孜","description":"bbbb aaaa","url":"http://blog.sina.com.cn/helli1",<br>"profile_image_url":"http://tp4.sinaimg.cn/11075/50/1269928976","domain":"helli",<br>"gender":"m","followers_count":164,"friends_count":121,"statuses_count":128,<br>"favourites_count":0,"<br>created_at":"Thu Sep 10 00:00:00 +0800 2009","following":false,<br>"allow_all_act_msg":false,"geo_enabled":false,"verified":false,"status": | ||
+ | {"created_at":"Wed Jun 02 15:26:47 +0800 2010","id":532891813,"text":<br>"这是链接 http://v.youku.com/v_show/id_XMTc3OTc3MTQ4.html","source":<br>"<a href=\"http://open.t.sina.com.cn/wiki/index.php/SDK/\" <br>rel=\"nofollow\">dabr for weibo</a>","favorited":false,<br>"truncated":false,"in_reply_to_status_id":"","in_reply_to_user_id":"",<br>"in_reply_to_screen_name":"","geo": | ||
+ | {"type": "Point","coordinates": [34.66, 58.88]} | ||
+ | } | ||
+ | } | ||
+ | ) | ||
=== 使用示例=== | === 使用示例=== |
2010年6月4日 (五) 19:07的版本
目录 |
users/show
按用户UID或昵称返回用户资料,同时也将返回用户的最新发布的微博。
URL
curl http://api.t.sina.com.cn/users/show.format
格式
xml, json
HTTP请求方式
GET
是否需要身份验证
false
请求数限制
true
请求参数
- id. 用户UID或微博昵称。
o 示例: http://api.t.sina.com.cn/users/show/12345.json or http://api.t.sina.com.cn/users/show/bob.xml
- user_id. 指定用户UID,主要是用来区分用户UID跟微博昵称一样,产生歧义的时候,特别是在用户账号为数字导致和用户Uid发生歧义。
o 示例: http://api.t.sina.com.cn/users/show.xml?user_id=1401881
- screen_name. 指定微博昵称,主要是用来区分用户UID跟微博昵称一样,产生歧义的时候。
o 示例: http://api.t.sina.com.cn/users/show.xml?screen_name=101010
使用说明
- ID或者昵称不存在返回400错误
- 为了保护用户隐私,只有用户设置了公开或对粉丝设置了公开的数据才会返回。
返回结果
XML示例:
<?xml version="1.0" encoding="UTF-8"?> <user> <id>11075</id> <screen_name>name_11075</screen_name> <name>name_11075</name> <province>0</province> <city>0</city> <location></location> <description></description> <url></url> <profile_image_url>http://tp4.sinaimg.cn/11075/50/0</profile_image_url> <domain>11075</domain> <gender></gender> <followers_count>28</followers_count> <friends_count>50</friends_count> <statuses_count>29</statuses_count> <favourites_count>0</favourites_count> <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at> <following>false</following> <verified>true</verified> <geo_enabled>false</geo_enabled> <status> <created_at>Thu Jan 07 17:36:07 +0800 2010</created_at> <id>142309</id> <text>要查询的微博ID</text> <source> <a id="0" href="http://t.sina.com.cn">Web</a> </source> <favorited>false</favorited> <truncated>false</truncated> <geo/> <in_reply_to_status_id></in_reply_to_status_id> <in_reply_to_user_id></in_reply_to_user_id> <in_reply_to_screen_name></in_reply_to_screen_name> </status> </user>
JSON示例:
{ "id":11075, "screen_name":"name_11075", "name":"name_11075", "province":"0", "city":"0", "location":"", "description":"", "url":"", "profile_image_url":"http://tp4.sinaimg.cn/11075/50/0", "domain":"11075", "followers_count":28, "friends_count":50, "statuses_count":29, "favourites_count":0, "created_at":"Thu Jan 01 08:00:00 +0800 1970", "following":false, "geo_enabled":false, "verified":true, "status":{"created_at":"Thu Jan 07 17:36:07 +0800 2010", "id":142309, "text":"要查询的微博ID", "source":"<a id=\"0\" href=\"http://t.sina.com.cn/\" rel=\"nofollow\">Web</a>", "favorited":false, "truncated":false, "in_reply_to_status_id":"", "in_reply_to_user_id":"", "in_reply_to_screen_name":"", "geo":null } }
JsonP示例:
curl -u uid:wasswd "http://api.t.sina.com.cn/users/show/11075.json?source=appkey&callback=testcallback"
testcallback
(
{"id":11075,"screen_name":"微博开放平台","name":"微博开放平台","province":"51","city":"33",
"location":"四川 甘孜","description":"bbbb aaaa","url":"http://blog.sina.com.cn/helli1",
"profile_image_url":"http://tp4.sinaimg.cn/11075/50/1269928976","domain":"helli",
"gender":"m","followers_count":164,"friends_count":121,"statuses_count":128,
"favourites_count":0,"
created_at":"Thu Sep 10 00:00:00 +0800 2009","following":false,
"allow_all_act_msg":false,"geo_enabled":false,"verified":false,"status": {"created_at":"Wed Jun 02 15:26:47 +0800 2010","id":532891813,"text":
"这是链接 http://v.youku.com/v_show/id_XMTc3OTc3MTQ4.html","source":
"<a href=\"http://open.t.sina.com.cn/wiki/index.php/SDK/\"
rel=\"nofollow\">dabr for weibo</a>","favorited":false,
"truncated":false,"in_reply_to_status_id":"","in_reply_to_user_id":"",
"in_reply_to_screen_name":"","geo": {"type": "Point","coordinates": [34.66, 58.88]} } }
)
使用示例
- xml:
curl -u uid:password http://api.t.sina.com.cn/users/show.xml?screen_name=timyang&source=appkey
- json:
curl -u uid:password http://api.t.sina.com.cn/users/11054.json or http://api.t.sina.com.cn/users/11054.xml&source=appkey