Twitter API User Bulk Lookup!

UPDATE: Of course you’ll need to upgrade to do the OAuth dance now to make these calls. Back when this post was written, the HTTP Basic Authentication option was still available to developers.

The Twitter API Team introduced a new method this evening that will be incredibly useful.

You can now batch user lookups by username or ID with one call:

$ curl -u username:password


$ curl -u username:password 

both return:

<?xml version=”1.0″ encoding=”UTF-8″?>
<users type=”array”>
<name>Damon Clinkscales</name>
<location>Austin, TX</location>
<description>Father. Husband. Friend. Connector. Helper. Programmer. VitalSource. Podlabs. Austin on Rails.  Cafe Bedouins. SnapTweet. DoesFollow. WhereBeYou.</description>
<created_at>Wed Feb 07 19:41:27 +0000 2007</created_at>
<time_zone>Central Time (US &amp; Canada)</time_zone>
<created_at>Thu Mar 11 07:33:18 +0000 2010</created_at>
<text>Damon, what are you doing up, you may ask…why, I’m programming the @twitterapi. so far, our diabolical plan w/ the little one is &quot;working&quot;</text>
<source>&lt;a href=&quot;; rel=&quot;nofollow&quot;&gt;Tweetie&lt;/a&gt;</source>
<location>Austin, TX</location>
<description>Software ideas, realized.</description>
<created_at>Sun Nov 11 05:57:50 +0000 2007</created_at>
<time_zone>Central Time (US &amp; Canada)</time_zone>
<created_at>Wed Mar 10 17:02:41 +0000 2010</created_at>
<text>@willie Oh, THAT Death Star. I was thinking about a different floating orb evil empire. I’m glad to hear you think it’s much improved.</text>
<source>&lt;a href=&quot;; rel=&quot;nofollow&quot;&gt;Tweetie&lt;/a&gt;</source>

Two issues come immediately to mind that this helps out with:

  1. Search API user ids still do not match REST API user ids. So with this, you could pull search results and map the screen name to the REST API user id. The fact that you can do this in bulk will save billions of calls. 🙂
  2. The so-called Social Graph methods, where you can pull a Twitter users’ friend list or following list as a big list of IDs are extremely useful, although they have, to date, only supported IDs in the responses. So with this new call, you could take a social graph of IDs and run them through this bulk lookup to get the screen name. Once you have the screen name, you can create links to the user’s twitter profile, for one thing. This bulk lookup also returns the entire User resource, so at that point you’ve got everything.

Great change. Nice work, Twitter API guys!

Idea #2: Twitter Lists “What Others Think of You” Cloud

Use the list names (take each word between the hyphens) and group them together into a group. So this is a fun little site to see what others think about you. And if the person is popular at all, you should pretty quickly hone in on some key factors about the person.

So for example…these are the lists that I’ve been added to as of November 2009:


Looking at this, you can probably surmise that I’m in Austin, work with Ruby and Rails, and am a programmer.

Now, due to the Twitter AJAX page loading, you don’t get all of the lists in one shot. You get 20 at a time. Therefore, it is difficult to quickly scan all lists and form an opinion without some help. This is especially true for people featured on hundreds of lists. So, the tool would grab all the lists (yes, you have to cursor through, but it shouldn’t be too bad) and break down the words into a frequency list.

Then take the word list and say that any word that appears more than 10% of the time must be important. Some kind of metric. You could filter out known services like conversationalist or favstar. You could run the words through a dictionary.

I’m surprised someone hasn’t done this already. But I’m just saying it’d be really useful if you could type in someone’s name and get a quick read on what others think of them.

Known Implementations:


DoesFollow Adds Twitter List Support!

With the recent introduction of Twitter Lists, Twitter has given us a great new way to discover folks on Twitter. Each list can have up to 500 members. If you’re wondering if you or someone else is on a specific list, we’re back to paging through to find the answer, just like we used to do with followers (before launched last summer).

I was poking around the lists I’ve been added to and I happened to notice that @damon had been followed by @Scobelizer‘s Twitter Tools and Devs list. Interesting. So I started paging through trying to see if he had added my most popular apps. He had added SnapTweet, but I didn’t find DoesFollow.

I realized at that moment, what we all really needed was a simple Twitter List membership check:

Home Screen:

twitter lists membership check

Result Screen:

twitter lists membership check

Please give it a try and let me know if you have any feedback!