Introducing the Instagram APIRead more →

X (Twitter) Comments API. Top replies, page by page.

Top replies to a post, with exact counts. We handle the proxies, blocks and platform changes.

In your agent: X (Twitter) MCP server →

X (Twitter) Comments API at a glance

Returns the replies X shows on a public post to visitors who are not signed in, from the post's link or ID. Each reply has its author, text, exact likes, replies, reposts, quotes, bookmarks and views, its media, links and mentions, and the reply it answers. X lists only the replies it ranks first, so the page says how many it left out.

GET /v1/x/comments

Read the API reference
  • 1 credit per page, $0.75–$1.97 per 1,000 pages
  • 16 typed fields null when unknown
  • 20 top replies per page, X's own ranking of the replies, the ones it shows first on top
  • url is all it needs, e.g. https://x.com/WhiteHouse/status/2119797490375606752

Send one request. Get up to 20 top replies back.

Copy the request in your language, or hand it to your agent. Sign up for an API key and your first 100 credits are free.

$ npm install socialtap
url = https://x.com/WhiteHouse/status/2119797490375606752
GET /v1/x/commentsTry in
const params = new URLSearchParams({
  url: "https://x.com/WhiteHouse/status/2119797490375606752",
});
const res = await fetch(`https://socialtap.dev/v1/x/comments?${params}`, {
  headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, page, meta } = body;
console.log(data, meta.credits_charged);
200 OK · GET https://socialtap.dev/v1/x/commentsDocs

One schema on 13 platforms.

The response reference lists every field, its type and when it is null. See the full schema.

  • Null means unknown

    A field X doesn't show is null, never zero or an empty string, so a real zero always means zero.

  • What it accepts

    X post: a link (x.com or twitter.com, /<username>/status/<id> with or without a view such as /photo/1 or a query such as ?s=20, /i/web/status/<id>, /i/status/<id>, /<username>/article/<id>, old /statuses/ and #! links, mobile.twitter.com, fxtwitter.com and vxtwitter.com) or a bare numeric post ID.

  • Write one parser

    X, TikTok, Instagram and 10 more platforms answer in these fields, so the code that reads one reads them all.

platformstring
Platform ID (tiktok, youtube, …).
idstring
Platform-native comment ID (string; Reddit with its t1_ prefix).
post_idstring
ID of the post commented on (equals post.id).
parent_idstring
ID of the comment this replies to; null for top-level comments.
urlstring
Permalink, when the platform has one.
textstring
Comment body as plain text.
authorobject
The commenting account. An account the platform no longer names (a deleted account) has a null id and username and the platform's label as display_name (Reddit: [deleted]).
published_atstring
When the comment was posted, RFC 3339 UTC. Where the platform shows only a relative time ("3 weeks ago"), the latest time that label allows (the fetch time minus the stated amount), listed in approximate_fields.

What teams build with the X (Twitter) Comments API.

  • Read the top reactions to a post

  • Track likes and views on replies

  • Find which accounts reply to a brand

  • Collect reply text for sentiment analysis

Good to know before you build.

  • X shows visitors who are not signed in only the few replies it ranks first, and sometimes none. The page ends with end_reason platform_limit and a warning that says how many of the post's replies are not listed.
  • Replies are in X's own order, the ones it ranks first on top. since and until filter them by published_at.
  • parent_id is null for a direct reply to the post, and names the reply it answers when X threads one reply under another.
  • Repost, quote, bookmark and view counts, language, media and links are in platform_specific.x.
  • A deleted post or one from a suspended account returns not_found. A protected account's post returns private_or_unavailable.

1 credit per page. Failed requests are free.

Buy credits once and spend them on any endpoint, on any platform.

SourcePrice per successful pagePer 1,000 pages
Public page page1 credit$0.75–$1.97
  • Cache hits are free.
  • Credits from packs and top-ups never expire.
  • A monthly plan's credits are spent first, and what is left of them ends at each renewal.
  • Prices exclude tax: sales tax is added at checkout where it applies.
  • Outside the US, plans and packs are sold to businesses: checkout asks for your VAT, GST or other business tax ID.

Questions about the X (Twitter) Comments API.

More in the API reference.

Why does a post with hundreds of replies return only a few?
X shows visitors who are not signed in only the replies it ranks first. We read X logged out, so the response lists those and says how many of the post's replies it left out.
How much does the X (Twitter) Comments API cost?
A page of up to 20 top replies costs 1 credit. Every successful page is charged, empty pages included. SocialTap credits cost $0.75–$1.97 per 1,000, depending on the plan or pack.
How do I get the next page?
Repeat the same request with cursor set to page.next_cursor from the previous response, keeping the other parameters. When page.has_more is false there are no more pages. Cursors expire after 24 hours.

Try it on a link you already have.

Paste it in the playground, or copy the request into your code.

100free credits
  • No credit card
  • Failed requests are free
  • Works on all 276 endpoints
Start for free Read the docs