You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
453 - You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product
The text was updated successfully, but these errors were encountered:
453 - You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product
use it this way
# Twitter API keys
bearer_token = "YOUR_BEARER_TOKEN"
client = tweepy.Client(bearer_token=bearer_token)
# Fetch tweets using the v2 API
user_id = client.get_user(username='justinbieber').data.id
tweets = client.get_users_tweets(user_id, max_results=100, tweet_fields=["created_at", "public_metrics", "text"])
tweets_data = []
for tweet in tweets.data:
tweets_data.append({
"created_at": tweet.created_at,
"text": tweet.text,
"retweet_count": tweet.public_metrics["retweet_count"],
"like_count": tweet.public_metrics["like_count"],
})
df = pd.DataFrame(tweets_data)
df.to_csv("refined_tweets_v2.csv", index=False)
print("Tweets saved successfully!")
Getting below error
453 - You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product
The text was updated successfully, but these errors were encountered: