Better Programming

Advice for programmers.

Follow publication

Member-only story

How to Scrape Tweets With snscrape

Martin Beck
Better Programming
Published in
5 min readDec 3, 2020

Half of a phone screen showing the Twitter logo that appears as the Twitter app is being opened
Photo by Joshua Hoehne on Unsplash

Overview

Twitter has introduced changes to their API that have rendered various tweet-scraping libraries obsolete. One is GetOldTweets3, which I’ve previously written about. Luckily snscrape has stood out as a library that allows one to scrape tweets without the restrictions of Tweepy.

Due to the undocumented Python wrapper and misunderstandings about its development version, there is still a lot of confusion around this library, as seen in various GitHub issue threads. In this tutorial, I show examples in the hope that they will simplify using this library and reduce the confusion.

Setting Up snscrape

Before downloading snscrape

Snscrape requires at least Python 3.8 or higher. I won’t cover upgrading your Python as there are a multitude of tutorials available online.

Downloading snscrape

When you have the right version of Python, you can now install snscrape.

A simple pip install will suffice, so in your terminal run the command

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Martin Beck
Martin Beck

Written by Martin Beck

Optimistic technologist hoping to create positive change and not the accidental downfall of society. Cloud Engineer, M.S.

Write a response