UnitedTweet.png

Source: Manchester United Official Twitter Page

As one can see from the picture on the first page, I am a big Manchester United fan. United got a pretty lucky win against Villarreal in the Champions League on the 29th September. In this blog, I would like to share some findings from different fan reactions on twitter about the game. It is recommended that one has a basic Python programming experience and understanding on Application Programming Interface (API).

SETUP

What is Application Programming Interface (API) ?

Application Programming Interface (API) is a software intermediary that allows softwares to communicate among each other. In layman's terms, API is a translator that sends a command to the the software and the software will act on that. For example, you can request the software that they want data with specific requirements. One can request other actions like updating, deleting and posting to the software through API.

Rest-API.png

Source: REST API - Author: Seobility - License: CC BY-SA 4.0

For further details, please go to this link. "What is An API and How Does It Work?" - Towards Data Science

Which API are we using today ?

We use Twitter API to extract data from Twitter with a specific search requirement. The Twitter API is a set of programmatic endpoints that can be used to learn from and engage with the conversation on Twitter. This API allows one to find and retrieve, engage with, or create a variety of different resources including Tweets, Users, Trends.

SETUP

1/ Register a Twitter Developer account for access

2/ Takes 1-2 business days to get approve from Twitter

3/ Generate tokens (API Key, API Key Secret, Access Token, Access Token Secret) Please keep it to yourself.

image003.png

image004.png

For step by step setup, please go this link. "Beginners Guide - How to apply for a Twitter Developer account" - Sumedh Patkar

What Library do we use ?

We use Tweepy, an easy-to-use Python library for accessing the Twitter API. The API class provides access to entire Twitter API methods. Simply speaking, Tweepy is a user-friendly library to get what one want from Twitter.