Skip to Content

Community

A community with its members, rules and topic.

GET
/v1/x/community

Authorization

apiKey
headerAuthorizationBearer <token>

An API key from the dashboard: Authorization: Bearer sapi_….

Query Parameters

url?string

The community's link (https://x.com/i/communities/1493446837214187523).

id?string

The community's id, instead of url.

maxAge?integer

How old a cached answer may be, in seconds; 0 always fetches. Default and most: the endpoint's cache lifetime.

Formatint64
Range0 <= value

Response Body

The answer.

application/json
  1. response

One item, as every single-item endpoint answers: { "data": … }.

data*

A community: a group of accounts posting about one subject.

Example Request
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"    ]  }}