What’s currently trending? And where?

Real-time Twitter Map with JavaScript, Python, and Kafka

Stream Tweets on a live map

Techletters
An Idea (by Ingenious Piece)
3 min readSep 2, 2020

--

You know what’s currently trending? And where in the world? Well, I don’t… but Twitter does.

Twitter Tweets on a live map.

In 2019 Twitter had 330 million users from which 145 million were active daily. 500 million tweets were submitted per day which makes 5.787 tweets a second (source). That’s a hell of data. How amazing would it be to visualize the Tweets on a map in real-time to see what is trending and where? I will show you how!

Real-time Twitter Map

Background

I was playing around with Tweepy, an easy to use Python library for accessing Twitter Data. While playing around and printing some Tweets to my console, I thought about how to display those Tweets on a Map. But not simply showing Tweets back from 2014. I wanted to visualize the Tweets on a Map as they appear — in real-time.

Luckily the Twitter API offers a real-time Streaming API, and so does Tweepy — it provides an easy to use wrapper around. One can easily stream Tweets based on hashtags, keywords or locations.

--

--