Users/search/en

Jump to: navigation, search

Contents

users/search

Search for users with the keyword

URL

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

Supported Formats

XML/JSON

HTTP Request Method

GET

Requires Authentication

false
See the Authorization Mechanism Statement for authorization details

Requests Count Limitation

true
See the Interface Access Rights Statement for the Request Count Limitaiton details.

Request Parameters

  Requires Type and Range Description
source true string AppKey for the application to identify it. ( This parameter is not needed when using OAuth)
q true string Keyword. Encoded by URL Encode.
snick false int Whether search for nickname. 0 is no, 1 is yes.
sdomain false int Whether search for domain name. 0 is no, 1 is yes
sintro false int Whether search for user description. 0 is no, 1 is yes.
province false int Provice ID ,see Province and city code table
city false int City ID,see Province and city code table
gender false string Gender. m is male, f is female.
comorsch false string Company or school name
sort false int Sort type,1 is by time, 2 is by follower count
page false int page
count false int weibo count per page (default is 10).
callback false string Only supports JSON. For JSONP cross site data access.
base_app false int Whether based on the current application. 1 is yes

Notes

  • Return 400 error if the keyword is null

Example Request

XML
curl -u "username:password" "http://api.t.sina.com.cn/users/search.xml?source=appkey&q=王若琳&callback=foo"
JSON
curl -u "username:password" "http://api.t.sina.com.cn/users/search.json?source=appkey&q=王若琳&callback=foo"

Response

XML Example

<?xml version="1.0" encoding="UTF-8"?>
<searchResult>
  <users>
    <user>
      <id>1795666007</id>
      <screen_name>王若琳星闻</screen_name>
      <name>王若琳星闻</name>
      <province>11</province>
      <city>1000</city>
      <location>北京</location>
      <description/>
      <url/>
      <profile_image_url>http://tp4.sinaimg.cn/1795666007/50/1282886247/0</profile_image_url>
      <domain/>
      <gender>f</gender>
      <followers_count>286</followers_count>
      <friends_count>213</friends_count>
      <statuses_count>9</statuses_count>
      <favourites_count>0</favourites_count>
      <created_at>Sun Aug 15 00:00:00 +0800 2010</created_at>
      <following>false</following>
      <verified>false</verified>
      <allow_all_act_msg>true</allow_all_act_msg>
      <geo_enabled>true</geo_enabled>
      <status>
        <created_at>Tue Oct 26 13:24:19 +0800 2010</created_at>
        <id>3277931869</id>
        <text>【环保音乐会世博奏响 王若琳自曝宅女环保生活】 当晚,整个舞台群星璀璨,王若琳倾情演绎《Adult crap》《玫瑰玫瑰我爱你》一举征服了观众的心,著名环保歌手朱哲琴则用她空灵的歌声一曲《阿姐鼓》震撼全场,仿佛将观众...http://sinaurl.cn/h4WVid</text>
        <source>
          <a href="">微博开放平台接口</a>
        </source>
        <favorited>false</favorited>
        <truncated>false</truncated>
        <geo/>
        <in_reply_to_status_id/>
        <in_reply_to_user_id/>
        <in_reply_to_screen_name/>
        <thumbnail_pic>http://ss7.sinaimg.cn/thumbnail/6b07b0574937e5218ba66&690</thumbnail_pic>
        <bmiddle_pic>http://ss7.sinaimg.cn/bmiddle/6b07b0574937e5218ba66&690</bmiddle_pic>
        <original_pic>http://ss7.sinaimg.cn/orignal/6b07b0574937e5218ba66&690</original_pic>
      </status>
    </user>
    ...
  </users>
</searchResult>

JSON Example without callback

[
    {
        "name" : "王若琳",
        "domain" : "",
        "geo_enabled" : true,
        "followers_count" : 52,
        "statuses_count" : 6,
        "favourites_count" : 0,
        "city" : "5",
        "description" : "我啊!不说了!",
        "verified" : false,
        "id" : 1427803427,
        "gender" : "f",
        "friends_count" : 11,
        "screen_name" : "王若琳",
        "allow_all_act_msg" : false,
        "following" : false,
        "url" : "",
        "profile_image_url" : "http://tp4.sinaimg.cn/1427803427/50/1259749109/0",
        "created_at" : "Wed Dec 02 00:00:00 +0800 2009",
        "province" : "11",
        "location" : "北京 朝阳区"
    },
    ....
]

JSON Example(callback=foo)

foo(
	[
	    {
		"name" : "王若琳",
		"domain" : "",
		"geo_enabled" : true,
		"followers_count" : 52,
		"statuses_count" : 6,
		"favourites_count" : 0,
		"city" : "5",
		"description" : "我啊!不说了!",
		"verified" : false,
		"id" : 1427803427,
		"gender" : "f",
		"friends_count" : 11,
		"screen_name" : "王若琳",
		"allow_all_act_msg" : false,
		"following" : false,
		"url" : "",
		"profile_image_url" : "http://tp4.sinaimg.cn/1427803427/50/1259749109/0",
		"created_at" : "Wed Dec 02 00:00:00 +0800 2009",
		"province" : "11",
		"location" : "北京 朝阳区"
	    },
	    ...
	]
)

Others

None

文档更新时间: 24 January 2011