Statuses/user timeline/en

跳转到: 导航, 搜索



Return the user’s latest timeline.


Supported Formats


HTTP Request Method


Requires Authentication

See the Authorization Mechanism Statement for authorization details

Requests Count Limitation

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)
:id false int64/string Return the weibos of specified ID (int64) or nickname(string) of a user. This is a RESTful parameter, please see Notes
user_id false int64 Return the weibos of specified ID of a user. It is mainly used to distinguish user ID with weibo nickname(screen_name). When weibo nickname is numbers and leads ambiguity with user ID, especially when weibo nickname and user ID are the same, using this parameter is recommended.
screen_name false string Weibo nickname. It is mainly used to distinguish user UID and weibo nickname. When they both are the same and lead ambiguity, using this parameter is recommended.
since_id false int64 Returns then weibos with an ID greater than (that is, more recent than) the specified ID.
max_id false int64 Return the weibos with an ID smaller than the specified ID.
count false Int,defaul is 20, mxa is 200. Specify the number of weibos returned.
page false Int, default is 1. Page. Note: it will return 200 pieces of statuses each page at the most.
base_app false int whether get the data based on current application. 1 is only current application; 0 is no limitation.
feature false int Return the weibos by weibo type. 0 is all type. 1 is original. 2 is picture. 3 is video. 4 is music.
If none of id, user_id, screen_name is specified, it Response the authenticating user’s latest timeline.


Example Request

curl -u "username:password" ""
curl -u "username:password" ""


XML Example

<?xml version="1.0" encoding="UTF-8"?>
    <created_at>Mon Nov 29 16:08:43 +0800 2010</created_at>
    <text>各位开发者,我们的论坛上线啦~ 欢迎大家的参与~另外,关于技术相关的问题,可以在论坛上提出,也可以@微博API 这个官方技术支持账号哦~感谢大家对开放平台的支持~[呵呵]</text>
      <a href="">新浪微博</a>
      <location>北京 海淀区</location>
      <created_at>Wed Jan 20 00:00:00 +0800 2010</created_at>

JSON Example

        "created_at" : "Mon Nov 29 16:08:43 +0800 2010",
        "text" : "各位开发者,我们的论坛上线啦~ 欢迎大家的参与~另外,关于技术相关的问题,可以在论坛上提出,也可以@微博API 这个官方技术支持账号哦~感谢大家对开放平台的支持~[呵呵]",
        "truncated" : false,
        "in_reply_to_status_id" : "",
        "in_reply_to_screen_name" : "",
        "geo" : null,
        "user" : 
            "name" : "微博开放平台",
            "domain" : "openapi",
            "geo_enabled" : true,
            "followers_count" : 13034,
            "statuses_count" : 157,
            "favourites_count" : 0,
            "city" : "8",
            "description" : "新浪微博开放平台市场推广官方账号,如有技术问题,请@微博API或者发私信给微博API",
            "verified" : true,
            "id" : 11051,
            "gender" : "m",
            "friends_count" : 5,
            "screen_name" : "微博开放平台",
            "allow_all_act_msg" : true,
            "following" : false,
            "url" : "",
            "profile_image_url" : "",
            "created_at" : "Wed Jan 20 00:00:00 +0800 2010",
            "province" : "11",
            "location" : "北京 海淀区"
        "favorited" : false,
        "in_reply_to_user_id" : "",
        "id" : 3958728723,
        "source" : "<a href=\"\" rel=\"nofollow\">新浪微博</a>"

Field Description - weibo

  • created_at: Create time
  • id: Weibo ID
  • text: Weibo content
  • source: Weibo source
  • favorited: Whether it is favroited
  • truncated: Whether it is truncated
  • in_reply_to_status_id: The reply’s ID
  • in_reply_to_user_id: UID of the replyer
  • in_reply_to_screen_name: Nickname of replyer
  • thumbnail_pic: Thumbnail picture
  • bmiddle_pic: Medium picture
  • original_pic:Original picture
  • user: User profile
  • retweeted_status: eposted weibo content, the content is the status, This filed is only available for a reposted weibo.

Field Description - user

  • id: User ID
  • screen_name: User’s nickname displayed on the home page
  • name: Friendly displayed name, the same as screen_name
  • province: Province code ( see Province and city code table)
  • city: City code ( see Province and city code table)
  • location:Address
  • description: Personal description
  • url: Url of the user’s blog
  • profile_image_url: Profile image
  • domain: The user’s personalized weibo url
  • gender: Gender, m—male, f- - female, n-- unknown
  • followers_count: Followers count
  • friends_count: Following count
  • statuses_count: Weibo count
  • favourites_count: Favorites count
  • created_at: Created time
  • following: Whether the current user is following the user that posts the weibo (Not supported yet)
  • verified: Whether the user is verified by his real identity, marked with “V”


Java Example

Please download Java SDK from . Weibo SDK Development Kit Dowload Site
Sample Code:

 package weibo4j.examples;
 import java.util.List;
 import weibo4j.Status;
 import weibo4j.Weibo;
 import weibo4j.WeiboException;
 public class GetUserTimeline {
 	 * 获取用户发布的微博信息列表 
 	 * @param args
 	public static void main(String[] args) {
 		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
     		System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);
 	 	try {
 			List<Status> statuses = getWeibo(false,args).getUserTimeline(args[2]);
 			for (Status status : statuses) {
 	            System.out.println(status.getUser().getName() + ":" +
 		} catch (WeiboException e) {
  	private static Weibo getWeibo(boolean isOauth,String[] args) {
 		Weibo weibo = new Weibo();
 		if(isOauth) {//oauth验证方式 args[0]:访问的token;args[1]:访问的密匙
 			weibo.setToken(args[0], args[1]);
 		}else {//用户登录方式
 		return weibo;

PHP Example

Please download PHP SDK with OAUTH supported from Weibo SDK Development Kit Dowload Site
. Sample Code:

//Statuses/user timeline
$c = new WeiboClient( WB_AKEY , 
                      WB_SKEY , 
                      $_SESSION['last_key']['oauth_token'] , 
                      $_SESSION['last_key']['oauth_token_secret']  );

$u_id = "用户ID";
$msg  = $c->user_timeline($u_id);
if ($msg === false || $msg === null){
	echo "Error occured";
	return false;
if (isset($msg['error_code']) && isset($msg['error'])){
	echo ('Error_code: '.$msg['error_code'].';  Error: '.$msg['error'] );
	return false;
foreach ($msg as $data){
	$user_name = $data['user']['name'];
	$text = $data['text'];
	echo $user_name."=".$text.";";