How to read the replies to a tweet programmatically
By Steven Van ·
Unif API's free endpoint reads public X replies with no key, sorted by engagement or time, 20 per page, capped at 20 lookups per 10 minutes.
Unif API has published a free endpoint that returns the public replies to any X post as JSON or Markdown. It needs no login, account or API key, and it is rate-limited per visitor. The announcement says it covers a gap: FxTwitter, vxTwitter and the syndication endpoint read a single post, and X's own page loads replies with JavaScript, so curl gets an empty shell.
The request
A GET request to https://unifapi.com/tools/x/replies takes an id parameter, which can be the numeric post ID or the full x.com or twitter.com URL. The response holds the original post (author, text, metrics, conversation ID) and a list of replies. Each reply includes the author, text, metrics, media, creation time and inReplyToPostId. Because direct and nested replies both appear, the thread can be rebuilt as a tree.
Sorting and paging
- sort=top (the default) orders by likes plus reposts plus replies, roughly like X's "Most relevant" tab.
- sort=recent orders newest first.
- Replies come 20 per page. Pass the returned nextCursor back as cursor to continue, and treat cursors as opaque strings.
- format=md returns the original post and each reply as a Markdown block with author, text, metrics and URL.
Limits
The free limit is 20 lookups per 10 minutes per visitor across every /tools/x/* endpoint, and a search counts as two. A post with 262 replies takes about 14 pages, so the post suggests reading the X-RateLimit-Remaining header and stopping once there is enough. A 429 response carries Retry-After and the URL where the cap is lifted.
Only public replies are returned. Replies from protected accounts and deleted replies are missing, so the count on the original post can be higher than what is readable. Quote posts are not included, since they are separate posts. Volume, history and guarantees come with the metered X / Twitter API, which is pay as you go with a workspace key and uses the same field names.
Suggested uses
The post sketches three: a reaction summary built from the top page of 20 replies, a complaint feed that polls sort=recent every 10 minutes and flags replies whose likes climb between polls, and a thread reconstruction that walks all pages and nests replies by inReplyToPostId.
