X Community
An X community is a topic-based discussion space with a name, description, membership counts and rules for participation. Those details help readers understand the subject of the community, compare its size with others and check its participation policies before exploring the discussions.
X Community API Features
- Understand what a community is aboutGet the community name, public description, link, cover image and creator information together, so you can identify the space and read its stated topic before looking for posts.
- See its membership size and participation policiesThe X Community API returns member and moderator counts together with join_policy and invites_policy, which describe how joining and member invitations are handled.
- Read the community’s own rulesThe rules list includes rule names and descriptions, allowing you to keep the participation requirements alongside the community’s basic information.
X Community API Parameters
| Parameters | Required | Description |
|---|---|---|
urls | Required | Required list of public X community links with a numeric community ID, such as https://x.com/i/communities/1493446837214187523; put one link on each line in the Playground, or use a JSON urls array in code, rather than a profile, search or individual post link. |
How to Use the X Community API
Each X Community API request starts a background collection task, so its first response gives you a task ID rather than the finished data; use that ID to check progress and retrieve the results.
- Open the public community page and copy its /i/communities/ link; prepare one link for each community you want to look up with the X Community API.
- Before running the example, replace $SOCQ_API_KEY with your own API key or set that environment variable. Send the JSON input to POST /v1/x/community with the Authorization header shown below, then save the task_id from the response.
- Use GET /v1/tasks/{task_id} with the saved ID to check progress. queued means waiting, running means collection is in progress, and retrying means another attempt is underway. Wait for succeeded before reading the results; if the task is failed, read error_message for the reason.
- When the task succeeds, read data.results.items: each item in this list describes one community’s details. An empty list means the task completed without returning any records.
- If data.results.has_more is true, the next_cursor value is the marker for another page of saved results. Copy it unchanged into the cursor parameter of GET /v1/tasks/{task_id}?cursor=... and continue until has_more is false.
curl -X POST "https://api.socq.ai/v1/x/community" \
-H "Authorization: Bearer $SOCQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"urls":["https://x.com/i/communities/1493446837214187523"]}'X Community API Use Cases
- Create a directory of communities to explore: Put the community names, descriptions, links and member counts from the X Community API into a table so someone can compare the supplied communities by topic and size before deciding which discussions to read.
- Keep participation rules with a discussion review: Save the rules and membership policies under the community ID, then use X Community Posts separately to attach the posts you want to review to that community background.
X Community API Pro Tips
- If you start from a post rather than a community page, find the public community link first because the X Community API does not determine a post’s community from the post URL.
- When the same community appears under x.com and twitter.com links, use the numeric ID after /i/communities/ as the matching key so you do not create duplicate directory entries.
- When comparing communities, use member counts as a size measurement rather than evidence of how actively members are posting; this result contains no activity history or list of individual members.
Related APIs
Beyond the X Community API, use these APIs when you need a different type of public X data.
- Twitter Profile Scraper API — Retrieve public account identity, biographies, avatars, cover images, account status, and visible audience statistics by username.
- X Followers List API — Collect public follower account identities and visible profile metrics for one or more X usernames.
- X Following List API — Collect profiles followed by public X accounts, including identity, biographies, account signals, visible counters, and source usernames.
- X Community Posts API — Read the public posts shared in a community, with their text, authors and interaction counts.
- X Community Members API — Export a community's members as full profiles with bios and follower counts.
- X Community Moderators API — Get the admins and moderators who run a community, as full profiles.
- Twitter Tweet Scraper API
- Twitter User Tweets Scraper API
- Twitter Search API
- X Post Quotes API
- X Post Replies API
- X Post Retweeters API
- X Trends API
- Twitter Mentions API
- Twitter User Search API
- X Thread Context API
- X Account Location API
- X Verified Followers API
- X List Tweets API
- Twitter List Members API
- Twitter List Followers API
- X Communities Search API
- X Articles API
- X Spaces API
- Twitter Media Scraper API
- X User Replies API
- Twitter Follow Checker API
- Twitter Video Transcript API