Introducing the Instagram APIRead more →

X (Twitter) Community Posts API. Top posts and media, page by page.

Top posts and media with exact counts. We handle the proxies, blocks and platform changes.

In your agent: X (Twitter) MCP server →

X (Twitter) Community Posts API at a glance

Returns a public X (formerly Twitter) Community's posts from its link or ID: its top posts, or its recent photos and videos. Each post has its link, author, publish time, full text with links written out, hashtags and mentions, photos and videos with every rendition, polls, quoted posts, and exact view, like, reply, repost, quote and bookmark counts.

GET /v1/x/community_posts

Read the API reference
  • 1 credit per page, $0.75–$1.97 per 1,000 pages
  • 23 typed fields null when unknown
  • 30 top posts and media per page, X's own ranking: Top's posts as X ranks them, Media's as X arranges its grid; neither is by time
  • url is all it needs, e.g. https://x.com/i/communities/1493446837214187523

Send one request. Get up to 30 top posts and media 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/i/communities/1493446837214187523
GET /v1/x/community_postsTry in
const params = new URLSearchParams({
  url: "https://x.com/i/communities/1493446837214187523",
});
const res = await fetch(`https://socialtap.dev/v1/x/community_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/community_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

    The community: its link on x.com or twitter.com (x.com/i/communities/<id>, any of its views such as /about, /latest or /media included, mobile hosts and any query too) or its numeric ID.

  • 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) Community Posts API.

  • Find what a community is talking about

  • Collect the photos and videos shared in a community

  • Spot the most engaged posts and authors of a niche

  • Track a community's top posts over time

Good to know before you build.

  • Logged-out visitors see a community's Top tab, the posts X ranks highest, and its Media tab, both in X's order rather than by time.
  • Each tab comes in one page, so page.end_reason is always platform_limit.
  • X shows the Latest tab only to signed-in people, so a community's full history is not available.
  • Set media to read the Media tab: any for every post on it, image or video for one kind.
  • A small community can have no posts on its Top tab, and the list is then empty.
  • A community that never existed and one X removed both return not_found.
  • Communities that take members by approval or invitation show their posts to everyone, so none 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
Any source1 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) Community Posts API.

More in the API reference.

Can I get every post of a community, newest first?
No. X lists a community's latest posts only to signed-in people. Logged out it shows the top posts and the media tab, and so does this endpoint.
Can I get a community's members?
X lists members only to signed-in people. The community endpoint returns the member count, the admin and the few members X shows on the community's page.
How much does the X (Twitter) Community Posts API cost?
A page of up to 30 top posts and media 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