Twitter Counter API
The Twitter Counter API allows you to retrieve everything Twitter Counter knows about a certain Twitter username. It uses a simple REST API, which can be called on at the following URL:
http://api.twittercounter.com/
Request parameters
The following parameters are required:
-
twitter_id
: the user's twitter id.
A user's twitter id is NOT his username, but a number! The following won't work:twitter_id=my_username
. Use this instead:twitter_id=1234567
. See examples for more details. apikey
: the API key for Twitter Counter
The following parameters are optional:
output
: can either be JSON or JSONP, default is JSONcallback
: if JSON is selected as output, callback needs to be set to the Javascript method that you would like calledcount
: the number of days for which you would like stats returned (if available). Default (and for now maximum) is 14 days (two weeks)
Response parameters
The Twitter Counter API returns results in either JSON or JSONP (see request parameters). The following parameters are returned by the Twitter Counter API:
version
: the current API versionusername
: Twitter username of the requested userurl
: URL of the request useravatar
: avatar URL of the requested userfollowers_current
: current followers count of the requested userdate_updated
: the latest statistics update for the requested userfollow_days
: the number of days Twitter Counter has been tracking the requested userstarted_followers
: the number of followers when we started tracking the requested usergrowth_since
: the number of followers gained since we started tracking the requested useraverage_growth
: the average growth per day of the requested usertomorrow
: our followers prediction for tomorrow for the requested usernext_month
: our followers prediction for the next month for the requested userfollowers_yesterday
: the number of followers for the previous day for the requested userrank
: the requested user's rank as calculated by Twitter Counterfollowersperdate
: a list of dates and the followers count on that date. The list is formatted like this: date{yyyy-mm-dd} : {followers_count}last_update
: a UNIX timestamp of when this record was last updated
Example usage
http://api.twittercounter.com/?apikey=e9335031a759f251ee9b4e2e6634e1c5&twitter_id=15160529
http://api.twittercounter.com/?apikey=e9335031a759f251ee9b4e2e6634e1c5&twitter_id=15160529&output=jsonp&callback=myCallbackMethod
The following will NOT work (note the username instead of the twitter id):
http://api.twittercounter.com/?apikey=e9335031a759f251ee9b4e2e6634e1c5&twitter_id=TheCounter
Note that all requests must be GET requests.
Rate limiting
By default rate limiting is set to 100 calls per hour per user. If you need more than 100 calls per hour per user contact us explaining how many calls you need and why you need that amount of calls.
HTTP Status Codes
The following status codes are returned by the Twitter Counter API:
- 200 OK: everything was ok, data was returned
- 401 Unauthorized: API credentials are missing or incorrect
- 403 Forbidden: API limit has been reached
- 404 Not Found: the given Twitter id could not be found on Twitter Counter
- 500 Internal Server Error: could not properly load the necessary elements from Twitter Counter
- 503 Service Not Available: Twitter Counter is down or unavailable