I am trying to use Twitter API to retrieve threads by the main tweet ID, but it seems like there is no endpoint to achieve this, so is there a way to work around with this to make it work? I have also tried to use search/recent and passing the conversation_id by it returns the comments, not the thread tweets.
Thanks in advance
2
Answers
you should use :
from:{user_id} to:{user_id} conversation_id:{tweet_id}
This will fetch the tweets following the initial tweet of the thread that are sent from the user_id (=author_id) to the user_id. => All the tweets of the thread.
The @Robin’s solution sometimes returns extra tweets(a series of replies by the author to someone’s reply). Using this search query param:
?query=conversation_id:{conversation_id} from:{author_id} to:{author_id}&tweet.fields=author_id,referenced_tweets
you can get
referenced_tweets
data which helps you to reconstruct the thread.Check this sample code