Resources

Links to external docs for reference and some recommended tools

Twitter dev docs

Basics

Twitter libraries

See below for mostly Python libraries for interacting with the Twitter API.

Tweepy is a Python library which is a wrapper on the Twitter API - you don't have to worry about writing URLs, handling auth, parsing data, paging and other complex tasks. The library can be used an abstract so you can fetch data and deal with it as Python objects and you can pass data to the API to perform actions like searches or post a status or retweet a status.

  • tweepy.org homepage
  • Tweepy Discord
    • Join here using a Discord account.
    • Ask your question in #support channel.
    • Please check the Tweepy and Twitter docs and search Google / StackOverflow for answers to your question before asking on Discord.
  • Tweepy docs
    • docs.tweepy.org homepage
      • This page is especially useful as a high-level view of the API method groups under API Reference bullet point.
      • Redirects from Tweepy Read the Docs
    • Tweepy API Reference
      • Shows you what methods are available on the api object and what parameters they take.
      • Sometimes the methods on API can be used more conveniently on an object e.g. API.retweet(tweet.id) can be replaced with tweet.retweet().
    • Github repo
      • tweepy/tweepy
    • Highlights

As an alternative to Tweepy, use one of these below. You'll have to install one and configure it with API credentials, then you can do API requests.

Twurl command-line tool

  • Repo: twitter/twurl
  • Command-line tool created by Twitter, like curl for request the Twitter API.
  • Written in Ruby, but you can still use it in your command-line without knowing Ruby.
  • Twitter docs includes a demo using twurl on their homepage.

Python Twitter API wrapper libraries

Python utility scripts and repos

Any searches will have the one-week limitation if doing a search for say hashtags or replies to a tweet. This limit is at the Twitter Search API level.

My Twitter projects

These are projects I created using Tweepy. They have different purposes and levels of complexity. Perhaps they can be of use as inspiration or implementation examples.

  • Twitterverse
    • MichaelCurrin/twitterverse on Github
    • docs site
    • One of my oldest Python projects. It covers fetching of tweets, users, trends, country data and storing them in a SQLite database. Plus there is some dabbling in user auth flow and streaming.
    • However, the repo has become large and unwieldily. So I am limiting new development on it.
  • Trends dashboard
    • michaelcurrin.pythonanywhere.com/
    • Built on my Twitterverse repo, I run a nightly cron job to get trending data by town or country and store that in a database.
    • The content is shown on a web app, based on filters I chose.
    • Hosted for free, thanks the amazing pythonanywhere.com service.
  • Boris the Baby Bot
  • Whoopi Goldbot
    • @WhoopiGoldbot
    • A parody bot account I made for my friends' entertainment.
    • Whoopi tweets the gold price daily, with some Whoopi Goldberg quote and sometimes a photo or GIF.