Twitter has several different APIs but the Streaming and Search APIs are the ones to take note of.
The Search API lets developers write code to automate searches for tweets by keyword, topic, author, language, location. According to Twitter, their Search API only returns a sample of Tweets from the past 7 days. The Search API is rate limited – meaning you can only perform 180 searches every 15 minutes. For humans that might seem like a lot but this is a constraint to developers.
“The sampling is focused on relevance and not completeness. This means that some Tweets and users may be missing from search results. If you want to match for completeness you should consider using a Streaming API instead.”
The Streaming API is used when developers want to access current tweet data. The public sample contains about 1% of tweets. In GNIP, the enterprise version, there is a streaming API which will give you 10% of all public tweets (also called the Decahose – enough to be statistically significant). Then there is the paid access to every tweet sent ever by anyone in the entire history of time (also known as Twitter’s Firehose). Very few projects need or get access to this.
JSON data format
Accessing Twitter’s API
In order to access Twitter’s API, you need to register as a developer and obtain API keys. Go to(note: all you need is a mobile number, you don’t really have to be a developer or register a real app) and get a set of Consumer Keys.
This will allow you to access Twitter’s Search and Streaming APIs, as well as post tweets. If you wish to send direct messages or add to Twitter lists, you’ll need to get Access Tokens as well.
1. Using Blockspring
If you’re not a developer, you can use Blockspring to query and extract data from the API. With your API keys, go to(PAID, with 14 days free trial).
After obtaining your API keys, you will need to get the Tweet ID for whichever tweet you wish to look up. The Tweet ID refers to the string of 18 numbers behind the URL of any the tweet which you can find by right clicking on the three dots and select Copy Link to Tweet.
If it’s just one tweet that you want to check, you can use the open console on Blockspring’s website which will return the full results from Twitter’s API. Say I want to look up the number of faves and retweets. Look for this block -> “
Type in the Tweet ID, hit run and look for Favourite_Count and Retweet_Count. You can see that both numbers tie exactly with the figures on my tweet.
Using Blockspring in a Spreadsheet
You can perform more powerful Blockspring functions such as “Get info about a user”, “Get users’ last 200 tweets”, “Add to list”, “Fave”, “Retweet”, “Follow”, “Unfollow” in bulk using Google Sheets – go to Google Sheets, install the add-on and run the block there. If you’re more comfortable with spreadsheets than with code, you will fall in love with Blockspring. Be warned, it’s seriously addictive!
Here are some screenshots:
Get a User’s Info on Twitter
Get a User’s Followers – and follow them in bulk by copying and pasting a formula!
Get a User’s Latest Tweets – and like and retweet in bulk!
2. Using Twitter’s API Console
The Twitter website also has an API console where you can make pretend like you’re a real developer and make an API call (how cool does that sound!)
Go to the. Don’t let the GET/ POST jargon or the user unfriendly output format put you off. It’s pretty intuitive. Look for Get/statuses/show(id)json, enter the tweet ID and you will get the same results that I showed you via Blockspring.
3. Twitter client for MAC
A third way is if you have the new Twitter client for MAC, where the developer console allows you to view Tweet JSON, right from your computer.
Open up the developer console or click on View Tweet JSON and you’ll get exactly what the API console shows.
There you go! Three ways in which you can access Twitter’s API without being a developer or knowing any code!
If you haven’t, do read my previous post on What Analytics do you get from Twitter’s API!