anyone knows how to get a the relys for a specific tweet by it’s ID maybe? i been trying but can’t find any on the tweepy docs not discord’s, can’t seem to find anything about how to do it with twitter api v2, also is there a way to requests latest tweets from multiple users in bulk?
import tweepy
twitter_client = tweepy.Client(bearer_token=bearer)
all_tweets = twitter_client.get_users_tweets(id=(1334299956241461248,1346973288040263680,154449778,1516418305455763466))
print(all_tweets)
this is how i try it, but it’s returning me an error
The `id` query parameter value [(1334299956241461248, 1346973288040263680, 154449778, 1516418305455763466)] is not valid
any help appreiciated, and thank you
2
Answers
and i found the answer at the end
you can find more info about making a query at https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query
You’re asking two questions:
For 1 – you can search for Tweets by conversation ID. The conversation ID is the ID of the original Tweet that led to the replies. The only wrinkle here is that by default (v2 Essential access) you can only search for Tweets within the past 7 days, so if the Tweet you want replies for is older than that, you’ll need Academic access for full archive search.
For 2 – you cannot pass multiple values to the
id
parameter all at once. If you look at the Tweepy documentation and at the Twitter API docs, you’ll see thatid
gets substituted into the URL path for the call, so you have to call the API multiple times, one for each user ID. That should be possible using a loop.