Conversation id
Conversation threads using the X API
If you look at how conversations evolve on X, one Post can spark several conversation threads, each of which can grow in length and complexity as more people chime in. Identifying relationships between Posts and understanding conversation threads is a feature of the X API v2 payload and search capabilities. When Posts are posted in response to a Post (known as a reply), or in response to a reply, there is now a defined conversation_id
on each reply, which matches the Post ID of the original Post that started the conversation.
Replies to a given Post, as well as replies to those replies, are all included in the conversation stemming from the single original Post. Regardless of how many reply threads result, they will all share a common conversation_id
to the original Post that sparked the conversation. Using the X API v2, you can retrieve and reconstruct an entire conversation thread, allowing you to understand what is being said and how conversations and ideas evolve.
Example conversation thread
Below is an example conversation thread involving five different people, including one reply to a reply.
Retrieving conversation_id
as a tweet.fields
parameter
To request the conversation_id
for all Posts returned on a v2 endpoint, add the tweet.fields=conversation_id field to the request parameters. The conversation_id field is always the Post ID of the original Post in the conversation reply thread. All Posts within the same reply thread, including reply threads that are created from earlier reply threads, will show the same conversation_id.
Request with conversation_id
parameter
Response
Using conversation_id
as a filter operator
The conversation_id
can be used as a search query parameter in recent search or as an operator within a rule for filtered stream. This will return the entire conversation thread of Posts either in real-time through filtered stream or in reverse chronological order from search Tweets. You can also get a count of the Posts in a conversation using this operator with Posts counts.
Request to query by conversation_id
Response
Note: Results for search Posts are in reverse chronological order.