Twitter Data Analysis (Part 1) - Consumer Keys

 Consumer Keys

This will be a step by step guide on how to analyse tweets from a Twitter account. 

Before we start our Twitter Data Analysis, there are a few things we must do in order to allow the search to take place. One of them being getting our Consumer Keys.
This blog will be about understanding what these keys are and why we use them but also a guide on how to get your own keys that you can use the analyse tweets.

Consumer Keys

These are keys that are issued by a service provider (Twitter, Facebook, etc) that consumers receive allowing APIs to access their service. If you're not sure what APIs are, head over to https://medium.com/@perrysetgo/what-exactly-is-an-api-69f36968a41f to find more information about this.

Twitter Consumer Keys:

As we will be analysing tweets from Twitter, its important to understand what keys we will be needing.

There are two types of keys:

1. Consumer Keys - There are two different Consumer Keys, Consumer-Key and Consumer-Secret. These are used to identify the consumer/client and check if the account is valid.

2. Access Token Keys - There are two different AccessToken keys, AccessToken and AccessTokenSecret. These are used to represent the authorisation of a specific application (in this case Twitter) and to also access individual parts of the consumer's data. However, these are only issued once the account has been authorised by the service provider.

How to get these Keys?

To get these keys is relatively simple (assuming you have already logged into your Twitter account). If not, you can go to https://twitter.com/i/flow/signup and sign up for a twitter account. 


Once you have signed up,  go to http://apps.twitter.com and sign up for an app by following their steps.  

(I would suggest you choose the 'Exploring the API' box because that is what we'll be doing)

These steps require you to add a description (does not have to be perfect as you can change it whenever you like), a unique name, recall URL (you can leave this blank), and website URL (any URL would be fine unless you want other users to authenticate through your app).
Once signed up, go to one of your projects and go to the ‘Keys and Tokens’ tab. This is where you will find the 4 keys.

With these keys, you are able to copy and paste your keys into a variable with a suitable name inside your code. This makes it easier for you and other users to understand what is going on throughout the program.


In the next post, we will be discussing what Google Colab is and how to get started with it. In the remainder of the post, we will start our coding!

Be sure to leave a comment on anything you're unsure of, I will try my best to reply ASAP!

Comments

  1. Hi, I have question. what does you mean with "Once signed up, go to one of your projects and go to the ‘Keys and Tokens’ tab. This is where you will find the 4 keys" ? Is it after waiting the application accepted or while waiting ?

    ReplyDelete

Post a Comment

Popular posts from this blog

Twitter Data Analysis (Part 2) - Google Colab

Twitter Data Analysis (Part 3) - Sentiment Analysis