Introducing the Instagram APIRead more →

X (Twitter) User Posts API. Posts, page by page.

Latest or most liked posts with exact counts. We handle the proxies, blocks and platform changes.

In your agent: X (Twitter) MCP server →

X (Twitter) User Posts API at a glance

Returns a public X (formerly Twitter) account's posts from its username, user ID or profile link, latest first or its most liked. Each post has its link, publish time, full text with links written out, hashtags and mentions, photos and videos with every rendition, polls, quoted and reposted posts, the pin, and exact view, like, reply, repost, quote and bookmark counts. Filter to posts with photos or video.

GET /v1/x/posts

Read the API reference
  • 1 credit per page, $0.75–$1.97 per 1,000 pages
  • 23 typed fields null when unknown
  • 100 posts per page, newest first
  • handle is all it needs, e.g. NASA

Send one request. Get up to 100 posts 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
handle = NASA
GET /v1/x/postsTry in
const params = new URLSearchParams({
  handle: "NASA",
});
const res = await fetch(`https://socialtap.dev/v1/x/posts?${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/postsLong arrays and strings are shortened here. Real responses are complete.Docs

One schema on 22 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 account: a username with or without the @ (NASA, @NASA), a numeric user ID (11348282), or a profile link (x.com/NASA or twitter.com/NASA, with or without a tab such as /media, mobile.twitter.com, x.com/i/user/11348282, a Follow-button or intent link such as x.com/intent/user?screen_name=NASA).

  • Write one parser

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

platformstring
Platform ID (tiktok, youtube, …).
idstring
Platform-native post ID (string; Instagram shortcode, Reddit with its t3_ prefix).
urlstring
Canonical post URL.
typestring
Normalized content shape. New values may be added; treat unknown values as other.
platform_typestring
The platform's own product label, lowercase (reel, short, story, live, tweet, …).
titlestring
Headline (YouTube title, Reddit title); null on caption-only platforms.
textstring
Caption, description or body as plain text.
link_urlstring
The page the post links to: a link post's target, a pin's destination, or the page its link card or link sticker opens; null when it links to none.

What teams build with the X (Twitter) User Posts API.

  • Monitor an account for new posts

  • Find an account's most liked posts

  • Compare engagement across an account's posts

  • Collect an account's photos and videos

Good to know before you build.

  • X shows logged-out visitors one of two lists for each account, the same every time: for many organizations their timeline, newest first and paged as far back as X serves it; for most other accounts about a hundred of their most liked posts, in one page.
  • For an account X shows by its most liked posts, sort=newest returns the latest few of its own posts from its profile page, without reposts, and page.end_reason is platform_limit.
  • For an account X shows by its timeline, sort=popular returns that timeline newest first, as sort=newest does.
  • Replies to other accounts are not listed: X shows an account's replies only to signed-in people. Its own threads are, each post on its own.
  • A repost's text, media and counts are the reposted post's, while its id, url, author and published_at are the repost's. platform_specific.x.reposted_post says whose post it is.
  • A protected account returns private_or_unavailable, and a suspended one not_found.

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
Platform API api1 credit$0.75–$1.97
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) User Posts API.

More in the API reference.

Can I get every post an account has made?
For accounts X shows by their timeline, yes, page after page as far back as X serves it. For the others X shows logged-out visitors only their most liked posts and the latest few, and so does this endpoint.
Are reposts included?
Yes, on the timeline, with the reposted post in platform_specific.x.reposted_post. Set media to keep only the account's own posts with photos or video.
How much does the X (Twitter) User Posts API cost?
A page of up to 100 posts 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 an account you know.

Paste its handle or link 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