I want to access Twitter’s archive without being restricted by rate limits or number of queries. I don’t mind paying for this, so my plan was to sign up for the premium package on Twitter’s API platform. As I’m familiar with Tweepy, I had hoped to be able to access the API in my usual way.
However, it seems that the only way I can query the API with premium credentials in Python is through the Python Twitter Search API, which is basically a python wrapper for the premium service. The issue is that the authentication protocols for premium access are not the same as for the rate-limited free access. This is most annoying, as the searchtweets
library that supports the Python Twitter Search API seems fairly primitive, and I can make practically no sense of the docs.
Does anyone know whether it is possible to use Tweepy to access premium tier for Twitter? It’s kinda weird that the better tools only work on the free tier.
2
Answers
That is not true. You can use the same credentials (assuming you get authorized by Twitter) for both the Standard Search and the Premium Search.
The TwitterAPI python wrapper supports both — https://github.com/geduldig/TwitterAPI
Tweepy now supports the premium API as discussed here. I had to install from github rather than pip. See the documentation for API.search_30_day and API.search_full_archive and the corresponding documentation for the premium search APIs.
The
api
is different.api.search
becomesapi.search_full_archive
orapi.search_30_day
.