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

# Compare styles

> Compare two cached tweet style profiles side by side

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

<Callout icon="circle-check" color="#16a34a">
  **Free** - does not consume credits
</Callout>

<CodeGroup>
  ```bash cURL theme={null}
  curl -G https://xquik.com/api/v1/styles/compare \
    -d "username1=elonmusk" \
    -d "username2=sama" \
    -H "x-api-key: xq_YOUR_KEY_HERE" | jq
  ```

  ```javascript Node.js theme={null}
  const params = new URLSearchParams({ username1: "elonmusk", username2: "sama" });
  const response = await fetch(`https://xquik.com/api/v1/styles/compare?${params}`, {
    method: "GET",
    headers: {
      "x-api-key": "xq_YOUR_KEY_HERE",
    },
  });
  const data = await response.json();
  ```

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

  response = requests.get(
      "https://xquik.com/api/v1/styles/compare",
      params={"username1": "elonmusk", "username2": "sama"},
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )
  data = response.json()
  ```

  ```go Go theme={null}
  package main

  import (
      "encoding/json"
      "fmt"
      "net/http"
      "net/url"
  )

  func main() {
      baseURL := "https://xquik.com/api/v1/styles/compare"
      params := url.Values{}
      params.Set("username1", "elonmusk")
      params.Set("username2", "sama")

      req, err := http.NewRequest("GET", baseURL+"?"+params.Encode(), nil)
      if err != nil {
          panic(err)
      }
      req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE")

      resp, err := http.DefaultClient.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      var data map[string]interface{}
      if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
          panic(err)
      }
      fmt.Println(data)
  }
  ```
</CodeGroup>

## Query parameters

<ParamField query="username1" type="string" required>
  First X username to compare. Must have been analyzed with [Analyze & Cache Style](/api-reference/styles/analyze) first.
</ParamField>

<ParamField query="username2" type="string" required>
  Second X username to compare. Must have been analyzed with [Analyze & Cache Style](/api-reference/styles/analyze) first.
</ParamField>

## Headers

<ParamField header="x-api-key" type="string" required>
  Your API key. Session cookie authentication is also supported. Generate a key from the [dashboard](https://xquik.com/dashboard).
</ParamField>

## Response

<Tabs>
  <Tab title="200 OK">
    <ResponseField name="style1" type="object">
      First user's full cached style detail.

      <Expandable title="style object">
        <ResponseField name="xUsername" type="string">Normalized X username.</ResponseField>
        <ResponseField name="tweetCount" type="number">Number of cached tweets.</ResponseField>
        <ResponseField name="fetchedAt" type="string">ISO 8601 timestamp when tweets were fetched.</ResponseField>
        <ResponseField name="isOwnAccount" type="boolean">Whether this is the authenticated user's own X account.</ResponseField>
        <ResponseField name="tweets" type="object[]">Array of cached tweets with `id`, `text`, `authorUsername`, and `createdAt`.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="style2" type="object">
      Second user's full cached style detail. Same shape as `style1`.
    </ResponseField>

    ```json theme={null}
    {
      "style1": {
        "xUsername": "elonmusk",
        "tweetCount": 20,
        "fetchedAt": "2026-02-24T10:30:00.000Z",
        "isOwnAccount": false,
        "tweets": [
          {
            "id": "1893456789012345678",
            "text": "The future is now.",
            "authorUsername": "elonmusk",
            "createdAt": "2026-02-24T09:00:00.000Z"
          }
        ]
      },
      "style2": {
        "xUsername": "sama",
        "tweetCount": 18,
        "fetchedAt": "2026-02-25T14:00:00.000Z",
        "isOwnAccount": false,
        "tweets": [
          {
            "id": "1893456789012345999",
            "text": "Intelligence is not zero-sum.",
            "authorUsername": "sama",
            "createdAt": "2026-02-25T12:00:00.000Z"
          }
        ]
      }
    }
    ```
  </Tab>

  <Tab title="400 Missing Parameters">
    ```json theme={null}
    { "error": "missing_params", "message": "Both usernames are required" }
    ```

    Missing query parameters. Provide both `username1` and `username2`.
  </Tab>

  <Tab title="401 Unauthenticated">
    ```json theme={null}
    { "error": "unauthenticated", "message": "Missing or invalid API key" }
    ```

    Missing or invalid API key.
  </Tab>

  <Tab title="404 Not Found">
    ```json theme={null}
    { "error": "style_not_found", "message": "No cached style found for this username" }
    ```

    One or both usernames have no cached style. Use [Analyze & Cache Style](/api-reference/styles/analyze) to cache them first.
  </Tab>

  <Tab title="429 Rate Limited">
    ```json theme={null}
    { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 1 }
    ```

    Too many requests. Wait for the `Retry-After` header before retrying.
  </Tab>
</Tabs>

<Note>
  **Related:** [Analyze & Cache Style](/api-reference/styles/analyze) to cache a style before comparing, [Get Style](/api-reference/styles/get) to view full tweet data for either account, or [Analyze Performance](/api-reference/styles/performance) to fetch engagement metrics.
</Note>
