13.13 Twitter Streaming API

Twitter’s free Streaming API sends to your app randomly selected tweets dynamically as they occur—up to a maximum of one percent of the tweets per day. According to InternetLiveStats.com, there are approximately 6000 tweets per second, which is over 500 million tweets per day.23 So the Streaming API gives you access to approximately five million tweets per day. Twitter used to allow free access to 10% of streaming tweets, but this service—called the fire hose—is now available only as a paid service. In this section, we’ll use a class definition and an IPython session to walk through the steps for processing streaming tweets. Note that the code for receiving a tweet stream requires creating a custom class that inherits ...

Get Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and The Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.