Users/search

跳转到: 导航, 搜索

目录

users/search

返回关键字匹配的微博用户。

URL

http://api.t.sina.com.cn/users/search.format

格式

xml, json

HTTP请求方式

GET

是否需要登录

true

请求数限制

true

请求参数

  • q: 选填参数. 查询的关键字。必须进行url encode
o 示例: http://api.t.sina.com.cn/search.json?q=api
  • snick: 选填参数. 搜索范围包含昵称 (0是不包含,1为包含)
o 示例: http://api.t.sina.com.cn/search.json?q=api&snick=0
  • sdomain: 选填参数. 搜索范围包含个性域名 (0是不包含,1为包含)
o 示例: http://api.t.sina.com.cn/search.json?q=api&sdomain=1
  • sintro: 选填参数. 搜索范围包含简介 (0是不包含,1为包含)
o 示例: http://api.t.sina.com.cn/search.json?q=api&sintro=1
  • province: 省份ID
o 示例: http://api.t.sina.com.cn/search.json?province=11
  • city: 城市ID
o 示例: http://api.t.sina.com.cn/search.json?province=11&city=1
  • gender: 性别(m为男,f为女)
o 示例: http://api.t.sina.com.cn/search.json?gender=m
  • comorsch: 公司学校名称
o 示例: http://api.t.sina.com.cn/search.json?comorsch=新浪
  • sort: 排序方式(1为按更新时间,2为按粉丝数)
o 示例: http://api.t.sina.com.cn/search.json?q=api&sort=1
  • page: 页码
o 示例: http://api.t.sina.com.cn/search.json?q=api&sort=1&page=1
  • count:分页大小(默认返回10条)
o 示例: http://api.t.sina.com.cn/search.json?q=api&sort=1&page=1&count=10
  • callback: 可选参数. 仅JSON方式支持,用于JSONP callback作用。
o 示例: http://api.t.sina.com.cn/search.json?q=api&callback=foo

返回结果

XML示例:

<?xml version="1.0" encoding="UTF-8"?>
<searchResult>
<users>
 <user>
   <id>1524469632</id>
   <screen_name>hustfisher1</screen_name>
   <name>hustfisher1</name>
   <province>44</province>
   <city>1</city>
   <location>广东 广州</location>
   <description></description>
   <profile_image_url>http://tp1.sinaimg.cn/1524469632/50/0</profile_image_url>
   <domain></domain>
   <gender></gender>
   <email></email>
   <qq></qq>
   <msn></msn>
   <followers_count>1</followers_count>
   <friends_count>0</friends_count>
   <statuses_count>1</statuses_count>
   <favourites_count>0</favourites_count>
   <created_at>Wed Nov 11 00:00:00 +0800 2009</created_at>
   <following>false</following>
   <verified>false</verified>
   <geo_enabled>false</geo_enabled>
   <status>
     <created_at>Mon Jan 25 18:44:35 +0800 2010</created_at>
     <id>2191142</id>
     <text>测试</text>
     <source>
       <a href="http://t.sina.com.cn">新浪微博</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>
<total_count_maybe>153</total_count_maybe>
</users>
</searchResult>

使用示例

  • xml:

curl http://api.t.sina.com.cn/users/search.xml?q=api

  • json:

curl http://api.t.sina.com.cn/users/search.json?q=api