Analytics With Twitter API Using Postman
Vložit
- čas přidán 23. 07. 2024
- Hello All You Data Miners out there!!!
This article is about running Twitter API using Postman.
Twitter in one social media that is a juicy stew of data… even the US president uses them. Well, guess what, you can mine the data from Twitter and perform simple to technical analytics. You can run algorithm to understand the demography of a what sell best from Wal-Mart and customer feedback. Or you can go to the darker side by running algorithm to determine which Twitter account is just fake account, which exposes incorrect information to their users and results to the spread of malicious content.
Any how before you can run you have to walk, this article will give you exposure on how to setup a Twitter API key (assuming that you have a Twitter account), and how to get the Authentication Bearer using OAuth2 using Access Key and Access Secret. I will show you how to use a cURL command in Postman.
Just a insight into Postman. Postman is a free Google Chrome application for testing API calls. And if you marry these two together you get an awesome analytics tool.
This article is not about these light and dark side of the algorithm. Its about giving you a primer or a kick start into how to get started with your adventure in data mining with Twitter using Postman.
But keep in mind of what Yoda said... "If Once You Start Down The Dark Path, Forever Will It Dominate Your Destiny."
Cheers!!!
Postman:
www.postman.com/downloads/
Twitter Developers:
/ en
Twitter Documents:
/ docs
Twitter Documents For Follow Search and Get Users:
/ overview
Twitter Documents For OAuth2 Authentication
/ overview
--
Like Us: / xybernetics-inc-426520...
Follow Us: / xyberneticsinc
Connect with Us: / admin
Also find us on:
www.xybernetics.com
#twitter, #api, #twitterapi, #curl,, #postman, - Věda a technologie
I am doing on browser. How to run curl command there to authenticate. Pls tell
Thank you Rabi! Found this really helpful.
We appreciate your feedback.
Thank you for this video. Can you tell me how to extract username along with author_id. I have been trying hard to include username in my Twitter data which now has only author_id. I tried expansions for user.field (I am using historical archive - academic track).
author_id are also part of the twitter response. You have to add the following query string with the GET request after which you will get the author_id.
?ids=1112092628829475628&tweet.fields=attachments,author_id,created_at,public_metrics,source&expansions=attachments.media_keys&media.fields=public_metrics,duration_ms
The output will come our somewhat like this.
{
"data": {
"attachments": {
"media_keys": [
"18_1211784756384740096"
]
},
"author_id": "24720947572",
"id": "1112092628829475628",
"referenced_tweets": [........
Great help, thank you.
Awesome!!
Thanks!! I have been trying to use Twitter APIs for quite a while now!
Appreciate your comment.
I hope you get to do more data mining using Twitter.
Just curious, what will you be using the Twitter API for? I have been socializing this question to all my buddies.
@@RabiGurungXybernetics I have been using Postman and Twitter's API to make a little app that will grab a random Tweet from a 50Km radius around you
@@johngalvez7422 How will you be using that data?
@@RabiGurungXybernetics I was just thinking I could share it with my friends and possibly make an app and upload it to my website!
@@johngalvez7422 Brilliant concept. If you need help, please let me know. I will try my best to answer them. Do you have GitHub account?
Hey Rabi. Found this very helpful!
Is it possible to use Postman to analyze who journalists on Twitter are interacting with? I want go get a better understanding of the so called echo chamber for journalists. So are journalists interacting with fellow journalists or "normal" citizens? That is basically my research question. Can I use Postman to answer that for me?
Thank you!
Absolutely.
You can get all the recent tweet using this command. api.twitter.com/2/tweets/search/recent
You can read more about this from the link below.
developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent
But note that you can query only 180 request in 15minutes timeframe.
Are you familiar with Python? If you are you can run sentiments analysis for every sentence. Maybe I am just getting ahead of my curve, but yes you can trace and track all chats for a particular tweet.
I hope that helps.
@@RabiGurungXybernetics Thank you for your answer! Your first link is not working. Nice to hear that it is possible for me to do that! But this is the first time, I am working with these sorts of programs, so I really dont know how to use them - unfortunately. But is it possible to track tweets from the last year? Or what is the time frame? I am not familiar with Python at all, but I have heard that it is a program, I should be using. Again, thanks for your help - it is appreciated.
I am getting a 403 response after sending the request. Any idea on why is this happening?
Eeek!
The error 403 means that you do not have access to that webpage resources.
Make sure you have entered the right user credentials. That will fix it 9 out of 10 time.
Hope that helps!
Thanks a lot for sharing
Thanks for leaving a comment.
Can you please share the code of extracting followers from twitter. I don't want millions few thousands are ok. I'm trying so hard for days but haven't succeeded yet.
I do not have a script per se. It are mostly Postman request.
hey i need a help Follower analytics after the user joins our app - Show who the user followers are, what time they are most active, what kind of topics they tweet, top 5 influential followers
Awesome idea for my next video.
I am pretty sure there other would also be interested how it can be done. Will share the script or cURL command when I get around it.
Rabi Gurung pls share the code
@@soujanyareddy5352 Will do.
Using node
@@soujanyareddy5352 We have not decided which script to use. Still on the schedule/planning stage.