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.
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
- 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
urlis 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 socialtapurl = https://x.com/i/communities/1493446837214187523const 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);import os
import requests
res = requests.get(
"https://socialtap.dev/v1/x/community_posts",
params={"url": "https://x.com/i/communities/1493446837214187523"},
headers={"x-api-key": os.environ["SOCIALTAP_API_KEY"]},
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error']['code']}: {body['error']['message']}")
data, page, meta = body["data"], body["page"], body["meta"]
print(data, meta["credits_charged"])require "json"
require "net/http"
uri = URI("https://socialtap.dev/v1/x/community_posts")
uri.query = URI.encode_www_form('url' => 'https://x.com/i/communities/1493446837214187523')
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = ENV.fetch("SOCIALTAP_API_KEY")
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
body = JSON.parse(res.body)
raise "#{body["error"]["code"]}: #{body["error"]["message"]}" unless res.is_a?(Net::HTTPSuccess)
pp body["data"]
puts body["meta"]["credits_charged"]<?php
$query = http_build_query([
'url' => 'https://x.com/i/communities/1493446837214187523',
]);
$ch = curl_init('https://socialtap.dev/v1/x/community_posts?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('SOCIALTAP_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body['data']);
echo $body['meta']['credits_charged'], PHP_EOL;package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
)
func main() {
q := url.Values{}
q.Set("url", "https://x.com/i/communities/1493446837214187523")
req, err := http.NewRequest("GET", "https://socialtap.dev/v1/x/community_posts?"+q.Encode(), nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("x-api-key", os.Getenv("SOCIALTAP_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
var body struct {
Data json.RawMessage `json:"data"`
Page json.RawMessage `json:"page"`
Meta map[string]any `json:"meta"`
Error *struct {
Code string `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
log.Fatal(err)
}
if body.Error != nil {
log.Fatalf("%s: %s", body.Error.Code, body.Error.Message)
}
fmt.Println(string(body.Data), body.Meta["credits_charged"])
}curl -G 'https://socialtap.dev/v1/x/community_posts' \
--data-urlencode 'url=https://x.com/i/communities/1493446837214187523' \
-H "x-api-key: $SOCIALTAP_API_KEY"{
"data": [
{
"approximate_fields": [],
"author": {
"avatar_url": "https://pbs.twimg.com/profile_images/1857124042433572864/iMivVaYP.jpg",
"display_name": "Marc Köhlbrugge",
"id": "641633",
"is_verified": true,
"url": "https://x.com/marckohlbrugge",
"username": "marckohlbrugge"
},
"coauthors": [],
"duration_ms": null,
"hashtags": [],
"id": "2115557010884190648",
"is_nsfw": false,
"is_pinned": null,
"is_sponsored": null,
"language": "en",
"link_url": null,
"media": [
{
"alt_text": null,
"duration_ms": null,
"expires_at": null,
"height": 1904,
"thumbnail_url": null,
"type": "image",
"url": "https://pbs.twimg.com/media/HVv0YX9XsAAZsE4.jpg?name=orig",
"width": 2560
}
],
"mentions": [
"marckohlbrugge"
],
"metrics": {
"comment_count": 104,
"like_count": 471,
"quote_count": 8,
"repost_count": 17,
"save_count": 279,
"share_count": null,
"view_count": 53342
},
"platform": "x",
"platform_specific": {
"x": {
"article": null,
"author_metrics": {
"follower_count": 90512,
"following_count": 978,
"post_count": 50321,
"total_like_count": null,
"total_view_count": null
},
"author_verified_type": null,
"card": null,
"cashtags": [],
"community": {
"id": "1493446837214187523",
"name": null
},
"conversation_id": "2115557010884190648",
"edit_post_ids": [
"2115557010884190648"
],
"is_author_blue_verified": true,
"is_edited": false,
"links": [
{
"title": "buildinpublic.com",
"url": "http://buildinpublic.com"
},
{
"title": "buildinpublic.com/projects",
"url": "https://buildinpublic.com/projects"
}
],
"media_variants": [],
"poll": null,
"quoted_post": null,
"quoted_post_id": null,
"reply_to_author": null,
"reply_to_post_id": null,
"reposted_post": null,
"reposted_post_id": null,
"source": null
}
},
"platform_type": "post",
"published_at": "2026-10-28T21:31:11Z",
"text": "My goal for http://buildinpublic.com is to become the definitive database of all makers and their projects\n\nTo that end, you can now add your projects to http://buildinpublic.com\n\nTo verify ownership and get the verified checkmark, just add the <meta name=\"twitter:creator\" conten…",
"thumbnail_url": "https://pbs.twimg.com/media/HVv0YX9XsAAZsE4.jpg?name=orig",
"title": null,
"type": "image",
"unknown_fields": [],
"url": "https://x.com/marckohlbrugge/status/2115557010884190648"
},
{
"approximate_fields": [],
"author": {
"avatar_url": "https://pbs.twimg.com/profile_images/2004458322930376704/t_qQ_45_.jpg",
"display_name": "Chinonso Monyei",
"id": "2004137663499247616",
"is_verified": true,
"url": "https://x.com/Lyx_Sol",
"username": "Lyx_Sol"
},
"coauthors": [],
"duration_ms": null,
"hashtags": [],
"id": "2113310143836234045",
"is_nsfw": false,
"is_pinned": null,
"is_sponsored": null,
"language": "en",
"link_url": null,
"media": [
{
"alt_text": null,
"duration_ms": null,
"expires_at": null,
"height": 877,
"thumbnail_url": null,
"type": "image",
"url": "https://pbs.twimg.com/media/HVP6AzqXoAA5KVv.png?name=orig",
"width": 518
},
{
"alt_text": null,
"duration_ms": null,
"expires_at": null,
"height": 862,
"thumbnail_url": null,
"type": "image",
"url": "https://pbs.twimg.com/media/HVP8Sg-WUAAodw8.png?name=orig",
"width": 545
}
],
"mentions": [],
"metrics": {
"comment_count": 16,
"like_count": 203,
"quote_count": 1,
"repost_count": 42,
"save_count": 3,
"share_count": null,
"view_count": 1846
},
"platform": "x",
"platform_specific": {
"x": {
"article": null,
"author_metrics": {
"follower_count": 2304,
"following_count": 1850,
"post_count": 17586,
"total_like_count": null,
"total_view_count": null
},
"author_verified_type": null,
"card": null,
"cashtags": [],
"community": {
"id": "1493446837214187523",
"name": null
},
"conversation_id": "2113310143836234045",
"edit_post_ids": [
"2113310143836234045"
],
"is_author_blue_verified": true,
"is_edited": false,
"links": [
{
"title": "myobim.me",
"url": "https://myobim.me"
}
],
"media_variants": [],
"poll": null,
"quoted_post": null,
"quoted_post_id": null,
"reply_to_author": null,
"reply_to_post_id": null,
"reposted_post": null,
"reposted_post_id": null,
"source": null
}
},
"platform_type": "post",
"published_at": "2026-10-22T16:42:56Z",
"text": "Some people aren't looking for advice.\n\nThey're just tired of being the strong one.\nTired of explaining themselves.\nTired of saying \"I'm fine\" because explaining the truth feels exhausting.\n\nI built Obim for the moments when you just need somewhere to put it all down.\n\nA place to…",
"thumbnail_url": "https://pbs.twimg.com/media/HVP6AzqXoAA5KVv.png?name=orig",
"title": null,
"type": "carousel",
"unknown_fields": [],
"url": "https://x.com/Lyx_Sol/status/2113310143836234045"
},
{
"approximate_fields": [],
"author": {
"avatar_url": "https://pbs.twimg.com/profile_images/1837702446938050566/3gZjXxWV.jpg",
"display_name": "Insan",
"id": "1816455490186117121",
"is_verified": false,
"url": "https://x.com/_insan18",
"username": "_insan18"
},
"coauthors": [],
"duration_ms": null,
"hashtags": [],
"id": "2113891439725920696",
"is_nsfw": false,
"is_pinned": null,
"is_sponsored": null,
"language": "en",
"link_url": null,
"media": [
{
"alt_text": null,
"duration_ms": null,
"expires_at": null,
"height": 3122,
"thumbnail_url": null,
"type": "image",
"url": "https://pbs.twimg.com/media/HVYNB86aQAAf0Xs.jpg?name=orig",
"width": 4096
}
],
"mentions": [],
"metrics": {
"comment_count": 13,
"like_count": 203,
"quote_count": 0,
"repost_count": 8,
"save_count": 154,
"share_count": null,
"view_count": 7801
},
"platform": "x",
"platform_specific": {
"x": {
"article": null,
"author_metrics": {
"follower_count": 7499,
"following_count": 1195,
"post_count": 6159,
"total_like_count": null,
"total_view_count": null
},
"author_verified_type": null,
"card": null,
"cashtags": [],
"community": {
"id": "1493446837214187523",
"name": null
},
"conversation_id": "2113891439725920696",
"edit_post_ids": [
"2113891439725920696"
],
"is_author_blue_verified": false,
"is_edited": false,
"links": [],
"media_variants": [],
"poll": null,
"quoted_post": null,
"quoted_post_id": null,
"reply_to_author": null,
"reply_to_post_id": null,
"reposted_post": null,
"reposted_post_id": null,
"source": null
}
},
"platform_type": "post",
"published_at": "2026-10-24T07:12:48Z",
"text": "Calendar Look Dashboard 📅",
"thumbnail_url": "https://pbs.twimg.com/media/HVYNB86aQAAf0Xs.jpg?name=orig",
"title": null,
"type": "image",
"unknown_fields": [],
"url": "https://x.com/_insan18/status/2113891439725920696"
}
],
"page": {
"has_more": false,
"next_cursor": null,
"next_cursor_expires_at": null,
"end_reason": "platform_limit"
},
"meta": {
"request_id": "req_3f9c2a7d1e8b4c6a9f0e2d4b6a8c0e1f",
"platform": "x",
"source": "api",
"is_cached": false,
"credits_charged": 1,
"latency_ms": 1000,
"fetched_at": "2026-10-25T12:00:00Z",
"input": {
"kind": "community",
"id": "1493446837214187523",
"url": "https://x.com/i/communities/1493446837214187523"
},
"credits_remaining": 9999,
"client_request_id": null,
"warnings": []
}
}import { SocialTap } from "socialtap";
const client = new SocialTap(); // apiKey defaults to process.env.SOCIALTAP_API_KEY
const res = await client.x.communityPosts.list({ url: "https://x.com/i/communities/1493446837214187523" });
console.log(res.data);
console.log(res.credits.charged, res.meta.request_id);import java.net.URI;
import java.net.URLEncoder;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
public class Main {
public static void main(String[] args) throws Exception {
String query = "url=" + encode("https://x.com/i/communities/1493446837214187523");
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://socialtap.dev/v1/x/community_posts?" + query))
.header("x-api-key", System.getenv("SOCIALTAP_API_KEY"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
// An error is {"error": {"code", "message", ...}}; success is {data, meta}, meta.credits_charged its price.
if (response.statusCode() >= 400) throw new RuntimeException(response.body());
System.out.println(response.body());
}
static String encode(String value) {
return URLEncoder.encode(value, StandardCharsets.UTF_8);
}
}using System.Text.Json;
using var http = new HttpClient();
http.DefaultRequestHeaders.Add("x-api-key", Environment.GetEnvironmentVariable("SOCIALTAP_API_KEY"));
var query = string.Join("&",
"url=" + Uri.EscapeDataString("https://x.com/i/communities/1493446837214187523"));
var res = await http.GetAsync("https://socialtap.dev/v1/x/community_posts?" + query);
using var body = JsonDocument.Parse(await res.Content.ReadAsStringAsync());
if (!res.IsSuccessStatusCode)
{
var error = body.RootElement.GetProperty("error");
throw new Exception($"{error.GetProperty("code")}: {error.GetProperty("message")}");
}
Console.WriteLine(body.RootElement.GetProperty("data"));
Console.WriteLine(body.RootElement.GetProperty("meta").GetProperty("credits_charged"));// Cargo.toml: reqwest = { version = "0.12", features = ["blocking", "json"] }, serde_json = "1"
use std::env;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let res = reqwest::blocking::Client::new()
.get("https://socialtap.dev/v1/x/community_posts")
.query(&[("url", "https://x.com/i/communities/1493446837214187523")])
.header("x-api-key", env::var("SOCIALTAP_API_KEY")?)
.send()?;
let ok = res.status().is_success();
let body: serde_json::Value = res.json()?;
if !ok {
return Err(format!("{}: {}", body["error"]["code"], body["error"]["message"]).into());
}
println!("{} {}", body["data"], body["meta"]["credits_charged"]);
Ok(())
}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.
Live data from 35 platforms.
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.
| Source | Price per successful page | Per 1,000 pages |
|---|---|---|
| Any source | 1 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?
Can I get a community's members?
How much does the X (Twitter) Community Posts API cost?
How do I get the next page?
Try it on a link you already have.
Paste it in the playground, or copy the request into your code.
- No credit card
- Failed requests are free
- Works on all 276 endpoints