Unable to like a tweet with using Tweepy and Twitter/X v2 API

30 Views Asked by At

I'm trying to implement a simple twitter bot using v2 of twitter's API, I can create a tweet, but I get this error when I try to like one enter image description here

I have my account set to read-write as seen below enter image description here

I've even had to revoke and generate my credentials three times now, but I'm still unable to like a tweet, please I need help guys. Here is my script

import tweepy

API_KEY = "API_KEY"
API_SECRET = "API_SECRET"
BEARER_TOKEN = "BEARER_TOKEN"

ACCESS_TOKEN = "ACCESS_TOKEN"
ACCESS_TOKEN_SECRET = "ACCESS_TOKEN_SECRET"

client = tweepy.Client(
    BEARER_TOKEN,
    API_KEY,
    API_SECRET,
    ACCESS_TOKEN,
    ACCESS_TOKEN_SECRET
)

client.create_tweet(text = "Hello, world!")
# client.like(tweet_id="1772016568446095848")
0

There are 0 best solutions below