skip to Main Content

Twitter-api – 403 Forbidden – Tweepy Authentication error when attempting to access tweet/user data with client.get_user()

import tweepy import os api_key = os.getenv('TWI_API_KEY') api_key_secret = os.getenv('TWI_API_KEY_SECRET') bearer_token = os.getenv('TWI_BEARER_TOKEN') access_token = os.getenv('TWI_ACCESS_TOKEN') access_token_secret = os.getenv('TWI_ACCESS_TOKEN_SECRET') client = tweepy.Client(bearer_token=bearer_token, consumer_key=api_key, consumer_secret=api_key_secret, access_token=access_token, access_token_secret=access_token_secret) user_get = client.get_user(username='twitterusers') user_id = user_get.data.id print(user_id) Above, is the code I've written so…

VIEW QUESTION
Back To Top
Search