GET users/lookup

Updated on Wed, 2012-04-18 11:26

Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. The author's most recent status (if the authenticating user has permission) will be returned inline.

This method is crucial for consumers of the Streaming API. It's also well suited for use in tandem with friends/ids and followers/ids.

Resource URL

http://api.twitter.com/1/users/lookup.format

Parameters

screen_name optional

A comma separated list of screen names, up to 100 are allowed in a single request. You are strongly encouraged to use a POST for larger (up to 100 screen names) requests.

Example Values: twitterapi,twitter

user_id optional

A comma separated list of user IDs, up to 100 are allowed in a single request. You are strongly encouraged to use a POST for larger requests.

Example Values: 783214,6253282

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

Extended description

There are a few things to note when using this method.

  • You must be following a protected user to be able to see their most recent status update. If you don't follow a protected user their status will be removed.
  • The order of user IDs or screen names may not match the order of users in the returned array.
  • If a requested user is unknown, suspended, or deleted, then that user will not be returned in the results list.
  • You are strongly encouraged to use a POST for larger requests.

Example Request

GET

https://api.twitter.com/1/users/lookup.json?screen_name=twitterapi,twitter&include_entities=true

  1. [
  2.   {
  3.     "name": "Twitter API",
  4.     "profile_sidebar_border_color": "87bc44",
  5.     "profile_background_tile": false,
  6.     "profile_sidebar_fill_color": "e0ff92",
  7.     "location": "San Francisco, CA",
  8.     "profile_image_url": "http://a3.twimg.com/profile_images/689684365/api_normal.png",
  9.     "created_at": "Wed May 23 06:01:13 +0000 2007",
  10.     "profile_link_color": "0000ff",
  11.     "favourites_count": 2,
  12.     "url": "http://apiwiki.twitter.com",
  13.     "contributors_enabled": true,
  14.     "utc_offset": -28800,
  15.     "id": 6253282,
  16.     "profile_use_background_image": true,
  17.     "profile_text_color": "000000",
  18.     "protected": false,
  19.     "followers_count": 160752,
  20.     "lang": "en",
  21.     "verified": true,
  22.     "profile_background_color": "c1dfee",
  23.     "geo_enabled": true,
  24.     "notifications": false,
  25.     "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.",
  26.     "time_zone": "Pacific Time (US & Canada)",
  27.     "friends_count": 19,
  28.     "statuses_count": 1858,
  29.     "profile_background_image_url": "http://a3.twimg.com/profile_background_images/59931895/twitterapi-background-new.png",
  30.     "status": {
  31.       "coordinates": null,
  32.       "favorited": false,
  33.       "created_at": "Tue Jun 22 16:53:28 +0000 2010",
  34.       "truncated": false,
  35.       "text": "@Demonicpagan possible some part of your signature generation is incorrect & fails for real reasons.. follow up on the list if you suspect",
  36.       "contributors": null,
  37.       "id": 16783999399,
  38.       "geo": null,
  39.       "in_reply_to_user_id": 6339722,
  40.       "place": null,
  41.       "source": "<a href="http://www.tweetdeck.com" rel="nofollow">TweetDeck</a>",
  42.       "in_reply_to_screen_name": "Demonicpagan",
  43.       "in_reply_to_status_id": 16781827477
  44.     },
  45.     "screen_name": "twitterapi",
  46.     "following": false
  47.   },
  48.   {
  49.     "name": "Twitter",
  50.     "profile_sidebar_border_color": "EEEEEE",
  51.     "profile_background_tile": false,
  52.     "profile_sidebar_fill_color": "F6F6F6",
  53.     "location": "San Francisco, CA",
  54.     "profile_image_url": "http://a1.twimg.com/profile_images/878669694/twitter_bird_normal.jpg",
  55.     "created_at": "Tue Feb 20 14:35:54 +0000 2007",
  56.     "profile_link_color": "038543",
  57.     "favourites_count": 2,
  58.     "url": "http://twitter.com",
  59.     "contributors_enabled": true,
  60.     "utc_offset": -28800,
  61.     "id": 783214,
  62.     "profile_use_background_image": true,
  63.     "profile_text_color": "333333",
  64.     "protected": false,
  65.     "followers_count": 3305606,
  66.     "lang": "en",
  67.     "verified": true,
  68.     "profile_background_color": "ACDED6",
  69.     "geo_enabled": true,
  70.     "notifications": false,
  71.     "description": "Always wondering what's happening. ",
  72.     "time_zone": "Pacific Time (US & Canada)",
  73.     "friends_count": 257,
  74.     "statuses_count": 774,
  75.     "profile_background_image_url": "http://s.twimg.com/a/1276896641/images/themes/theme18/bg.gif",
  76.     "status": {
  77.       "coordinates": null,
  78.       "favorited": false,
  79.       "created_at": "Tue Jun 22 16:40:19 +0000 2010",
  80.       "truncated": false,
  81.       "text": "9 cool things to do with your Twitter account (via @pastemagazine) http://bit.ly/c0LdC6",
  82.       "contributors": [
  83.         16739704
  84.       ],
  85.       "id": 16783169544,
  86.       "geo": null,
  87.       "in_reply_to_user_id": null,
  88.       "place": null,
  89.       "source": "web",
  90.       "in_reply_to_screen_name": null,
  91.       "in_reply_to_status_id": null
  92.     },
  93.     "screen_name": "twitter",
  94.     "following": false
  95.   }
  96. ]