DatAfrik Blog

Register now for the  October, 7th  Data BootCamp!

If you’re like me, you must have one time or the other tried to access the Twitter API and do some cool stuff. Maybe automate creating a tweet, or sending a DM with a line of code or even something as cool as building a bot that performs daily tasks for you on Twitter.

That you can relate means you’re at the right place. I won’t bore you with all the complexities surrounding why our lives are boring and we are here coding instead of going outside to touch grass. You probably don’t have anything better to do, but I value your time so let’s get right into it.

Before I forget, if you don’t know what an API is or you’re quite unsure if you should trust what you know, then this article will get you sorted out before we get a little bit more technical. If you, however, do not have the time, which is very unlikely, an API is sort of like a middleman between you and (in this case) Twitter. So you send a request to an API, which in turn relays your request to Twitter and then fetches a response from Twitter and gives it back to you.

This article is intended for learners who have a little bit of knowledge about Python programming and APIs, so I assume that you do. If you do not, please take this introductory course on Python.

 

Twitter API

The Twitter API can be used to programmatically retrieve and analyze Twitter data, as well as build for the conversation on Twitter.

This API allows you to find and retrieve, engage with, or create a variety of different resources including the following:

  • Tweets
  • Users
  • Spaces
  • Direct Messages
  • Lists
  • Trends
  • Media
  • Places

What the above chunk of text is trying to say in layman’s term is that the Twitter API allows you to create, delete, follow, retweet, block and basically manipulate tweets and users using code instead of doing it through the GUI provided by the Twitter app and website. This method provides a lot of functionalities and automation that the basic app would not permit.

v1.1 and v2

Currently, there are two versions of the Twitter API available for individual users. The much outdated v1.1 which was introduced in 2012 and would most likely be deprecated in the future, and the very recent and preferable v2, which is said to include a modern foundation, plus some new and advanced features. Twitter recommends that all users start with v2 as this is where all future innovation will happen. For this reason, we’d follow Twitter’s advice and discuss more on v2. However, we would still touch on v1.1 to get the full picture of all that’s available to you.

Access Levels

Bots, datasets, freedom, innovation, the four nations lived together in harmony. Then, everything changed when Elon Musk attacked. Only the Avatar, master of all four elements, could stop him… but seriously, before the introduction of the world’s richest man (sometimes), you could do everything with the Twitter API, without limitations, for free. You could build multiple bots, query any amount of tweet and turn them into datasets, integrate Twitter feed into your website, and even automate pulling and posting tweets as many times in a day as possible, all for FREE.

But then comes in Elon Musk and now you have to pay through your teeth to do even the most basic things. However little, lets discuss the different access levels available to you right now.

Free

To use the Twitter API for free, you’re only allowed to create tweets if you’re using the v2 and upload media if you’re using the v1.1. What this means in essence is that, considering we’re focusing on the Twitter API v2, we can only create (post) tweets using the Twitter API. That’s all we’re allowed to do! Very sad indeed. We are unable to retweet, extract tweets to analyze, unfollow users, send a DM and do basically all the cool stuff with the FREE access level.

On top of that, we’re limited to 1500 tweets per month, 1 Project, and 1 App per Project (we’d get to this in a different article). I’d assume that you won’t be paying for this so we’d focus more on the FREE tier briefly, but before that, let me explain what other access levels exist, incase you might want to spend the little money you have saved in the bank.

Basic

According to the official Twitter page, subscribing to the BASIC plan allows you to pull tweets for analysis, unlike the FREE plan. However, comments from users on YouTube show that even with the BASIC plan, for $100, you’re still limited to just creating tweets without being able to pull tweets for maybe sentiment analysis. The only difference here is that the BASIC plan allows you to create about 3000 tweets per month, and make up to 2 Apps for your Project.

Pro

The PRO plan allows you to do even more, with 300k tweets per month, 1M tweet pulls, 3 Apps per Project, Filtered stream API, Access to full-archive search (whatever that means). I most likely will never find out because I most definitely won’t be paying $5000 per month to be a ‘PRO‘ user.

Enterprise

Not much detail is given for this level except that it’s for the money launderers, because how else can you afford to pay between $42,000 to $210,000+ monthly just to use Twitter’s API. For this reason (I don’t promote crime), I won’t be going further into this access level.

Conclusion

That’s all you need to know about the Twitter API and their access levels. If you’d like to learn how to query the Twitter API and create your first tweet programmatically, stick around for the next article. To create a Twitter Developer Account, you can check out this article.

By James Gabriel

SENIOR DATA ANALYST, WITH OVER 5 YEARS OF EXPERIENCE IN THE AUTOMOBILE, RETAIL, TECH AND EDUCATION INDUSTRIES. POSSESS EXTENSIVE EXPERIENCE IN BUSINESS AND PEOPLE ANALYTICS WITH PROFICIENCY IN PYTHON, R, TABLEAU, POWER BI, AND ALL DIALECTS OF SQL. WHEN I'M NOT GENERATING INSIGHTS FROM BIG DATA, I'M TUTORING AND MENTORING A GROUP OF PROFESSIONAL DATA ANALYSTS.

8 thoughts on “All You Need To Know About Twitter API”
  1. Hey would youu mind stating which blog platform you’re using?
    I’m looking to start myy own blog soonn but I’m having a hard time
    deciding between BlogEngine/Wordpress/B2evolution and Drupal.
    Thee reason I ask is because your layout seems different then moost bpogs and I’m looking for something unique.
    P.S Sorry for being off-topic but I had to ask! https://telegra.ph/Online-Gambling-Laws-and-Regulations-in-Iceland-06-11

Leave a Reply

Your email address will not be published. Required fields are marked *