> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xquik.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Popular X communities by topic: Twitter API list

> List the most popular X (Twitter) Communities of a topic, such as Technology or Gaming. Name the topic by ID or name to get each Community. 1 credit each.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="200" id="response-x-community-popular-200">
      ```json theme={null}
      {
        "communities": [
          {
            "id": "1472105760389668865",
            "name": "Tech Twitter",
            "member_count": 121468,
            "is_nsfw": false,
            "primary_topic": {
              "name": "Technology"
            }
          }
        ],
        "has_next_page": true,
        "next_cursor": "WzM1LjUxMjQ5N10="
      }
      ```
    </Tab>

    <Tab title="400" id="response-x-community-popular-400">
      ```json theme={null}
      {
        "error": "invalid_input",
        "message": "Invalid input. Check the request body."
      }
      ```
    </Tab>

    <Tab title="401" id="response-x-community-popular-401">
      ```json theme={null}
      {
        "error": "unauthenticated",
        "message": "Authentication required."
      }
      ```
    </Tab>

    <Tab title="402" id="response-x-community-popular-402">
      ```json theme={null}
      {
        "error": "insufficient_credits",
        "message": "Insufficient credits. Top up or subscribe to continue."
      }
      ```
    </Tab>

    <Tab title="424" id="response-x-community-popular-424">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "X data source temporarily unavailable. Try again later."
      }
      ```
    </Tab>

    <Tab title="429" id="response-x-community-popular-429">
      ```json theme={null}
      {
        "error": "rate_limit_exceeded",
        "message": "Too many requests. Try again later.",
        "retryAfter": 60
      }
      ```
    </Tab>

    <Tab title="502" id="response-x-community-popular-502">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "X data source temporarily unavailable. Try again later."
      }
      ```
    </Tab>

    <Tab title="503" id="response-x-community-popular-503">
      ```json theme={null}
      {
        "error": "x_api_unavailable",
        "message": "Xquik is busy right now. Retry shortly."
      }
      ```
    </Tab>
  </Tabs>
</Panel>

<blockquote className="agent-llms-directive">
  For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
</blockquote>

<Callout icon="coins" color="#5c3327">
  **1 credit per Community returned** · [All plans](https://xquik.com/#pricing) from \$0.00012/credit
</Callout>

<CodeGroup>
  ```bash cURL theme={null}
  curl -G https://xquik.com/api/v1/x/communities/popular \
    --data-urlencode "topic=Technology" \
    -H "x-api-key: xq_your_api_key_here" | jq
  ```

  ```javascript Node.js theme={null}
  const params = new URLSearchParams({ topic: "Technology" });
  const response = await fetch(`https://xquik.com/api/v1/x/communities/popular?${params}`, {
    headers: { "x-api-key": "xq_your_api_key_here" },
  });
  const data = await response.json();
  for (const community of data.communities) {
    process.stdout.write(`${community.id} ${community.name} ${community.member_count}\n`);
  }
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://xquik.com/api/v1/x/communities/popular",
      params={"topic": "Technology"},
      headers={"x-api-key": "xq_your_api_key_here"},
  )
  for community in response.json()["communities"]:
      print(community["id"], community["name"], community["member_count"])
  ```
</CodeGroup>

Use `GET /x/communities/popular` to list the Communities X ranks highest under a topic.
Name the topic by `topicId`, or by `topic` name in any case.
Subtopics work too, such as `Artificial Intelligence`.
Each Community costs 1 credit.

## Pick a topic

[Community topics](/api-reference/x/community-topics) lists every topic and subtopic with its ID.
Send a name, such as `topic=gaming`, or an ID, such as `topicId=701`.
`topicId` wins when you send both.

A missing or unknown topic returns `400 invalid_community_topic`.
Its `message` lists the topic names to send. It costs nothing.

## Query parameters

<ParamField query="topicId" type="string">
  Topic or subtopic ID from [Community topics](/api-reference/x/community-topics), such as `301`. Wins over `topic`.
</ParamField>

<ParamField query="topic" type="string">
  Topic or subtopic name in any case, such as `technology`. Send this or `topicId`.
</ParamField>

<ParamField query="cursor" type="string">
  Pagination cursor from a previous response. Omit it for the first page. A cursor X refuses or that expired returns a free `400 invalid_cursor`. Start again without it.
</ParamField>

<ParamField query="pageSize" type="integer">
  Most Communities to return on this page. Your credit balance can return fewer. Aliases: `limit`, `count`, and `max_results`.
</ParamField>

## Headers

<ParamField header="x-api-key" type="string">
  Send a full Xquik account API key.
</ParamField>

<ParamField header="Authorization" type="string">
  `Bearer xq_your_guest_key_here` for `paid_reads`.
</ParamField>

## Response

### 200 OK

<ResponseField name="communities" type="object[]">
  The topic's most popular Communities, in X's order.
  **Community object fields.**

  <ResponseField name="id" type="string">
    Community ID. Pass it to the other Community endpoints.
  </ResponseField>

  <ResponseField name="name" type="string">
    Community name.
  </ResponseField>

  <ResponseField name="member_count" type="number">
    Total member count.
  </ResponseField>

  <ResponseField name="is_nsfw" type="boolean">
    Whether X marks the Community sensitive.
  </ResponseField>

  <ResponseField name="primary_topic" type="object">
    The topic X files the Community under, with its `name`.
  </ResponseField>

  <ResponseField name="banner_url" type="string">
    Banner image URL. Omitted if unavailable.
  </ResponseField>

  <ResponseField name="banner" type="object">
    Banner `url`, `width`, `height`, main `colors`, and the `focus` area X keeps in view. Omitted if
    unavailable.
  </ResponseField>

  <ResponseField name="membersFacepile" type="object[]">
    Members X previews beside the member count, each with its `id` and `profilePicture`.
  </ResponseField>
</ResponseField>

<ResponseField name="has_next_page" type="boolean">Whether another page of Communities follows.</ResponseField>
<ResponseField name="next_cursor" type="string">Cursor for the next page. Empty at the end.</ResponseField>

```json theme={null}
{
  "communities": [
    {
      "id": "1472105760389668865",
      "name": "Tech Twitter",
      "member_count": 121468,
      "is_nsfw": false,
      "primary_topic": { "name": "Technology" },
      "banner_url": "https://pbs.twimg.com/community_banner_img/example.jpg"
    }
  ],
  "has_next_page": true,
  "next_cursor": "WzM1LjUxMjQ5N10="
}
```

### 400 Invalid community topic or cursor

```json theme={null}
{
  "error": "invalid_community_topic",
  "message": "Unknown topic. Use 1 of these or a subtopic from GET /x/communities/topics: Sports, Technology, Art."
}
```

The real message lists every topic name.

A cursor X can't read returns `invalid_cursor`:

```json theme={null}
{
  "error": "invalid_cursor",
  "message": "Cursor invalid or expired. Start again without cursor, then use next_cursor."
}
```

Start again without `cursor`. Both answers are free.

### 401 Unauthenticated

Anonymous requests get `WWW-Authenticate: Bearer` and a guest wallet checkout action. This is not a Payment challenge.

### 402 Payment required

Account keys get account options. Guest keys get guest top-up only.
No checkout starts automatically. Confirm any payment action.

### 502 X API unavailable

```json theme={null}
{ "error": "x_api_unavailable" }
```

The read failed. Retry after a short delay.

### 503 Service busy

Xquik is busy. Wait for `Retry-After`, then retry.

### 429 Rate limit exceeded

```json theme={null}
{ "error": "rate_limit_exceeded", "retryAfter": 60 }
```

Use `Retry-After` when present. Otherwise, use the JSON `retryAfter` field.

### 424 Dependency failed

The opt-in normalized contract returns 424 when the read fails.
Send `xquik-api-contract: 2026-04-29` to opt in. Default v1 returns 502.

## Popular X Communities questions

### Which topics can I send?

Every topic and subtopic that [Community topics](/api-reference/x/community-topics) lists, by name or ID.

### Are the results the same for everyone?

X ranks them, so the list can change between requests.

### How much does it cost?

Each returned Community costs 1 credit. An unknown topic costs nothing.

### Does this replace X's official API?

No. This page documents Xquik, an independent third-party service.
It does not document X's official API.

<Note>
  **Next steps.** [Community details](/api-reference/x/community-info) reads a Community's rules, creator, and admin by its `id`.
</Note>

<div className="related-api-links">
  <Accordion title="Related follower, list & community APIs" icon="link">
    * Profiles: [Search users](/api-reference/x/search-users) · [Search autocomplete](/api-reference/x/search-autocomplete) · [Get user](/api-reference/x/twitter-profile-lookup) · [Batch users](/api-reference/x/batch-users)
    * Followers: [Followers](/api-reference/x/followers) · [Following](/api-reference/x/following) · [Follower IDs](/api-reference/x/follower-ids) · [Following IDs](/api-reference/x/following-ids) · [Creator subscriptions](/api-reference/x/user-subscriptions) · [Affiliates](/api-reference/x/user-affiliates) · [Similar accounts](/api-reference/x/user-similar) · [Verified followers](/api-reference/x/verified-followers) · [Followers you know](/api-reference/x/followers-you-know) · [Check follower](/api-reference/x/check-follower)
    * Lists: [Search lists](/api-reference/x/search-lists) · [User lists](/api-reference/x/user-lists) · [List memberships](/api-reference/x/user-list-memberships) · [List members](/api-reference/x/list-members) · [List followers](/api-reference/x/list-followers)
    * Communities: [Find](/api-reference/x/community-find) · [Popular](/api-reference/x/community-popular) · [Topics](/api-reference/x/community-topics) · [Suggested](/api-reference/x/community-suggested) · [Details](/api-reference/x/community-info) · [Members](/api-reference/x/community-members) · [Moderators](/api-reference/x/community-moderators) · [Timeline](/api-reference/x/community-tweets) · [Media](/api-reference/x/community-media) · [Keyword search](/api-reference/x/community-search)
  </Accordion>
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.