X Thread Context
An X thread connects a post to the message it replies to, earlier messages along that reply chain and the replies that follow, rather than simply grouping posts published around the same time. Keeping those relationships with the post text and author information helps readers follow how a discussion developed and understand the context of an individual message.
X Thread Context API Features
- Read the selected post with its surrounding discussionUse a post link with the X Thread Context API to collect the target message together with earlier public messages along its reply chain and the available replies that follow, giving you context beyond the selected message alone.
- Understand which posts belong together and who replies to whomAlongside text, authors and interaction counts in each X Thread Context API record, conversation_id identifies the conversation a post belongs to and in_reply_to_id identifies the post it directly replies to, giving you links between the individual records.
X Thread Context API Parameters
| Parameters | Required | Description |
|---|---|---|
urls | Required | Required list of public X post links containing /status/ followed by a numeric post ID, such as https://x.com/BaganiTohid/status/2110635249889919362; put one link per line in the Playground or use a JSON urls array, rather than profile or community links. |
results_limit | Optional | Optional maximum context records for each input post, from 1 to 2000, with a default of 100; two post links with a limit of 20 each request up to 20 related records, rather than sharing one total of 20. |
How to Use the X Thread Context API
Every X Thread Context API request starts a background collection task, so its first response gives you a task ID rather than the finished data; use that ID to check progress and retrieve the results.
- Copy the public post link you want to understand with the X Thread Context API and choose how many context records to request for it; if you have several links, put each one in the urls list.
- Before running the example, replace $SOCQ_API_KEY with your own API key or set that environment variable. Send the JSON input to POST /v1/x/thread-context with the Authorization header shown below, then save the task_id from the response.
- Use GET /v1/tasks/{task_id} with the saved ID to check progress. queued means waiting, running means collection is in progress, and retrying means another attempt is underway. Wait for succeeded before reading the results; if the task is failed, read error_message for the reason.
- When the task succeeds, read data.results.items: each item in this list describes one post and its available conversation relationships. An empty list means the task completed without returning any records.
- If data.results.has_more is true, the next_cursor value is the marker for another page of saved results. Copy it unchanged into the cursor parameter of GET /v1/tasks/{task_id}?cursor=... and continue until has_more is false.
curl -X POST "https://api.socq.ai/v1/x/thread-context" \
-H "Authorization: Bearer $SOCQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"urls":["https://x.com/BaganiTohid/status/2110635249889919362"],"results_limit":20}'X Thread Context API Use Cases
- Review a message with the context needed to read it: Place the target post next to the earlier messages and replies returned by the X Thread Context API, including their text and authors, to prepare a reading view for someone checking what the selected message was responding to.
- Build a map of the returned reply relationships: Group X Thread Context API posts by conversation_id and match each in_reply_to_id to another record’s id to draw the reply links that are present, leaving gaps visible when a referenced post was not returned.
- Prepare source material for a conversation summary: Save the post text, author names, times and reply relationships as an ordered reading set for a separate human or software summarization step, rather than expecting a finished summary in the response.
X Thread Context API Pro Tips
- When arranging a discussion for reading, connect posts using their relationship IDs first and use publication time only as supporting context, because a time-sorted list alone does not tell you which message each post answers.
- If in_reply_to_id refers to an ID that is absent from your saved records, keep that reference as a missing link instead of attaching the reply to a different post or inventing the missing text.
- When several submitted links belong to the same conversation, merge saved X Thread Context API results by post ID so a shared earlier post does not appear several times in your reading set.
- If you only need a selected post’s replies, use X Post Replies; if you only need the selected post itself, use X Posts instead of collecting surrounding context.
Related APIs
Beyond the X Thread Context API, use these APIs when you need a different type of public X data.
- Twitter Tweet Scraper API — Retrieve public post text, authors, engagement, media, hashtags, mentions, and conversation relationships from x.com or twitter.com status URLs.
- Twitter User Tweets Scraper API — Collect recent public posts, authors, media, hashtags, mentions, and engagement by username with replies excluded.
- X Post Quotes API — Collect public quote posts for known status URLs with commentary, authors, engagement, media, timestamps, and source-post context.
- X Post Replies API — Collect public replies from X post URLs with selectable ordering, reply text, authors, visible engagement, media, and parent-post context.
- Twitter Mentions API — Collect public posts mentioning a specified account.
- X Community Posts API — Read the public posts shared in a community, with their text, authors and interaction counts.
- Twitter Profile Scraper API
- Twitter Search API
- X Followers List API
- X Following List API
- X Post Retweeters API
- X Trends API
- Twitter User Search API
- X Community API
- X Account Location API
- X Verified Followers API
- X List Tweets API
- Twitter List Members API
- Twitter List Followers API
- X Community Members API
- X Community Moderators API
- X Communities Search API
- X Articles API
- X Spaces API
- Twitter Media Scraper API
- X User Replies API
- Twitter Follow Checker API
- Twitter Video Transcript API