I tried several times but it seems sometimes API doesn’t return data/returns error for tweets. An example -

curl "/2/tweets/search/recent?query=conversation_id%3A1555965008076496896" -H "Authorization: Bearer $BEARER_TOKEN"

This doesn’t return any data of the search though as you can see there’s replies in this tweet - boudoinkeith/status/1555965008076496896

Because 1555965008076496896 is already a reply to 1555954463420125189, you can’t use it as a conversation_id. The conversation_id for 1555965008076496896 is 1555954463420125189.

So you would have to search for conversation_id:1555954463420125189 and then reconstruct the thread from the results yourself to figure out what “replies to replies” you need in case that’s what you’re looking for.

1 Like

O my god thanks so much. How did I miss that. That really explains it all.

1 Like

Btw, is it possible to get the conversation id from a reply id? Like how I faced, user only inputs the reply link, I want to be able to get the conversation/tweet this reply belongs to.

1 Like

yeah, each tweet will have a conversation_id field too, you can include it with tweet.fields - and also referenced_tweets.id expansion helps to have too Using fields and expansions | Docs | Twitter Developer Platform

Yeah that’s exactly what i tried doing. But the result is empty though. I tried doing it with the reply id. Try - Twitter API Playground

Oh, that one still uses the reply ID, when it should be the one from conversation_id like this: Twitter API Playground

Yeah that’s exactly what I meant. How do I get the conversation id if I only have the reply id? Is there a way to get conversation id from reply id? Users might submit reply id and I will need to get the conversation id which I can’t get from user.

I tried to check if the conversation_id is there in v1 tweets API but it seems it isn’t. There’s in_reply_to_status_id_str but it doesn’t work as conversation_id. What I need to have is -

  1. User inputs a reply link.
  2. Backend finds the conversation_id of that reply so that I can filter all replies of the reply.

Is it possible?

You would look up the tweet with tweet.fields, specifying referenced_tweets.id expansion - however, this seems to disappear if the original conversation is deleted.