Community
A community with its members, rules and topic.
GET
apiKeyheader
AuthorizationBearer <token>An API key from the dashboard: Authorization: Bearer sapi_….
url?stringThe community's link (https://x.com/i/communities/1493446837214187523).
id?stringThe community's id, instead of url.
maxAge?integerHow old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.
Format
int64Range
0 <= valueThe answer.
application/json- response
One item, as every single-item endpoint answers: { "data": … }.
data*A community: a group of accounts posting about one subject.
import { SocialAPI } from "@socialapihq/sdk";const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });const { data } = await client.x.community({ url: "https://x.com/i/communities/1493446837214187523" });Example Response
{ "data": { "id": "1493446837214187523", "name": "Build in Public", "description": "Share what you're working on. Get feedback. Help each other move forward. – Sponsored by bolt.new ⚡", "url": "https://x.com/i/communities/1493446837214187523", "members": 271609, "createdAt": "2022-02-15T04:47:27.551Z", "topic": "Entrepreneurship", "joinPolicy": "Open", "question": null, "nsfw": false, "bannerUrl": "https://pbs.twimg.com/community_banner_img/1915033378811772928/KdaKUaRP?format=png&name=orig", "creator": "marckohlbrugge", "rules": [ { "name": "Share what you're working on", "description": "Don't be scared to share unfinished work" }, { "name": "Screenshots, screencasts, drafts, etc", "description": "Visual tweets tend to grab people's attention" }, { "name": "No self-promotion", "description": "Don't ask for upvotes or advertise your products/services." } ], "hashtags": [ "design", "code", "marketing" ] }}