# Community tweets

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

Tweets posted in a community.

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

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `communityId` | path | string | yes |  | Numeric community ID, the number in the community URL. |
| `count` | query | integer | no | 20 | Number of tweets to ask X for. Sent to X as is; X treats it as a hint and decides how many it returns (follower and following pages often hold 50 to 70 users for count=20). A value that is not a number falls back to 20. |
| `cursor` | query | string | no |  | Bottom cursor from the previous page. Leave it out for the first page. See Pagination. |

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

Paginated: pass the bottom cursor of one page as `cursor` to get the next. Each page is one billed call.

## Response

Raw JSON of X's CommunityTweetsTimeline query.

With `format=simple`: Collection of Tweet objects: {data: [Tweet], nextCursor, previousCursor, hasNextPage}.

## 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/tweets' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

Python:

```python
from twittrapi import TwittrAPI

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

Node.js:

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

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

RapidAPI:

```bash
curl 'https://twitter-aio.p.rapidapi.com/communities/1500000000000000000/tweets' \
  --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": {
      "result": {
        "__typename": "Community",
        "ranked_community_timeline": {
          "timeline": {
            "instructions": [
              {
                "type": "TimelineClearCache"
              },
              {
                "entries": [
                  {
                    "content": {
                      "__typename": "TimelineTimelineItem",
                      "clientEventInfo": {
                        "component": "suggest_community_tweet",
                        "details": {
                          "timelinesDetails": {
                            "injectionType": "CommunityTweet"
                          }
                        },
                        "element": "tweet"
                      },
                      "entryType": "TimelineTimelineItem",
                      "itemContent": {
                        "__typename": "TimelineTweet",
                        "itemType": "TimelineTweet",
                        "tweetDisplayType": "Tweet",
                        "tweet_results": {
                          "result": {
                            "__typename": "Tweet",
                            "community_results": {
                              "…": "…"
                            },
                            "core": {
                              "…": "…"
                            },
                            "edit_control": {
                              "…": "…"
                            },
                            "grok_analysis_button": true,
                            "is_translatable": false,
                            "legacy": {
                              "…": "…"
                            },
                            "rest_id": "2000000000000000001",
                            "unmention_data": {
                              "…": "…"
                            },
                            "views": {
                              "…": "…"
                            }
                          }
                        }
                      }
                    },
                    "entryId": "tweet-2000000000000000001",
                    "sortIndex": "2109014787424780286"
                  },
                  "… 2 more"
                ],
                "type": "TimelineAddEntries"
              }
            ],
            "metadata": {
              "scribeConfig": {
                "page": "top"
              }
            }
          }
        }
      }
    }
  }
}
```

Simple (`format=simple`):

```json
{
  "data": [
    {
      "id": "2000000000000000001",
      "url": "https://x.com/example_user_1/status/2000000000000000001",
      "text": "Example text.",
      "createdAt": "2026-10-10T17:30:33Z",
      "lang": "en",
      "author": {
        "id": "1000000000000000001",
        "username": "example_user_1",
        "name": "Example User 1",
        "description": "Example",
        "location": "Example",
        "url": null,
        "createdAt": "2017-11-23T00:48:01Z",
        "avatarUrl": "https://pbs.twimg.com/profile_images/1000000000000000000/example.jpg",
        "bannerUrl": "https://pbs.twimg.com/profile_banners/1000000000000000000/1700000000",
        "verified": true,
        "verifiedType": null,
        "protected": false,
        "counts": {
          "followers": 732,
          "following": 1918,
          "tweets": 577,
          "likes": 425,
          "media": 261,
          "listed": 0
        },
        "pinnedTweetIds": [
          "2105743229832528175"
        ],
        "isAutomated": false
      },
      "counts": {
        "likes": 1,
        "retweets": 0,
        "replies": 1,
        "quotes": 0,
        "bookmarks": 0,
        "views": 66
      },
      "media": [],
      "urls": [],
      "hashtags": [],
      "mentions": [],
      "replyTo": null,
      "quoted": null,
      "retweetOf": null,
      "conversationId": "2000000000000000001",
      "isPinned": false,
      "source": null,
      "article": null
    }
  ],
  "nextCursor": "DAAFCgABHUS5xm5__-oLAAIAAADwRW1QQzZ3QUFBZlEvZ0dKTjB2R3AvQUFBQUJRZFExYXloNWJ3Y3gxQ0Y2MGtHbEJ5SFVNNVVEbFdvTmNkUWFwdWpWdkJVeDFFVHd1N0d0QUhIVUg1blJFWGtIc2RRZm1RZXBxQmh4MUVxcm9QbTlBNUhVU1VNMUVhNEdvZFFON1ds…",
  "previousCursor": "DAAJAAA",
  "hasNextPage": true
}
```
