Retrieving Replies to a Tweet from the Original Author

Question:
What alternative solution can be suggested apart from the code I have already attempted?
Solution:
By utilizing Twitter API v2, you have the option to retrieve Tweets belonging to a specific conversation thread through the use of conversation ID.
Question:
Is there any way to specifically obtain replies to a Tweet/TwitterThread that are only from the author of the original tweet?


Question:

My objective is to obtain
tweet replies
solely from the author of a specific Tweet or TwitterThread. At present, I am successful in retrieving all the responses related to a particular Tweet via the search endpoint.

curl --request GET --url 'https://api.twitter.com/2/tweets/search/recent?query=conversation_id:1373848915464785920&tweet.fields=in_reply_to_user_id,author_id,created_at,conversation_id' --header 'Authorization: Bearer $BEARER_TOKEN' 

The provided code fetches all the responses, whereas I require solely the responses from the original author.

The code above’s documentation link can be found at: https://developer.twitter.com/en/docs/twitter-api/conversation-id, for your reference.


Solution:

To specify the author in a query, use “(from:username)” where “username” is replaced with the actual username. For instance, if the query is “apples -filter:replies”, you can include the author of the tweet by using “apples (from:username) -filter:replies”.

Frequently Asked Questions

Posted in Api