d60 / twikit

Twitter API Scraper | Without an API key | Twitter Internal API | Free | Twitter scraper | Twitter Bot
https://twikit.readthedocs.io/en/latest/twikit.html
MIT License
1.46k stars 172 forks source link

Question on replies to tweets #219

Open gavenisaweesome opened 2 months ago

gavenisaweesome commented 2 months ago

According to my knowledge twikit only gets posts the user has written, and not replies.

Is there any way to retrieve user replies using twikit?

deepak-coding-art commented 1 month ago

I was also looking into this. I found that it does not give the replies if you are using the GuestClient() but it does give you replies if you use the client with credentials

client = Client('en-US')

await client.login(
        auth_info_1=USERNAME ,
        auth_info_2=EMAIL,
        password=PASSWORD
    )

tweet = await client.get_tweet_by_id(TWITTER_POST_ID)
replies = tweet.replies

for reply in replies:
    print(reply.text)

this will not include all replies in it so if you want more you need to go to next

more_replies = await replies.next()
for reply in more_replies:
    print(reply.text)

According to my knowledge twikit only gets posts the user has written, and not replies.

Is there any way to retrieve user replies using twikit?