Resources
Links to external docs for reference and some recommended tools
Twitter dev docs
- Twitter Developer docs home
- Twitter apps page to manage your dev account's apps once you login
- Twitter libraries recommended by Twitter, across programming languages
- API Reference
Basics
- Getting Started
- Things every developer should know
- Authentication
- Response codes guide
- Including HTTP Status Codes, Error Messages and Error Codes.
Twitter libraries
See below for mostly Python libraries for interacting with the Twitter API.
Tweepy links
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 withtweet.retweet()
.
- Shows you what methods are available on the
- Github repo
- Highlights
- api.py
- models.py
- streaming.py
- auth.py
- test_api.py (useful to see how a method is used for the internal Tweepy tests)
- docs.tweepy.org homepage
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
- twython
- python-twitter
- Twitter libraries section of Twitter docs - see Python section under Community libraries.
Python utility scripts and repos
- gmellini/twitter-scraper
- Get replies using Twitter Search API.
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
- MichaelCurrin/boris-the-babybot on Github
- @boristhebabybot
- A bot account I made for a friend's book.
- Boris tweets a message daily using a random combination of some messages, hashtags and emojis.
- 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.