user17540557
user17540557

Reputation:

Twitter API: Stream encountered HTTP error: 403

I'm trying to use the Twitter API in Python. I got elevated access, set up my app in the Developer Portal, and authenticated OAuth 1.0.

When I write code I always receive the following error: Stream encountered HTTP error: 403. What am I doing wrong?

import tweepy 

api_key = "" 
api_key_secret = ""
access_token = ""
access_token_secret = ""

stream = tweepy.Stream(api_key,api_key_secret, access_token, access_token_secret)
stream.filter(track=["President"])```

Upvotes: 2

Views: 586

Answers (1)

anon
anon

Reputation:

You will need to use Twitter API v2 for this (Tweepy supports it, but you will need to update your code). Regardless of elevated access, after April 29 2022, new applications can no longer access v1.1 streaming.

New Twitter Developer Apps:

will not be able to gain access to v1.1 statuses/sample and v1.1 statuses/filter

https://twittercommunity.com/t/deprecation-announcement-removing-compliance-messages-from-statuses-filter-and-retiring-statuses-sample-from-the-twitter-api-v1-1/170500

Also answered here.

Upvotes: 0

Related Questions