Ciprian
Ciprian

Reputation: 3226

Using Twitter API to return number of tweets from an account

I would like to return the total number of tweets an account has using the Twitter API. Anybody know how to do that?

Upvotes: 2

Views: 3975

Answers (2)

bacemail
bacemail

Reputation: 129

Twitter API 1.1 http request to use...

https://api.twitter.com/1.1/users/show.json?screen_name=accountScreenName;

Decode the json...

$jsonOutput = json_decode($jsonData);

Below is where to find number of total tweets from the account...

$jsonOutput->statuses_count;

Upvotes: 0

Mike Buckbee
Mike Buckbee

Reputation: 6983

You haven't specified a language, but per the Twitter API Docs, you call

'/users/show'

The element (json or xml) returned is 'statuses_count' which is the total number of tweets a user has sent.

http://apiwiki.twitter.com/w/page/22554755/Twitter-REST-API-Method:-users%C2%A0show

Upvotes: 3

Related Questions