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

# Analyze performance

> Get live engagement metrics for cached tweets including likes, retweets, views, and reply counts

<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 tweet** · [All plans](https://xquik.com/#pricing) from \$0.00012/credit
</Callout>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://xquik.com/api/v1/styles/elonmusk/performance \
    -H "x-api-key: xq_YOUR_KEY_HERE" | jq
  ```

  ```javascript Node.js theme={null}
  const username = "elonmusk";
  const response = await fetch(`https://xquik.com/api/v1/styles/${username}/performance`, {
    method: "GET",
    headers: {
      "x-api-key": "xq_YOUR_KEY_HERE",
    },
  });
  const data = await response.json();
  ```

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

  username = "elonmusk"
  response = requests.get(
      f"https://xquik.com/api/v1/styles/{username}/performance",
      headers={"x-api-key": "xq_YOUR_KEY_HERE"},
  )
  data = response.json()
  ```

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

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

  func main() {
      username := "elonmusk"
      req, err := http.NewRequest("GET", "https://xquik.com/api/v1/styles/"+username+"/performance", 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>

## Path parameters

<ParamField path="id" type="string" required>
  Style profile ID or X username whose cached tweets to analyze. Must have been cached 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="xUsername" type="string">Normalized X username (lowercase, no `@` prefix).</ResponseField>
    <ResponseField name="tweetCount" type="number">Number of tweets with engagement data.</ResponseField>

    <ResponseField name="tweets" type="object[]">
      Array of tweets with engagement metrics.

      <Expandable title="tweet object">
        <ResponseField name="id" type="string">Tweet ID.</ResponseField>
        <ResponseField name="text" type="string">Tweet text content.</ResponseField>
        <ResponseField name="bookmarkCount" type="number">Number of bookmarks.</ResponseField>
        <ResponseField name="likeCount" type="number">Number of likes.</ResponseField>
        <ResponseField name="quoteCount" type="number">Number of quote tweets.</ResponseField>
        <ResponseField name="replyCount" type="number">Number of replies.</ResponseField>
        <ResponseField name="retweetCount" type="number">Number of retweets.</ResponseField>
        <ResponseField name="viewCount" type="number">Number of views.</ResponseField>
      </Expandable>
    </ResponseField>

    ```json theme={null}
    {
      "xUsername": "elonmusk",
      "tweetCount": 20,
      "tweets": [
        {
          "id": "1893456789012345678",
          "text": "The future is now.",
          "bookmarkCount": 2340,
          "likeCount": 15420,
          "quoteCount": 1280,
          "replyCount": 890,
          "retweetCount": 3210,
          "viewCount": 1250000
        }
      ]
    }
    ```
  </Tab>

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

    Missing or invalid API key.
  </Tab>

  <Tab title="402 Subscription Required">
    Possible error codes:

    * `no_subscription` - No active subscription
    * `subscription_inactive` - Subscription is inactive or cancelled
    * `insufficient_credits` - Insufficient credits

    ```json theme={null}
    { "error": "no_subscription", "message": "No active subscription" }
    ```

    Subscribe from the [dashboard](https://xquik.com/subscription).
  </Tab>

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

    No cached style exists for this username. Use [Analyze & Cache Style](/api-reference/styles/analyze) to fetch and cache tweets 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>

<Info>
  Engagement metrics are fetched live from X at request time. Results may vary between calls as tweets gain interactions.
</Info>

<Note>
  **Related:** [Analyze & Cache Style](/api-reference/styles/analyze) to cache tweets before fetching metrics, [Get Style](/api-reference/styles/get) to view the cached tweet text, or [Compare Styles](/api-reference/styles/compare) to compare two accounts.
</Note>
