Streaming API via tweetstream package Python worked fine, but now returns 'Access Denied'


I’m using the Streaming API via the Tweetstream package in Python. Basically what I’m dong is collecting tweets in a certain geographical area. I understand that Twitter returns a sample instead of all and that there are other limitations. Initially all worked fine except for a few lost connections (possible because at night the number of tweets in the area might have been zero for a long time). Anyways a few days a go, I received an ‘Access Denied’ when I tried to run the same program. Using a friends twitter Id didn’t resolve it, so I’m guessing it is IP related.

Either way, I have no clue what I did wrong, nor did I receive any message that I actually did something wrong. My question is two-fold:

  • How can I regain access?
  • How can I know what caused this, so I can avoid it in the future?



Does the Tweetstream package rely on Basic auth (specifically, were you authenticating with a username and password)? Basic auth support for streaming was disabled this week.

You will need to use a library which supports OAuth - Tweepy supports this for example. You can tell an app uses OAuth if you copy a consumer key / secret and access token / secret to configure it, rather than using a username and password.


Hi Arne,

I indeed used my own username and password, so if Basic auth has been disabled this week, it all makes sense, now.

I don’t know by heart whether TweetStream supports OAuth, but if it doesn’t I’ll give Tweepy a try.

Thanks for the clarification.



How did you go with Tweepy? I need to shift from Tweetstream unless the issue gets resolved within next week or so. Was it easy to cross over?