> ## 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.

# X community topics & subtopics: Twitter API list

> List every topic X (Twitter) groups Communities under, with each subtopic and its ID. Pass a topic to the popular Communities API. 1 credit per topic returned.

<Panel>
  <Tabs defaultTabIndex={0} sync={false}>
    <Tab title="200" id="response-x-community-topics-200">
      ```json theme={null}
      {
        "topics": [
          {
            "id": "301",
            "name": "Technology",
            "subtopics": [
              {
                "id": "302",
                "name": "Artificial Intelligence"
              }
            ]
          }
        ],
        "count": 1
      }
      ```
    </Tab>

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

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

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

    <Tab title="424" id="response-x-community-topics-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-topics-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-topics-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-topics-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 topic returned** · [All plans](https://xquik.com/#pricing) from \$0.00012/credit
</Callout>

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

  ```javascript Node.js theme={null}
  const response = await fetch("https://xquik.com/api/v1/x/communities/topics", {
    headers: { "x-api-key": "xq_your_api_key_here" },
  });
  const data = await response.json();
  for (const topic of data.topics) {
    const subtopics = topic.subtopics.map((subtopic) => subtopic.name).join(", ");
    process.stdout.write(`${topic.id} ${topic.name}: ${subtopics}\n`);
  }
  ```

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

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

Use `GET /x/communities/topics` to list the topics X groups Communities under.
Each topic carries its subtopics. Pass a topic or subtopic to
[Popular communities](/api-reference/x/community-popular) as `topicId` or `topic`.

Each top-level topic costs 1 credit, its subtopics included. X changes the
list rarely, so store it. An empty list costs nothing.

## Query parameters

<ParamField query="limit" type="integer">
  Most topics to return, starting at `1`. Omit it for every topic. Your credit balance can return fewer. Aliases: `pageSize`, `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="topics" type="object[]">
  Every topic, in X's order.
  **Topic object fields.**

  <ResponseField name="id" type="string">
    Topic ID. Pass it as `topicId` to Popular communities.
  </ResponseField>

  <ResponseField name="name" type="string">
    Topic name. Popular communities also takes it as `topic`.
  </ResponseField>

  <ResponseField name="subtopics" type="object[]">
    Narrower topics, each with its own `id` and `name`.
  </ResponseField>
</ResponseField>

<ResponseField name="count" type="number">Top-level topics returned.</ResponseField>

<ResponseField name="message" type="string">
  What to do next. Present only when X lists no topic.
</ResponseField>

```json theme={null}
{
  "topics": [
    {
      "id": "301",
      "name": "Technology",
      "subtopics": [
        { "id": "302", "name": "Artificial Intelligence" },
        { "id": "303", "name": "Software" }
      ]
    },
    { "id": "701", "name": "Gaming", "subtopics": [] }
  ],
  "count": 2
}
```

### 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.

## X Community topics questions

### How much does the topic list cost?

1 credit per top-level topic. Its subtopics come free. Send `limit` for fewer topics.

### Do subtopics work with Popular communities?

Yes. Send a subtopic's `id` as `topicId` or its `name` as `topic`.

### 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.** [Popular communities](/api-reference/x/community-popular) lists the top Communities of a topic.
</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.