X (Twitter) Communities API
An X Community by id or URL: name, description, member count, join policy, rules, trending hashtags, banner and creator.
GET /v1/x/communities/{id}1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/x/communities/1926186499399139650",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "data": { "id": "1926186499399139650", "name": "The First Thousand", "description": "This community is for creators and builders who are growing to their first 1,000 followers. Give insights, build your br…", "created_at": "2025-05-24T08:00:22.931Z", "join_policy": "Open", "member_count": 5632, "is_nsfw": false, "creator_id": "1921368454449201152", "banner_url": "https://pbs.twimg.com/community_banner_img/1930048753223745537/Ua814CNc?format=jpg&name=orig", "rules": [ { "id": "1926189963793609186", "name": "No Empty Platitudes", "description": "This isn’t the space to drop ChatGPT engineered empty platitudes" }, { "id": "1926190339016048686", "name": "Post What’s Working", "description": "Show how you’re cracking the algorithm" }, "… 4 more" ] }, "includes": { "users": [ { "id": "1921368454449201152", "name": "carsonrmccann", "username": "carsonrmccann", "protected": false, "verified": true, "verified_type": "blue" } ] }}Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string | A community id or URL. Example: 1926186499399139650. |
Response fields
200 with a XCommunityResponse, in the shape of X’s API v2 Tweet and User objects.
| Field | Type | Description |
|---|---|---|
data | XCommunity | |
includes | object | The creator and the members X shows on the community page. |
Status codes
| Status | Meaning |
|---|---|
200 | The community. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The post or account does not exist, was deleted, or is suspended. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | X is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
Can I list members?
Not yet: X shows the member list only to logged-in users.
X is a trademark of X Corp. We are not affiliated with or endorsed by X Corp.