Twitter API Adds Retweet Count and More

Curtis C. Chen, August 30th, 2010

TwitterTwitter recently added more data to each tweet it returns via the API. Now your applications can access the number of retweets, whether you have retweeted a tweet and additional information about the user who wrote the tweet. The new information used to require subsequent calls to the Twitter API, or perhaps looking up a cached value from your own database.

Twitter Developer Advocate Matt Harris announced the four new data fields on the Twitter developer mailing list. The fields include:

  • statuses/retweet_count (integer) – number of times a status has been retweeted using the Twitter retweet action. May not exist for older Tweets, or when this feature is disabled (see below).
  • statuses/retweeted (boolean) – true if the user you are authenticating as has retweeted this status.
  • users/listed_count (integer) – number of public lists in which the user appears.
  • users/follow_request_sent (boolean) – true if the user you are authenticating as has requested to follow the user you are viewing.

Unfortunately, some bugs were identified in retweet_count and that feature has been disabled for now.  Because Twitter sometimes turns features off to maintain site stability, it recommends that you always write your app code to handle missing fields or empty values.

All these new fields also exist in the Twitter Streaming API, except for the retweeted count, which has no meaning in that context.  The Twitter Search API does not support the new fields.

dev.twitter.com

One more change: the users/showmethod was changed to return an HTTP 403 error (instead of 404) when an account has been suspended.  This change was made in response to users who wanted to distinguish between deleted and suspended accounts.  Calling users/showon a suspended user will return the error message “User has been suspended,” which indicates the account still exists on Twitter.  Deleted accounts will return “Not found.”

Complete documentation should be available soon at http://dev.twitter.com.

Hat tip: Damon Cortesi

Tags: Twitter
Both comments and pings are currently closed.

4 Responses to “Twitter API Adds Retweet Count and More”

August 31st, 2010
at 12:05 pm
Comment by: Nueva API de Twitter agrega un contador de retweets | conecti.ca

[...] ProgrammableWeb » Artículos Relacionados en [...]

December 16th, 2010
at 11:58 pm
Comment by: Amit Singh

Hi Matt,

I am having one query..

After retweet, The Boolean value Retweeted not changing it is always constant to false but it is updated to twitter site not on the API side.

Please let me know the reason..

Thanks in advance….

Amit

January 22nd, 2011
at 2:03 am
Comment by: Quora

Is it possible to get a count of the replies and retweets for a particular tweet?…

I see what you mean and it should work but I was thinking in a solution like using statuses/retweeted (http://blog.programmableweb.com/2010/08/30/twitter-api-adds-retweet-count-and-more/) but it doesn’t seem to work anymore……

December 7th, 2011
at 10:55 am
Comment by: Twitter Page suspended « My Blog

[...] Twitter API Adds Retweet Count and More (programmableweb.com) [...]

Follow the PW team on Twitter

ProgrammableWeb
APIs, mashups and code. Because the world's your programmable oyster.

John Musser
Founder, ProgrammableWeb

Adam DuVander
Executive Editor, ProgrammableWeb. Author, Map Scripting 101. Lover, APIs.