# Community details

`GET https://api.twittrapi.com/communities/{communityId}`

Name, description, rules, member count and admins of a community.

HTML page: https://www.twittrapi.com/docs/reference/communities-communityid

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `communityId` | path | string | yes |  | Numeric community ID, the number in the community URL. |

Every read endpoint also accepts `format=simple` (or the header `X-Response-Format: simple`) for compact, flat JSON with a fixed schema. Same price.

## Response

Raw JSON of X's CommunityQuery.

With `format=simple`: {data: Community}.

## Errors

| Status | When |
| --- | --- |
| 422 | communityId is not numeric. |

Shared errors (401 missing key, 402 no balance, 429 rate limit, 5xx) are listed on https://www.twittrapi.com/docs/helpful-infos/error-handling. Calls that fail with 400, 408, 409 or a 5xx error are refunded.

## Example request

curl:

```bash
curl 'https://api.twittrapi.com/communities/1500000000000000000' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

Python:

```python
from twittrapi import TwittrAPI

client = TwittrAPI(api_key="YOUR_API_KEY")
data = client.communities.get("1500000000000000000")
```

Node.js:

```js
import { TwittrAPI } from "twittrapi";

const client = new TwittrAPI({ apiKey: process.env.TWITTRAPI_API_KEY });
const data = await client.communities.get("1500000000000000000");
```

RapidAPI:

```bash
curl 'https://twitter-aio.p.rapidapi.com/communities/1500000000000000000' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
  --header 'x-rapidapi-host: twitter-aio.p.rapidapi.com'
```

## Example response

Shortened: arrays keep their first items and long strings are cut.

Raw (default):

```json
{
  "data": {
    "communityResults": {
      "id": "Q29tbXVuaXR5UmVzdWx0czoxNzYyNDk0Mjc2NTY1NDI2NTky",
      "result": {
        "__typename": "Community",
        "actions": {
          "id": "Q29tbXVuaXR5QWN0aW9uczoxNzYyNDk0Mjc2NTY1NDI2NTky",
          "join_action_result": {
            "__typename": "CommunityJoinAction"
          },
          "list_members_action_result": {
            "__typename": "CommunityListMembersAction"
          }
        },
        "created_at": 1709046355754,
        "creator_results": {
          "id": "VXNlclJlc3VsdHM6MTAwMDAwMDAwMDAwMDAwMDAwMQ==",
          "result": {
            "__typename": "User",
            "id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAx",
            "is_blue_verified": true,
            "legacy": {
              "screen_name": "example_user_1",
              "verified": false
            }
          }
        },
        "custom_banner_media": {
          "id": "QXBpTWVkaWE6DAATCgABG9hLw10WsAAAAA==",
          "media_info": {
            "__typename": "ApiImage",
            "color_info": {
              "palette": [
                {
                  "percentage": 71.75,
                  "rgb": {
                    "blue": 74,
                    "green": 45,
                    "red": 21
                  }
                },
                "… 4 more"
              ]
            },
            "original_img_height": 720,
            "original_img_url": "https://pbs.twimg.com/community_banner_img/2006436936446029824/n1OK-QV1?format=jpg&name=orig",
            "original_img_width": 1800
          }
        },
        "default_banner_media": {
          "id": "QXBpTWVkaWE6DAABCgABFECTH+kUUAQKAAITiFWq8lUQBAAA",
          "media_info": {
            "__typename": "ApiImage",
            "color_info": {
              "palette": [
                {
                  "percentage": 57.34,
                  "rgb": {
                    "blue": 178,
                    "green": 171,
                    "red": 3
                  }
                },
                "… 4 more"
              ]
            },
            "original_img_height": 480,
            "original_img_url": "https://pbs.twimg.com/media/FECTH-kUUAQMe8W.jpg",
            "original_img_width": 1200
          }
        },
        "description": "Discuss the state of AI from industry insiders and anons 🕵️‍♂️",
        "id": "Q29tbXVuaXR5OjE3NjI0OTQyNzY1NjU0MjY1OTI=",
        "invites_result": {
          "__typename": "CommunityInvitesUnavailable"
        },
        "is_member": false,
        "is_nsfw": false,
        "join_policy": "Open",
        "join_requests_result": {
          "__typename": "CommunityJoinRequestsUnavailable"
        },
        "member_count": 30718,
        "members_facepile_results": [
          {
            "id": "VXNlclJlc3VsdHM6MTAwMDAwMDAwMDAwMDAwMDAwMQ==",
            "result": {
              "__typename": "User",
              "id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAx",
… (30 more lines)
```

Simple (`format=simple`):

```json
{
  "data": {
    "id": "1762494276565426592",
    "name": "AI — Rumors & Insights",
    "description": "Discuss the state of AI from industry insiders and anons 🕵️‍♂️",
    "createdAt": "2024-02-27T15:05:55Z",
    "memberCount": 30718,
    "moderatorCount": 0,
    "joinPolicy": "Open",
    "nsfw": false,
    "topic": "Artificial Intelligence",
    "bannerUrl": "https://pbs.twimg.com/community_banner_img/2006436936446029824/n1OK-QV1?format=jpg&name=orig",
    "creator": null,
    "rules": [
      {
        "id": "1985766359352164786",
        "name": "Make relevant and useful posts 🙂",
        "description": "Post useful, relevant, informative AI insights"
      },
      "… 7 more"
    ]
  }
}
```
