X Community Members API | List Twitter Community Members
Fetch the member roster of an X Community, cursor-paginated, with each row carrying that member's own role in the community: Admin, Moderator or Member. Admins and moderators appear in this list alongside ordinary members and are not grouped, so do not derive a moderator list by filtering the first page. Billed at $0.0008 per call. Cost: $0.0008 per call.
GET community/members returns an X Community's member roster, cursor-paginated, as rows of { user, role } where role is that member's own role in the community: Admin, Moderator or Member. The user object is deliberately reduced, carrying id, username, name, profile_image_url, is_blue_verified, verified and is_protected only, because X's roster operation sends no bio, no follower counts and no created_at. Paging is a bare next_cursor string. $0.0008 per call.
Authorization
bearerAuth Pass your API key as a bearer token on every request: Authorization: Bearer <API_KEY>.
In: header
Query Parameters
The numeric community id, the digits in a x.com/i/communities/ URL.
Pagination cursor from a previous response's next_cursor. Omit on the first call.
Page size. Defaults to 20 and is clamped to 1-100, so count=500 returns 100 rather than erroring. A non-numeric value is a 400.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/community/members?community_id=1493446837214187523&count=20"{ "members": [ { "user": { "id": "1281109705495130113", "username": "pizzaboy", "name": "Dan Holdsworth", "profile_image_url": "https://pbs.twimg.com/profile_images/..._normal.png", "is_blue_verified": true, "verified": false, "is_protected": false }, "role": "Admin" }, { "user": { "id": "44196397", "username": "devjane", "name": "Jane", "profile_image_url": "https://pbs.twimg.com/profile_images/..._normal.png", "is_blue_verified": false, "verified": false, "is_protected": false }, "role": "Member" } ], "next_cursor": "RG9uZUZvck5vd0N1cnNvcg==", "has_more": true}{ "error": "bad_request", "message": "Missing or malformed parameter. Fix the request before retrying."}{ "error": "unauthorized", "message": "The API key is missing, malformed, or revoked. Check the Authorization header."}{ "error": "insufficient_credits", "message": "Your balance is exhausted. Top up your credits to continue."}{ "error": "not_found", "message": "The resource does not exist, for example a deleted tweet or a private account."}{ "error": "rate_limited", "message": "Too many requests. Back off and retry with exponential backoff."}{ "error": "server_error", "message": "Something failed on our side. Retry with backoff; if it persists, contact support."}Pricing
| Unit | Price |
|---|---|
| Per call | $0.0008 |
| Per 1,000 calls | $0.80 |
| Per 1,000 records (~20 per call) | ~$0.04 |
When to use
Use this to enumerate who is in a community, or to find every account holding a given role. Use Community Moderators when you only want the moderators, because filtering the first page of this list gives you the moderators among the first 20 members and looks like a complete answer.
Notes
- THE USER OBJECTS ARE SMALLER THAN USER INFO RETURNS. X's roster operation sends a reduced user with no bio, no follower or following counts, no location, no website and no created_at. Those keys are omitted rather than returned as null, so a consumer can never read not-asked-for as zero. Call User Info on an id when you need the full profile.
- ADMINS AND MODERATORS ARE IN THIS LIST, tagged by role, and they are NOT grouped: in the captured community the admin was at index 0 and moderators at indexes 1 and 13. Do not derive a moderator list by filtering the first page. Use Community Moderators.
- PAGING IS next_cursor ONLY. X sends no total count and no has_more of its own on this operation, so the absence of next_cursor is the only end-of-list signal it gives. has_more is computed for you from the two things that are known: whether this page returned rows and whether it carried a usable cursor.
- A 404 is returned ONLY on an empty FIRST page (no cursor sent and nothing returned), which means the id did not resolve or the roster is not visible. An empty page WITH a cursor is a normal end of list and returns 200.
- There is no per-member joined-at timestamp. X does not send one on this operation, so this API cannot return one.
- If X returns a response shape this API does not recognise, you get a 502 parse_failed rather than a 200 with an empty members array, and that call is not billed to you. An empty roster is never a true answer for a community, since every community has at least an admin, so it is never served as one.
Pagination
This roster returns a bare next_cursor string and nothing else: X sends no total count and no has_more of its own on this operation, so has_more is computed for you (this page returned rows AND carried a usable cursor). Pass next_cursor straight back as ?cursor= and stop when members comes back empty or has_more is false. An empty page WITH a cursor is a normal end-of-list, not an error; an empty FIRST page is a 404, because a community always has at least an admin. If X returns a shape this API cannot parse you get a 502 parse_failed, never a 200 carrying an empty members array, and that call is not billed to you.
Related endpoints
- Community Info: Metadata, rules and banners for one X Community.
- Community Moderators: Page through a community's moderators and admins.
- Community Tweets: Page through a community's post timeline, with the pinned post returned separately.
- Community Memberships: List every community a given account belongs to.
FAQ
Why is the user object smaller than the one User Info returns?
Because X's roster operation genuinely sends less: no bio, no follower or following counts, no location, no website, no created_at. Rather than return a full profile with half its fields null, which would leave you unable to tell an account with zero followers from a field we never asked for, the roster returns a smaller object where every key present is a value X actually sent. Call User Info with the id when you need the rest.
Is members[].role also nulled like the community object's role?
No, and this is the one place the distinction matters. The role on the COMMUNITY object is the calling account's own role, so it is nulled on a pooled read. The role on a MEMBER ROW describes that member, is identical for every caller, and is the whole point of this endpoint. It is returned in full.
Can I get just the moderators by filtering this list?
Not correctly. Admins and moderators are interleaved through the roster at arbitrary positions, so filtering page one gives you the moderators among the first 20 members while looking like a complete answer. Use Community Moderators, which is a separate upstream operation.
How do I know when I have reached the last page?
Stop when members comes back empty or has_more is false. X sends no total and no has_more of its own here, so absence of next_cursor is its only end signal; has_more folds that together with whether the page had rows.
Community Info GET
Look up a single X Community by its numeric id and get back its name, description, member count, join policy, primary topic, posted rules and both banners. This endpoint returns the REDUCED form of the Community object: eight of its 24 fields come back empty here and are populated by Community Memberships instead, which the response table marks field by field. Billed at $0.0008 per call. Cost: $0.0008 per call.
Community Moderators GET
Fetch the moderators and admins of an X Community, cursor-paginated, in the same row shape Community Members returns. This is a separate upstream operation rather than a filter over the member roster, because moderators are interleaved through that roster at arbitrary positions. Billed at $0.0008 per call. Cost: $0.0008 per call.