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

# Get Started with Xquik API

> Create an X API key, make your first REST request, monitor tweets every 1 second, and send signed webhooks in 5 minutes.

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

Use this X API quickstart to create an API key, call `GET /account`, monitor tweets every 1 second with `POST /monitors`, and send signed webhook events with `POST /webhooks`. You can reuse the same calls from REST, SDKs, MCP, or automation tools.

<CardGroup cols={3}>
  <Card title="First API Call" icon="terminal">
    Call `GET /account` to confirm authentication, subscription status, credit balance, and monitor billing.
  </Card>

  <Card title="First Monitor" icon="radio">
    Create an account monitor that checks every 1 second. Active monitors cost 21 credits per hour while enabled.
  </Card>

  <Card title="First Webhook" icon="shield-check">
    Register an HTTPS endpoint and save the one-time secret for HMAC signature verification.
  </Card>
</CardGroup>

<Steps>
  <Step title="Create an account">
    Sign up at [xquik.com](https://xquik.com) with your email. You'll receive a magic link, no password required.
  </Step>

  <Step title="Subscribe">
    <Warning>
      An active subscription is required to use the Xquik API. All metered endpoints return `402` without a subscription. See [Pricing, credits & billing](/guides/billing) for plan details.
    </Warning>

    Xquik requires an active subscription to access the API. Starter is USD 20/month and includes 140,000 monthly credits. Subscribe from the [dashboard billing page](https://dashboard.xquik.com/en/account?tab=subscription).
  </Step>

  <Step title="Generate an API key">
    Open [API Keys](https://dashboard.xquik.com/en/account?tab=api-keys) in the dashboard and create a new key. Copy the full key immediately - it's only shown once.

    ```text theme={null}
    xq_YOUR_KEY_HERE
    ```

    <Warning>
      Store your API key securely. It cannot be retrieved after creation. Revoke and replace if compromised.
    </Warning>
  </Step>

  <Step title="Make your first request">
    Verify your setup by fetching your account info:

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

      ```javascript Node.js theme={null}
      const response = await fetch("https://xquik.com/api/v1/account", {
        headers: { "x-api-key": "xq_YOUR_KEY_HERE" },
      });
      const account = await response.json();
      process.stdout.write(`${JSON.stringify(account, null, 2)}\n`);
      ```

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

      response = requests.get(
          "https://xquik.com/api/v1/account",
          headers={"x-api-key": "xq_YOUR_KEY_HERE"},
      )
      print(response.json())
      ```

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

      import (
          "fmt"
          "io"
          "net/http"
      )

      func main() {
          req, _ := http.NewRequest("GET", "https://xquik.com/api/v1/account", nil)
          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()

          body, _ := io.ReadAll(resp.Body)
          fmt.Println(string(body))
      }
      ```
    </CodeGroup>

    **Response:**

    ```json theme={null}
    {
      "plan": "active",
      "monitorsAllowed": 9007199254740991,
      "monitorsUsed": 0,
      "monitorBilling": {
        "activeDailyEstimate": "0",
        "activeHourlyBurn": "0",
        "creditsPerActiveMonitorDay": "500",
        "creditsPerActiveMonitorHour": "21",
        "eventsIncluded": true,
        "instantCheckIntervalSeconds": 1,
        "unlimitedSlots": true
      },
      "creditInfo": {
        "balance": "50000",
        "lifetimePurchased": "140000",
        "lifetimeUsed": "90000",
        "autoTopupEnabled": false,
        "autoTopupAmountDollars": 10,
        "autoTopupThreshold": "50000"
      }
    }
    ```
  </Step>

  <Step title="Create a monitor">
    Start tracking an X account:

    <CodeGroup>
      ```bash cURL theme={null}
      curl -s -X POST https://xquik.com/api/v1/monitors \
        -H "x-api-key: xq_YOUR_KEY_HERE" \
        -H "Content-Type: application/json" \
        -d '{"username": "elonmusk", "eventTypes": ["tweet.new", "tweet.reply"]}' | jq
      ```

      ```javascript Node.js theme={null}
      const response = await fetch("https://xquik.com/api/v1/monitors", {
        method: "POST",
        headers: {
          "x-api-key": "xq_YOUR_KEY_HERE",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          username: "elonmusk",
          eventTypes: ["tweet.new", "tweet.reply"],
        }),
      });
      const monitor = await response.json();
      process.stdout.write(`${JSON.stringify(monitor, null, 2)}\n`);
      ```

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

      response = requests.post(
          "https://xquik.com/api/v1/monitors",
          headers={"x-api-key": "xq_YOUR_KEY_HERE"},
          json={
              "username": "elonmusk",
              "eventTypes": ["tweet.new", "tweet.reply"],
          },
      )
      print(response.json())
      ```

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

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

      func main() {
          body, _ := json.Marshal(map[string]interface{}{
              "username":   "elonmusk",
              "eventTypes": []string{"tweet.new", "tweet.reply"},
          })

          req, _ := http.NewRequest("POST", "https://xquik.com/api/v1/monitors", bytes.NewReader(body))
          req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE")
          req.Header.Set("Content-Type", "application/json")

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

          respBody, _ := io.ReadAll(resp.Body)
          fmt.Println(string(respBody))
      }
      ```
    </CodeGroup>

    **Response:**

    ```json theme={null}
    {
      "id": "7",
      "username": "elonmusk",
      "xUserId": "44196397",
      "eventTypes": ["tweet.new", "tweet.reply"],
      "isActive": true,
      "createdAt": "2026-02-24T10:30:00.000Z",
      "nextBillingAt": "2026-02-24T10:30:00.000Z"
    }
    ```
  </Step>

  <Step title="Set up a webhook (optional)">
    Receive events in real time at your endpoint:

    <CodeGroup>
      ```bash cURL theme={null}
      curl -s -X POST https://xquik.com/api/v1/webhooks \
        -H "x-api-key: xq_YOUR_KEY_HERE" \
        -H "Content-Type: application/json" \
        -d '{"url": "https://your-server.com/webhook", "eventTypes": ["tweet.new"]}' | jq
      ```

      ```javascript Node.js theme={null}
      const response = await fetch("https://xquik.com/api/v1/webhooks", {
        method: "POST",
        headers: {
          "x-api-key": "xq_YOUR_KEY_HERE",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          url: "https://your-server.com/webhook",
          eventTypes: ["tweet.new"],
        }),
      });
      const webhook = await response.json();
      const webhookSecret = webhook.secret;
      if (!webhookSecret) throw new Error("missing webhook secret");
      process.stdout.write(`Webhook ${webhook.id} ready\n`);
      // Store webhookSecret in your secret manager; do not print it.
      ```

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

      response = requests.post(
          "https://xquik.com/api/v1/webhooks",
          headers={"x-api-key": "xq_YOUR_KEY_HERE"},
          json={
              "url": "https://your-server.com/webhook",
              "eventTypes": ["tweet.new"],
          },
      )
      webhook = response.json()
      webhook_secret = webhook["secret"]
      if not webhook_secret:
          raise RuntimeError("missing webhook secret")
      print(f"Webhook {webhook['id']} ready")
      # Store webhook_secret in your secret manager; do not print it.
      ```

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

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

      func main() {
          body, _ := json.Marshal(map[string]interface{}{
              "url":        "https://your-server.com/webhook",
              "eventTypes": []string{"tweet.new"},
          })

          req, _ := http.NewRequest("POST", "https://xquik.com/api/v1/webhooks", bytes.NewReader(body))
          req.Header.Set("x-api-key", "xq_YOUR_KEY_HERE")
          req.Header.Set("Content-Type", "application/json")

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

          var webhook struct {
              ID     string `json:"id"`
              Secret string `json:"secret"`
          }
          if err := json.NewDecoder(resp.Body).Decode(&webhook); err != nil {
              panic(err)
          }

          webhookSecret := webhook.Secret
          if webhookSecret == "" {
              panic("missing webhook secret")
          }
          fmt.Printf("Webhook %s ready\n", webhook.ID)
          // Store webhookSecret in your secret manager; do not print it.
      }
      ```
    </CodeGroup>

    **Response:**

    ```json theme={null}
    {
      "id": "15",
      "url": "https://your-server.com/webhook",
      "eventTypes": ["tweet.new"],
      "secret": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
      "createdAt": "2026-02-24T10:30:00.000Z"
    }
    ```

    Save the `secret` from the response in a secret manager. It is only returned once, and you need it to [verify webhook signatures](/webhooks/verification). Do not print it in shared logs.
  </Step>
</Steps>

## Next steps

<CardGroup cols={3}>
  <Card title="API Reference" icon="book" href="/api-reference/overview">
    Full endpoint documentation.
  </Card>

  <Card title="Extract Data" icon="pickaxe" href="/api-reference/extractions/create">
    Pull followers, replies, and more from X.
  </Card>

  <Card title="Run a Draw" icon="trophy" href="/api-reference/draws/create">
    Execute a giveaway draw on a tweet.
  </Card>

  <Card title="Webhook Verification" icon="shield-check" href="/webhooks/verification">
    Verify HMAC signatures on incoming webhooks.
  </Card>

  <Card title="MCP Server" icon="bot" href="/mcp/overview">
    Connect AI agents to Xquik.
  </Card>

  <Card title="Error Handling" icon="circle-alert" href="/guides/error-handling">
    Handle errors, rate limits, and retries.
  </Card>

  <Card title="Billing & Usage" icon="credit-card" href="/guides/billing">
    Track usage, manage your subscription, and view quotas.
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Magic link email not received">
    Check your spam/junk folder. Try a different email address. Magic links expire after 15 minutes.
  </Accordion>

  <Accordion title="API key not working (401)">
    Verify the header name is `x-api-key` (lowercase). Check that the key starts with `xq_` and hasn't been revoked. Regenerate from the [API Keys dashboard](https://dashboard.xquik.com/en/account?tab=api-keys).
  </Accordion>

  <Accordion title="Getting 402 error">
    Creating extractions, draws, active monitors, media downloads, and X lookups requires an active subscription and enough credits. Webhook operations are free. Reading, updating, deleting, exporting, and testing existing extractions, draws, monitors, and stored events is also free. Active instant monitors cost 21 credits per hour while enabled. Other free endpoints include compose, styles, drafts, radar, account, API keys, credit balance, and credit top-ups. Check your account status via [Get Account](/api-reference/account/get).
  </Accordion>

  <Accordion title="Webhook not receiving events">
    Verify the URL uses HTTPS. Check that the webhook is active via [List Webhooks](/api-reference/webhooks/list). Test delivery with the [Test Webhook](/api-reference/webhooks/test) endpoint.
  </Accordion>

  <Accordion title="Rate limited (429)">
    The API uses a 3-tier fixed window: 60 reads/1s, 30 writes/60s, 15 deletes/60s. Implement exponential backoff and respect the `Retry-After` header. See [Rate Limits](/guides/rate-limits).
  </Accordion>
</AccordionGroup>
