O'Reilly logo

Python Social Media Analytics by Michal Krystyanczuk, Siddhartha Chatterjee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

REST API Search endpoint

The search query requires the authorized connection to the search endpoint: https://api. Twitter .com/1.1/search/tweets.json

There are many data extraction functionalities of the endpoint, depending on the query format and additional parameters. For our case, we will build the following query:

premier league -filter:retweets AND -filter:replies 

Here:

  • premier league is a combination of two keywords,
  • -filter:retweets lets us get rid of all retweets in the extraction results
  • -filter:replies filters all replies to the tweet often unnecessary for the analysis

It is worth noticing that the query construction contains logical operator AND between two -filter statements.

Each endpoint has a set of additional parameters, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required