X Communities: Reading Them Programmatically (And the Ranking Trap)
X Communities: Reading Them Programmatically (And the Ranking Trap)
Communities are the part of X that most data work ignores, usually because people assume they are a private space or a rebranded list. Neither is right.
★A Community is a topic-scoped feed with its own membership, its own moderators, and its own posts — and for public Communities, all of that is readable.★
This page covers what is actually exposed, and one measured behaviour that will silently corrupt your data if you do not know about it.
How a Community differs from the things it resembles
| Who controls membership | Where posts live | |
|---|---|---|
| Community | ★Moderators admit members★ | ★Inside the Community★ |
| List | Anyone can build one, unilaterally | On the authors' timelines |
| Hashtag | Nobody — it is just a string | Anywhere |
The consequence that matters for data work: ★a post made to a Community lives there, not in the author's public timeline the way a normal post does.★
Which means: if you monitor an account's timeline and they post mainly inside Communities, ★you will conclude they went quiet when they did not★. That is a real and easy-to-miss blind spot.
Public Communities expose membership, moderators, and posts — all readable as public data.
What is readable
Four things, each its own call:
import requests
BASE = "https://api.socialapi.tech"
KEY = "your_api_key"
HDRS = {"X-API-Key": KEY}
def community(cid):
"""Everything public about one Community."""
def get(path, **extra):
r = requests.get(f"{BASE}{path}",
params={"community_id": cid, **extra},
headers=HDRS, timeout=60)
r.raise_for_status()
return r.json()["data"]
return {
"info": get("/v1/community/info"),
"moderators": get("/v1/community/moderators"),
"members": get("/v1/community/members", limit=300),
"posts": get("/v1/community/tweets", limit=200),
}
c = community("1493446837214187523")
print(f"{c['info'].get('name')} · {c['info'].get('member_count'):,} members")
print(f"{len(c['moderators'])} moderators · {len(c['posts'])} posts fetched")
Membership is paginated and genuinely large. A big Community runs into six figures, so ★you page through it with a cursor rather than fetching it whole★ — the response carries next_cursor for exactly this.
★The ranking trap★
The posts call takes a ranking parameter with three values. The obvious assumption is that they sort the same posts three ways.
★They do not. They return substantially different sets of posts.★
Measured on a live Community:
| Ranking | Median age of returned posts |
|---|---|
Recency (default) |
★0.2 hours★ |
Relevance |
5.4 hours |
Likes |
★19.9 hours★ (but far higher engagement) |
★The overlap between Recency and Likes measured 0%.★ Not "low" — zero shared posts in the sample.
⚠️ Why this matters more than it sounds: if you pull with the default and conclude "this Community gets 30 posts a day", ★you measured the last few hours and nothing else★. And if you switch ranking between runs, your time series is comparing two different populations without anything in the output telling you so.
★Treat the three as three separate datasets. Pick one, and never change it mid-study.★
Two behaviours that break naive code
1. The page-size parameter does nothing.
Ask for 20, 50, or 200 posts per page and ★you get 21-28 either way★. Volume comes from paging, not from asking for more. Code written on the assumption that limit controls page size will quietly under-fetch.
2. Paging returns duplicates.
Roughly ★4% of posts repeat across pages★ on the post stream. Deduplicate by post ID, or your counts will be inflated by a few percent — small enough to look plausible, large enough to be wrong.
seen, posts = set(), []
for page in pages: # ★dedupe by ID, not by position★
for p in page:
if p["id"] not in seen:
seen.add(p["id"]); posts.append(p)
Member paging, by contrast, measured zero duplicates across 39 consecutive pages — ★the two endpoints behave differently, so do not assume one from the other★.
Both quirks are handled server-side in our implementation — dedupe and cursoring included.
Questions people ask
What is a Twitter Community? A topic-scoped space with its own members, moderators, and posts. ★Posts made to it live inside it.★
How do I find Communities on X? Through the Communities tab or by link. ★There is no full-text Community search endpoint★ — discovery is the weak point.
How do I search Communities? You largely cannot, programmatically. ★If you know the ID you can read everything; finding IDs is the hard part.★
Can I see who is in a Community? For public Communities, yes — membership is paginated and readable.
Can people see which Communities I am in? Membership of public Communities is public. ★It is not a private grouping★, which surprises people.
How do I join a Community? Request through the app, or join freely if it is open. ★We are read-only and cannot join on your behalf.★
How do I create a Community? Through the app, subject to eligibility. Creation is a write action, so no data API does it.
Who are the moderators? A separate call returns them — useful because ★moderators shape what the feed contains★.
Do Community posts appear in normal search? Often not the way you expect. ★This is the blind spot★ — an account can be active in Communities while its public timeline looks quiet.
Do Community posts show on the author's profile? Not like ordinary posts. They belong to the Community context.
How many posts can I fetch? As many as you page for. ★Page size is fixed regardless of what you request★ — depth comes from more pages.
Why do I get 25 posts when I asked for 200? The page-size parameter has no effect on this endpoint. ★Page more; do not ask for more.★
What are the ranking options?
Recency, Relevance, and Likes. ★They are different datasets, not different sort orders.★
Which ranking should I use? Recency for monitoring, Likes for what resonated. ★Never mix them within one study.★
Why do two ranking modes return different posts? Because they select differently, not just order differently. ★Measured overlap between Recency and Likes was 0%.★
Are Community members ever duplicated across pages? Members paged cleanly in testing; posts did not. ★Deduplicate posts by ID.★
Can I monitor a Community continuously? Yes — page it on a schedule and store what is new. Same pattern as keyword monitoring.
How large can a Community be? Into the hundreds of thousands. ★Plan for cursoring rather than a single fetch.★
Is a Community the same as a List? No. ★A list is a view you build over other people's timelines; a Community is where posts actually live.★
Should I use a Community or a List for a topic feed? A list, if you know the accounts. ★A Community, if you want what a moderated group produces★ — including from accounts you never picked.
Can I get historical Community posts? Paging goes deep, but ★the same archive-depth reality applies★ — what reaching back really means.
Do Community posts have normal engagement counts? Yes — replies, reposts, quotes, and likes come back as usual.
Can I see Community posts without joining? Public Communities are readable. ★Restricted ones are not, by anyone.★
Are private Communities accessible? No. ★Same boundary as protected accounts★ — why that boundary exists.
How do I track a Community's growth? Record the member count on a schedule. ★No history is served to you★ — it exists only if you collected it.
Can I find which Communities an account belongs to? Not as a reverse lookup. ★Discovery runs Community → members, not member → Communities.★
Are Communities good for finding niche accounts? ★Very★ — a moderated membership list is a pre-filtered set of people who post about one subject, which is hard to assemble any other way.
Do Communities affect the algorithm? They change where a post is distributed, not how engagement is counted — how distribution works.
Can I export Community data? Yes — page and write out, same as any export.
Why is my Community post count lower than expected? Usually the ranking mode. ★Recency shows only the last few hours★ — that is selection, not a shortage of posts.
Is there an ID I need? Yes, the Community ID, visible in its URL. ★Every call keys off it.★
The short version
★Communities are readable, under-used, and the best source of niche account discovery on the platform — a moderated membership list is a pre-filtered audience you cannot assemble from search.★
Two things will bite you if nobody tells you: ★the page-size parameter does nothing (page instead), and the three ranking modes are separate datasets rather than sort orders — Recency and Likes overlapped 0% in testing.★
Our API exposes Community info, moderators, members, and posts as four calls, with cursors for the large ones and post deduplication handled server-side. Read-only, flat price per call.
What no API does: join, post, or moderate — and ★private Communities stay private to everyone★.
Related reading: why an account can look quiet while staying active · lists versus other topic feeds · how far back paging really reaches · what the engagement numbers mean.