Does anyone know if it is still possible to collect the number of followers for a given Twitter account using the free version of the Twitter v2 API (after Feb 9th, 2023)?
I tried getting access to the API using the following code, but got the followin error:
import tweepy
import requests
# Replace with your own keys and tokens
API_KEY = 'persnal key'
API_SECRET_KEY = 'persnal key'
ACCESS_TOKEN = 'persnal key'
ACCESS_TOKEN_SECRET = 'persnal key'
# Authenticate using your keys and tokens
auth = tweepy.OAuthHandler(API_KEY, API_SECRET_KEY)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
# Create the API object
api = tweepy.API(auth)
def get_followers_count(screen_name):
user = api.get_user(screen_name=screen_name) # Update this line
return user.followers_count
# Replace 'screen_name' with the desired Twitter account's screen name
screen_name = 'account_x'
followers_count = get_followers_count(screen_name)
print(f'The number of followers for {screen_name} is: {followers_count}')
Error: Forbidden: 403 Forbidden 453 - You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve