100 free credits. No credit card required. Get a key

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 failure
import 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

NameTypeDescription
idpath · requiredstringA community id or URL. Example: 1926186499399139650.
Response fields

200 with a XCommunityResponse, in the shape of X’s API v2 Tweet and User objects.

FieldTypeDescription
dataXCommunity
includesobjectThe creator and the members X shows on the community page.
Status codes
StatusMeaning
200The community.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The post or account does not exist, was deleted, or is suspended.
429Too many requests. Wait for Retry-After seconds.
503X 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.