GET statuses/user_timeline

Updated on Tue, 2013-06-11 09:06

This deprecated method is replaced by GET statuses/user_timeline in API v1.1

Returns the 20 most recent statuses posted by the authenticating user. It is also possible to request another user's timeline by using the screen_name or user_id parameter. The other users timeline will only be visible if they are not protected, or if the authenticating user's follow request was accepted by the protected user.

The timeline returned is the equivalent of the one seen when you view a user's profile on twitter.com.

This method can only return up to 3,200 of a user's most recent statuses. Native retweets of other statuses by the user is included in this total, regardless of whether include_rts is specified when requesting this resource.

This method will not include retweets in the XML and JSON responses unless the include_rts parameter is set. The RSS and Atom responses will always include retweets as statuses prefixed with RT, regardless of provided parameters.

See Working with Timelines for instructions on traversing timelines.

Resource URL

http://api.twitter.com/1/statuses/user_timeline.format

Parameters

Always specify either an user_id or screen_name when requesting a user timeline.

user_id optional

The ID of the user for whom to return results for. Helpful for disambiguating when a valid user ID is also a valid screen name.

Example Values: 12345

Note:: Specifies the ID of the user to befriend. Helpful for disambiguating when a valid user ID is also a valid screen name.

screen_name optional

The screen name of the user for whom to return results for. Helpful for disambiguating when a valid screen name is also a user ID.

Example Values: noradio

since_id optional

Returns results with an ID greater than (that is, more recent than) the specified ID. There are limits to the number of Tweets which can be accessed through the API. If the limit of Tweets has occured since the since_id, the since_id will be forced to the oldest ID available.

Example Values: 12345

count optional

Specifies the number of tweets to try and retrieve, up to a maximum of 200. The value of count is best thought of as a limit to the number of tweets to return because suspended or deleted content is removed after the count has been applied. We include retweets in the count, even if include_rts is not supplied. It is recommended you always send include_rts=1 when using this API method.

max_id optional

Returns results with an ID less than (that is, older than) or equal to the specified ID.

Example Values: 54321

page optional

This parameter will soon cease to be functional See Working with Timelines.

Specifies the page of results to retrieve.

Example Values: 3

trim_user optional

When set to either true, t or 1, each tweet returned in a timeline will include a user object including only the status authors numerical ID. Omit this parameter to receive the complete user object.

Example Values: true

include_rts optional

When set to either true, t or 1,the timeline will contain native retweets (if they exist) in addition to the standard stream of tweets. The output format of retweeted tweets is identical to the representation you see in home_timeline. Note: If you're using the trim_user parameter in conjunction with include_rts, the retweets will no longer contain a full user object.

Example Values: true

include_entities optional

When set to either true, t or 1, each tweet will include a node called "entities,". This node offers a variety of metadata about the tweet in a discreet structure, including: user_mentions, urls, and hashtags. While entities are opt-in on timelines at present, they will be made a default component of output in the future. See Tweet Entities for more detail on entities.

Example Values: true

exclude_replies optional

This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets — this is because the count parameter retrieves that many tweets before filtering out retweets and replies. This parameter is only supported for JSON and XML responses.

Example Values: true

contributor_details optional

This parameter enhances the contributors element of the status response to include the screen_name of the contributor. By default only the user_id of the contributor is included.

Example Values: true

Extended description

The URL pattern /version/statuses/user_timeline/:screen_name_or_user_id.format is still accepted but not recommended. As a sequence of numbers is a valid screen name we recommend using the screen_name or user_id parameter instead.

Example Request

GET

https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=twitterapi&count=2

  1. [
  2.   {
  3.     "coordinates": null,
  4.     "truncated": false,
  5.     "favorited": false,
  6.     "created_at": "Mon Jun 27 19:32:19 +0000 2011",
  7.     "id_str": "85430275915526144",
  8.     "entities": {
  9.       "urls": [
  10.         {
  11.           "expanded_url": "http://tumblr.com/xnr37hf0yz",
  12.           "url": "http://t.co/cCIWIwg",
  13.           "indices": [
  14.             107,
  15.             126
  16.           ],
  17.           "display_url": "tumblr.com/xnr37hf0yz"
  18.         }
  19.       ],
  20.       "hashtags": [
  21.  
  22.       ],
  23.       "user_mentions": [
  24.  
  25.       ]
  26.     },
  27.     "in_reply_to_user_id_str": null,
  28.     "text": "Misleading error message - If you try to follow a user who was recently suspended, you may see an error... http://t.co/cCIWIwg",
  29.     "contributors": null,
  30.     "in_reply_to_status_id_str": null,
  31.     "id": 85430275915526144,
  32.     "retweet_count": 25,
  33.     "geo": null,
  34.     "retweeted": false,
  35.     "in_reply_to_user_id": null,
  36.     "source": "<a href=\"http://www.tumblr.com/\" rel=\"nofollow\">Tumblr</a>",
  37.     "user": {
  38.       "profile_sidebar_border_color": "0094C2",
  39.       "profile_background_tile": false,
  40.       "profile_sidebar_fill_color": "a9d9f1",
  41.       "name": "Twitter API",
  42.       "expanded_url": null,
  43.       "location": "San Francisco, CA",
  44.       "profile_image_url": "http://a0.twimg.com/profile_images/1396428969/twitterapi_normal.png",
  45.       "created_at": "Wed May 23 06:01:13 +0000 2007",
  46.       "follow_request_sent": false,
  47.       "is_translator": false,
  48.       "profile_link_color": "0094C2",
  49.       "id_str": "6253282",
  50.       "entities": {
  51.         "urls": [
  52.  
  53.         ],
  54.         "hashtags": [
  55.  
  56.         ],
  57.         "user_mentions": [
  58.  
  59.         ]
  60.       },
  61.       "contributors_enabled": true,
  62.       "favourites_count": 20,
  63.       "default_profile": false,
  64.       "url": "http://dev.twitter.com",
  65.       "profile_image_url_https": "https://si0.twimg.com/profile_images/1396428969/twitterapi_normal.png",
  66.       "id": 6253282,
  67.       "utc_offset": -28800,
  68.       "listed_count": 8641,
  69.       "profile_use_background_image": true,
  70.       "lang": "en",
  71.       "followers_count": 561819,
  72.       "profile_text_color": "437792",
  73.       "protected": false,
  74.       "time_zone": "Pacific Time (US & Canada)",
  75.       "geo_enabled": true,
  76.       "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/229557229/twitterapi-bg.png",
  77.       "notifications": false,
  78.       "description": "The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",
  79.       "verified": true,
  80.       "profile_background_color": "e8f2f7",
  81.       "default_profile_image": false,
  82.       "friends_count": 30,
  83.       "profile_background_image_url": "http://a2.twimg.com/profile_background_images/229557229/twitterapi-bg.png",
  84.       "statuses_count": 2928,
  85.       "display_url": null,
  86.       "screen_name": "twitterapi",
  87.       "show_all_inline_media": false,
  88.       "following": true
  89.     },
  90.     "in_reply_to_screen_name": null,
  91.     "place": null,
  92.     "in_reply_to_status_id": null
  93.   },
  94.   {
  95.     "coordinates": null,
  96.     "truncated": false,
  97.     "favorited": false,
  98.     "created_at": "Mon Jun 27 01:21:23 +0000 2011",
  99.     "id_str": "85155733884248066",
  100.     "entities": {
  101.       "urls": [
  102.         {
  103.           "expanded_url": "http://tumblr.com/xnr372fyk4",
  104.           "url": "http://t.co/IcQut5R",
  105.           "indices": [
  106.             108,
  107.             127
  108.           ],
  109.           "display_url": "tumblr.com/xnr372fyk4"
  110.         }
  111.       ],
  112.       "hashtags": [
  113.  
  114.       ],
  115.       "user_mentions": [
  116.  
  117.       ]
  118.     },
  119.     "in_reply_to_user_id_str": null,
  120.     "text": "Tweet delivery delays for streaming clients - We experienced temporary delays but the issue has now been... http://t.co/IcQut5R",
  121.     "contributors": null,
  122.     "in_reply_to_status_id_str": null,
  123.     "id": 85155733884248066,
  124.     "retweet_count": 45,
  125.     "geo": null,
  126.     "retweeted": false,
  127.     "in_reply_to_user_id": null,
  128.     "source": "<a href=\"http://www.tumblr.com/\" rel=\"nofollow\">Tumblr</a>",
  129.     "user": {
  130.       "profile_sidebar_border_color": "0094C2",
  131.       "profile_background_tile": false,
  132.       "profile_sidebar_fill_color": "a9d9f1",
  133.       "name": "Twitter API",
  134.       "expanded_url": null,
  135.       "location": "San Francisco, CA",
  136.       "profile_image_url": "http://a0.twimg.com/profile_images/1396428969/twitterapi_normal.png",
  137.       "created_at": "Wed May 23 06:01:13 +0000 2007",
  138.       "is_translator": false,
  139.       "profile_link_color": "0094C2",
  140.       "id_str": "6253282",
  141.       "follow_request_sent": null,
  142.       "entities": {
  143.         "urls": [
  144.  
  145.         ],
  146.         "hashtags": [
  147.  
  148.         ],
  149.         "user_mentions": [
  150.  
  151.         ]
  152.       },
  153.       "favourites_count": 20,
  154.       "default_profile": false,
  155.       "contributors_enabled": true,
  156.       "url": "http://dev.twitter.com",
  157.       "id": 6253282,
  158.       "utc_offset": -28800,
  159.       "profile_image_url_https": "https://si0.twimg.com/profile_images/1396428969/twitterapi_normal.png",
  160.       "listed_count": 8641,
  161.       "profile_use_background_image": true,
  162.       "lang": "en",
  163.       "followers_count": 561747,
  164.       "profile_text_color": "437792",
  165.       "protected": false,
  166.       "time_zone": "Pacific Time (US & Canada)",
  167.       "notifications": null,
  168.       "geo_enabled": true,
  169.       "description": "The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.",
  170.       "verified": true,
  171.       "profile_background_color": "e8f2f7",
  172.       "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/229557229/twitterapi-bg.png",
  173.       "statuses_count": 2928,
  174.       "default_profile_image": false,
  175.       "friends_count": 30,
  176.       "profile_background_image_url": "http://a2.twimg.com/profile_background_images/229557229/twitterapi-bg.png",
  177.       "display_url": null,
  178.       "screen_name": "twitterapi",
  179.       "following": null,
  180.       "show_all_inline_media": false
  181.     },
  182.     "in_reply_to_screen_name": null,
  183.     "place": null,
  184.     "in_reply_to_status_id": null
  185.   }
  186. ]