Hi Kyle,

There are few bulk operations available with the Twitter API today,
but there is one that I think will be useful for you:

GET http://api.twitter.com/1/users/lookup.xml (or JSON) - takes
comma-separated list of up to 100 user ids or screen names, such as:

http://api.twitter.com/1/users/lookup.xml?screen_name=dougw,raffi,episod,themattharris,mccv

Example return:

<?xml version="1.0" encoding="UTF-8"?>
<users type="array">
<user>
  <id>819797</id>
  <name>Taylor Singletary</name>
  <screen_name>episod</screen_name>
  <location>iPhone: 37.781868,-122.400377</location>
  <description>Reality Technician, Developer Advocate at Twitter, a
total goblin</description>
  
<profile_image_url>http://a1.twimg.com/profile_images/992899978/goblin-avatar_normal.png</profile_image_url>
  <url>http://bit.ly/5w7P88</url>
  <protected>false</protected>
  <followers_count>1536</followers_count>
  <profile_background_color>000000</profile_background_color>
  <profile_text_color>000000</profile_text_color>
  <profile_link_color>731673</profile_link_color>
  <profile_sidebar_fill_color>007ffe</profile_sidebar_fill_color>
  <profile_sidebar_border_color>bb0e79</profile_sidebar_border_color>
  <friends_count>1459</friends_count>
  <created_at>Wed Mar 07 22:23:19 +0000 2007</created_at>
  <favourites_count>333</favourites_count>
  <utc_offset>-28800</utc_offset>
  <time_zone>Pacific Time (US &amp; Canada)</time_zone>
  
<profile_background_image_url>http://a3.twimg.com/profile_background_images/19651315/fiberoptics.jpg</profile_background_image_url>
  <profile_background_tile>true</profile_background_tile>
  <profile_use_background_image>true</profile_use_background_image>
  <notifications>false</notifications>
  <geo_enabled>true</geo_enabled>
  <verified>false</verified>
  <following>false</following>
  <statuses_count>6627</statuses_count>
  <lang>en</lang>
  <contributors_enabled>false</contributors_enabled>
  <status>
    <created_at>Thu Jul 01 19:35:34 +0000 2010</created_at>
    <id>17515859885</id>
    <text>Great tutorial on building an iPhone Twitter client using
Appcelerator: http://bit.ly/cU8MAK</text>
    <source>&lt;a href=&quot;http://www.tweetdeck.com&quot;
rel=&quot;nofollow&quot;&gt;TweetDeck&lt;/a&gt;</source>
    <truncated>false</truncated>
    <in_reply_to_status_id></in_reply_to_status_id>
    <in_reply_to_user_id></in_reply_to_user_id>
    <favorited>false</favorited>
    <in_reply_to_screen_name></in_reply_to_screen_name>
    <geo/>
    <coordinates/>
    <place/>
    <contributors/>
  </status>
</user>
<user>
  <id>8285392</id>
  <name>raffi</name>
  <screen_name>raffi</screen_name>
  <location>San Francisco, California</location>
  <description>Tinkering, writing, engineering, and breaking things as
the tech lead of @twitterapi.</description>
  
<profile_image_url>http://a1.twimg.com/profile_images/364041028/raffi-headshot-casual_normal.png</profile_image_url>
  <url>http://www.mehack.com/</url>
  <protected>false</protected>
  <followers_count>3429</followers_count>
  <profile_background_color>C0DEED</profile_background_color>
  <profile_text_color>333333</profile_text_color>
  <profile_link_color>0084B4</profile_link_color>
  <profile_sidebar_fill_color>DDEEF6</profile_sidebar_fill_color>
  <profile_sidebar_border_color>C0DEED</profile_sidebar_border_color>
  <friends_count>469</friends_count>
  <created_at>Sun Aug 19 14:24:06 +0000 2007</created_at>
  <favourites_count>47</favourites_count>
  <utc_offset>-28800</utc_offset>
  <time_zone>Pacific Time (US &amp; Canada)</time_zone>
  
<profile_background_image_url>http://s.twimg.com/a/1277771427/images/themes/theme1/bg.png</profile_background_image_url>
  <profile_background_tile>false</profile_background_tile>
  <profile_use_background_image>true</profile_use_background_image>
  <notifications>false</notifications>
  <geo_enabled>true</geo_enabled>
  <verified>false</verified>
  <following>true</following>
  <statuses_count>2567</statuses_count>
  <lang>en</lang>
  <contributors_enabled>false</contributors_enabled>
  <status>
    <created_at>Thu Jul 01 19:51:20 +0000 2010</created_at>
    <id>17516700269</id>
    <text>RT @themattharris: Working on some @twitterapi slides with
@raffi for the meetup at @hackerdojo tonight.
http://t.co/d1jDJm8</text>
    <source>web</source>
    <truncated>false</truncated>
    <in_reply_to_status_id></in_reply_to_status_id>
    <in_reply_to_user_id></in_reply_to_user_id>
    <favorited>false</favorited>
    <in_reply_to_screen_name></in_reply_to_screen_name>
    <retweeted_status>
      <created_at>Thu Jul 01 19:49:15 +0000 2010</created_at>
      <id>17516590921</id>
      <text>Working on some @twitterapi slides with @raffi for the
meetup at @hackerdojo tonight. http://t.co/d1jDJm8</text>
      <source>web</source>
      <truncated>false</truncated>
      <in_reply_to_status_id></in_reply_to_status_id>
      <in_reply_to_user_id></in_reply_to_user_id>
      <favorited>false</favorited>
      <in_reply_to_screen_name></in_reply_to_screen_name>
      <geo/>
      <coordinates/>
      <place xmlns:georss="http://www.georss.org/georss";>
        <id>2b6ff8c22edd9576</id>
        <name>SoMa</name>
        <full_name>SoMa, San Francisco</full_name>
        <place_type>neighborhood</place_type>
        <url>http://api.twitter.com/1/geo/id/2b6ff8c22edd9576.json</url>
        <attributes/>
        <bounding_box>
          <georss:polygon>37.76893497 -122.42284884 37.76893497
-122.3964 37.78752897 -122.3964 37.78752897
-122.42284884</georss:polygon>
        </bounding_box>
        <country code="US">The United States of America</country>
      </place>
      <contributors/>
    </retweeted_status>
    <geo/>
    <coordinates/>
    <place/>
    <contributors/>
  </status>
</user>
<user>
  <id>1401881</id>
  <name>Doug Williams</name>
  <screen_name>dougw</screen_name>
  <location>San Francisco, CA</location>
  <description>Platform at Twitter</description>
  
<profile_image_url>http://a3.twimg.com/profile_images/712777637/dougw_avatar_normal.jpg</profile_image_url>
  <url>http://www.igudo.com</url>
  <protected>false</protected>
  <followers_count>340514</followers_count>
  <profile_background_color>9ae4e8</profile_background_color>
  <profile_text_color>000000</profile_text_color>
  <profile_link_color>0000ff</profile_link_color>
  <profile_sidebar_fill_color>e0ff92</profile_sidebar_fill_color>
  <profile_sidebar_border_color>87bc44</profile_sidebar_border_color>
  <friends_count>558</friends_count>
  <created_at>Sun Mar 18 06:42:26 +0000 2007</created_at>
  <favourites_count>293</favourites_count>
  <utc_offset>-28800</utc_offset>
  <time_zone>Pacific Time (US &amp; Canada)</time_zone>
  
<profile_background_image_url>http://a1.twimg.com/profile_background_images/2752608/twitter_bg_grass.jpg</profile_background_image_url>
  <profile_background_tile>false</profile_background_tile>
  <profile_use_background_image>true</profile_use_background_image>
  <notifications>false</notifications>
  <geo_enabled>true</geo_enabled>
  <verified>false</verified>
  <following>true</following>
  <statuses_count>6255</statuses_count>
  <lang>en</lang>
  <contributors_enabled>false</contributors_enabled>
  <status>
    <created_at>Thu Jul 01 19:06:27 +0000 2010</created_at>
    <id>17514246433</id>
    <text>@jazzychad it's more about preparation and respect; making
sure we're not wasting one another's time.</text>
    <source>&lt;a href=&quot;http://twitter.com&quot;
rel=&quot;nofollow&quot;&gt;Tweetie for Mac&lt;/a&gt;</source>
    <truncated>false</truncated>
    <in_reply_to_status_id>17514014562</in_reply_to_status_id>
    <in_reply_to_user_id>6633812</in_reply_to_user_id>
    <favorited>false</favorited>
    <in_reply_to_screen_name>jazzychad</in_reply_to_screen_name>
    <geo/>
    <coordinates/>
    <place/>
    <contributors/>
  </status>
</user>
<user>
  <id>9160152</id>
  <name>Mark McBride</name>
  <screen_name>mccv</screen_name>
  <location>Santa Clara</location>
  <description>Twitter Platform Dev</description>
  
<profile_image_url>http://a1.twimg.com/profile_images/1040354738/mark-mcbride-thumb_normal.jpg</profile_image_url>
  <url>http://tardigra.de</url>
  <protected>false</protected>
  <followers_count>1557</followers_count>
  <profile_background_color>D9CEB2</profile_background_color>
  <profile_text_color>746c45</profile_text_color>
  <profile_link_color>75A190</profile_link_color>
  <profile_sidebar_fill_color>E8DBCC</profile_sidebar_fill_color>
  <profile_sidebar_border_color>99B2B7</profile_sidebar_border_color>
  <friends_count>331</friends_count>
  <created_at>Sat Sep 29 16:10:54 +0000 2007</created_at>
  <favourites_count>141</favourites_count>
  <utc_offset>-28800</utc_offset>
  <time_zone>Pacific Time (US &amp; Canada)</time_zone>
  
<profile_background_image_url>http://a3.twimg.com/profile_background_images/57101051/xf355ef479a60ee9f1614c3eaf95c4dd.png</profile_background_image_url>
  <profile_background_tile>true</profile_background_tile>
  <profile_use_background_image>false</profile_use_background_image>
  <notifications>false</notifications>
  <geo_enabled>true</geo_enabled>
  <verified>false</verified>
  <following>true</following>
  <statuses_count>1965</statuses_count>
  <lang>en</lang>
  <contributors_enabled>false</contributors_enabled>
  <status>
    <created_at>Thu Jul 01 18:22:19 +0000 2010</created_at>
    <id>17511702981</id>
    <text>Desired current status: http://bit.ly/9uoVbi</text>
    <source>&lt;a href=&quot;http://www.tweetdeck.com&quot;
rel=&quot;nofollow&quot;&gt;TweetDeck&lt;/a&gt;</source>
    <truncated>false</truncated>
    <in_reply_to_status_id></in_reply_to_status_id>
    <in_reply_to_user_id></in_reply_to_user_id>
    <favorited>false</favorited>
    <in_reply_to_screen_name></in_reply_to_screen_name>
    <geo/>
    <coordinates/>
    <place/>
    <contributors/>
    <annotations/>
  </status>
</user>
<user>
  <id>777925</id>
  <name>Matt Harris</name>
  <screen_name>themattharris</screen_name>
  <location>San Francisco</location>
  <description>Developer Advocate at Twitter. Also a hacker and
British expat who is married to @cindyli and lives in San
Francisco.</description>
  
<profile_image_url>http://a1.twimg.com/profile_images/554181350/matt_normal.jpg</profile_image_url>
  <url>http://themattharris.com</url>
  <protected>false</protected>
  <followers_count>1059</followers_count>
  <profile_background_color>C0DEED</profile_background_color>
  <profile_text_color>333333</profile_text_color>
  <profile_link_color>0084B4</profile_link_color>
  <profile_sidebar_fill_color>DDEEF6</profile_sidebar_fill_color>
  <profile_sidebar_border_color>C0DEED</profile_sidebar_border_color>
  <friends_count>299</friends_count>
  <created_at>Sat Feb 17 20:49:54 +0000 2007</created_at>
  <favourites_count>102</favourites_count>
  <utc_offset>-28800</utc_offset>
  <time_zone>Tijuana</time_zone>
  
<profile_background_image_url>http://s.twimg.com/a/1277242272/images/themes/theme1/bg.png</profile_background_image_url>
  <profile_background_tile>false</profile_background_tile>
  <profile_use_background_image>true</profile_use_background_image>
  <notifications>false</notifications>
  <geo_enabled>true</geo_enabled>
  <verified>false</verified>
  <following>true</following>
  <statuses_count>2940</statuses_count>
  <lang>en</lang>
  <contributors_enabled>false</contributors_enabled>
  <status>
    <created_at>Thu Jul 01 19:49:15 +0000 2010</created_at>
    <id>17516590921</id>
    <text>Working on some @twitterapi slides with @raffi for the
meetup at @hackerdojo tonight. http://t.co/d1jDJm8</text>
    <source>web</source>
    <truncated>false</truncated>
    <in_reply_to_status_id></in_reply_to_status_id>
    <in_reply_to_user_id></in_reply_to_user_id>
    <favorited>false</favorited>
    <in_reply_to_screen_name></in_reply_to_screen_name>
    <geo/>
    <coordinates/>
    <place xmlns:georss="http://www.georss.org/georss";>
      <id>2b6ff8c22edd9576</id>
      <name>SoMa</name>
      <full_name>SoMa, San Francisco</full_name>
      <place_type>neighborhood</place_type>
      <url>http://api.twitter.com/1/geo/id/2b6ff8c22edd9576.json</url>
      <attributes/>
      <bounding_box>
        <georss:polygon>37.76893497 -122.42284884 37.76893497
-122.3964 37.78752897 -122.3964 37.78752897
-122.42284884</georss:polygon>
      </bounding_box>
      <country code="US">The United States of America</country>
    </place>
    <contributors/>
  </status>
</user>
</users>

On Thu, Jul 1, 2010 at 1:11 PM, Kyle Bragger <kyle.brag...@gmail.com> wrote:
>
> Hey all —
>
> Building a tool for Forrst that allows users to find each other on
> Forrst based on who they're following on Twitter. Essentially they
> authenticate with OAuth, I grab a list of user ids that they follow
> (friends/ids), but then somewhat inelegantly, I have to make N
> requests to users/show, one for each user id. Doing it this way is
> going to run me right into a wall for every user who has >= 150
> friends. Is there a way to batch this, e.g. to get user data by ids en
> masse, or do I need to ask for whitelisting?
>
> Thanks
> Kyle

Reply via email to