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

# Start building with Kraken

> Build on Kraken — spot, derivatives, OTC, custody, and crypto payments over REST, WebSocket, and FIX.

export const ProductCards = () => {
  const ICONS = {
    exchange: <Icon icon="arrow-right-arrow-left" size={24} />,
    institutional: <Icon icon="building-columns" size={24} />
  };
  const CellLink = ({href, label}) => <a href={href} className="text-sm mr-6 last:mr-0">
      {label}
    </a>;
  const Row = ({label, links}) => <div className="flex items-baseline gap-6 px-6 py-2.5 border-t border-[var(--kp-border)]">
      <div className="w-[120px] shrink-0 text-sm text-[var(--kp-text-body)] truncate">{label}</div>
      {}
      <div className="min-w-0 leading-6">
        {links.map(l => <CellLink key={l.label} href={l.href} label={l.label} />)}
      </div>
    </div>;
  const ProductCard = ({icon, title, descriptionTail, primaryCta, changelogHref, rows}) => <div className="bg-transparent border border-[var(--kp-border)] rounded-2xl overflow-hidden flex flex-col">
      <div className="py-5 px-6 flex flex-col gap-3">
        <div className="flex items-start justify-between gap-4">
          {ICONS[icon] || null}
          {changelogHref && <a href={changelogHref} className="text-xs">Changelog</a>}
        </div>
        <div>
          <h3 className="text-base font-medium leading-6 m-0 mb-1 text-[var(--kp-text-heading)]">{title}</h3>
          <p className="text-sm leading-[22px] text-[var(--kp-text-body)] m-0">
            <a href={primaryCta.href} className="font-medium">{primaryCta.label}</a>{' '}{descriptionTail}
          </p>
        </div>
      </div>
      <div>
        {rows.map(r => <Row key={r.label} label={r.label} links={r.links} />)}
      </div>
    </div>;
  const PRODUCTS = [{
    icon: 'exchange',
    title: 'Exchange',
    descriptionTail: 'with spot and derivatives trading.',
    primaryCta: {
      label: 'Get started',
      href: '/exchange/guides/overview'
    },
    changelogHref: '/exchange/changelog',
    rows: [{
      label: 'REST API',
      links: [{
        label: 'Spot',
        href: '/api-reference/market-data/get-server-time'
      }, {
        label: 'Derivatives',
        href: '/api-reference/market-data/get-tickers'
      }]
    }, {
      label: 'WebSocket',
      links: [{
        label: 'Spot',
        href: '/exchange/api-reference/spot-websocket'
      }, {
        label: 'Derivatives',
        href: '/exchange/api-reference/futures-websocket'
      }]
    }, {
      label: 'Unified FIX',
      links: [{
        label: 'Spot + Derivatives',
        href: '/exchange/api-reference/unified-fix'
      }]
    }]
  }, {
    icon: 'institutional',
    title: 'Institutional',
    descriptionTail: 'with OTC, custody, and prime brokerage.',
    primaryCta: {
      label: 'Get started',
      href: '/institutional/guides/overview'
    },
    changelogHref: '/institutional/changelog',
    rows: [{
      label: 'REST API',
      links: [{
        label: 'OTC',
        href: '/institutional/api-reference/otc-rest'
      }, {
        label: 'Custody',
        href: '/institutional/api-reference/custody-rest'
      }, {
        label: 'Prime',
        href: '/institutional/api-reference/prime-rest'
      }]
    }, {
      label: 'WebSocket',
      links: [{
        label: 'Prime',
        href: '/institutional/api-reference/prime-websocket/authentication'
      }]
    }, {
      label: 'FIX',
      links: [{
        label: 'Prime',
        href: '/institutional/api-reference/prime-fix/logon'
      }]
    }]
  }];
  return <div className="kp-product-grid grid grid-cols-1 lg:grid-cols-2 gap-4 mt-2">
      {PRODUCTS.map(p => <ProductCard key={p.title} {...p} />)}
    </div>;
};

export const KrakenCliSection = () => {
  const INSTALL_CMD = "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/krakenfx/kraken-cli/releases/latest/download/kraken-cli-installer.sh | sh";
  const SESSIONS = [[{
    cmd: 'kraken ticker BTCUSD ETHUSD SOLUSD',
    output: 'PAIR      LAST        24H CHG\nBTCUSD    97,412.80   +2.31%\nETHUSD     3,219.60   +1.14%\nSOLUSD       152.10   \u22120.58%'
  }, {
    cmd: 'kraken paper order buy BTCUSD 0.05 --type market',
    output: 'Order placed\n  txid:    OQCLML-FAGE2-FA7IF6\n  type:    buy market\n  pair:    BTC/USD\n  vol:     0.05000000\n  cost:    $4,870.64\n  fee:     $12.18\n  status:  closed'
  }, {
    cmd: 'kraken paper balance',
    output: 'ASSET  BALANCE       AVAILABLE\nUSD    95,117.18     95,117.18\nBTC         0.05          0.05'
  }, {
    cmd: 'kraken paper positions --show-pnl',
    output: 'PAIR     SIDE  ENTRY       P&L\nBTCUSD   long  97,412.80   +$2.17'
  }], [{
    cmd: 'kraken ticker AAPLx/USD NVDAx/USD SPYx/USD',
    output: 'PAIR         LAST     24H CHG\nAAPLx/USD    228.16   +0.84%\nNVDAx/USD    134.54   +2.17%\nSPYx/USD     581.32   +0.42%'
  }, {
    cmd: 'kraken ohlc AAPLx/USD --interval 60',
    output: 'TIME              OPEN    CLOSE   VOL\n2026-04-09 13:00  227.80  228.16  1,842\n2026-04-09 12:00  227.20  227.80  3,106\n2026-04-09 11:00  226.85  227.20  2,574'
  }, {
    cmd: 'kraken paper order buy AAPLx/USD 10 --type limit --price 228.00',
    output: 'Order placed\n  txid:    OPQRST-UVWX-YZ1234\n  type:    buy limit @ 228.00\n  pair:    AAPLx/USD\n  vol:     10.00000000\n  status:  open'
  }], [{
    cmd: 'kraken futures ticker PF_XBTUSD PF_ETHUSD',
    output: 'SYMBOL       LAST       FUNDING\nPF_XBTUSD    97,381.0   +0.0042%\nPF_ETHUSD     3,217.8   +0.0031%'
  }, {
    cmd: 'kraken futures paper order buy PF_XBTUSD 1 --type limit --price 97000',
    output: 'Order placed\n  order_id:  614a57e0-8c2b\n  type:      buy limit @ 97,000.0\n  symbol:    PF_XBTUSD\n  size:      1\n  status:    open'
  }, {
    cmd: 'kraken futures paper positions --show-pnl',
    output: 'SYMBOL       SIDE  ENTRY      P&L\nPF_XBTUSD    long  97,000.0   +$381.00'
  }, {
    cmd: 'kraken futures paper balance',
    output: 'TYPE              USD\navailable         49,618.50\ninitial_margin     1,948.00\npnl                 +381.00\nequity            51,947.50'
  }], [{
    cmd: 'kraken earn strategies --asset ETH',
    output: 'STRATEGY                  APR    LOCK\nETH Flexible Staking      3.2%   none\nETH Bonded (28d)          4.1%   28d\nETH Bonded (90d)          4.8%   90d'
  }, {
    cmd: 'kraken balance --asset ETH',
    output: 'ASSET  BALANCE       AVAILABLE\nETH    12.48000000   12.48000000'
  }, {
    cmd: 'kraken earn allocate ETH 5.0 eth-flexible-staking',
    output: 'Allocation submitted\n  asset:     ETH\n  amount:    5.00000000\n  strategy:  ETH Flexible Staking\n  status:    pending'
  }, {
    cmd: 'kraken earn allocations --asset ETH',
    output: 'STRATEGY                AMOUNT  APR\nETH Flexible Staking    5.000   3.2%'
  }]];
  const initTerminal = root => {
    const output = root.querySelector('.kp-term-output');
    const promptEl = root.querySelector('.kp-term-prompt');
    const promptText = root.querySelector('.kp-term-prompt-text');
    if (!output || !promptEl || !promptText) return;
    const prefersReducedMotion = typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    let sessionIdx = 0;
    let stopped = false;
    let timers = [];
    const t = (fn, ms) => {
      if (stopped) return -1;
      const id = setTimeout(() => {
        if (!stopped) fn();
      }, ms);
      timers.push(id);
      return id;
    };
    const typeCmd = (text, onDone) => {
      if (prefersReducedMotion) {
        promptText.textContent = text;
        onDone();
        return;
      }
      let i = 0;
      promptText.textContent = '';
      const iv = setInterval(() => {
        if (stopped) {
          clearInterval(iv);
          return;
        }
        if (i < text.length) {
          promptText.textContent += text[i];
          i++;
        } else {
          clearInterval(iv);
          onDone();
        }
      }, 28 + Math.floor(Math.random() * 16));
      timers.push(iv);
    };
    const printOutput = (text, onDone) => {
      const block = document.createElement('div');
      block.className = 'text-[var(--kp-terminal-text)] whitespace-pre leading-[1.5] mb-3 overflow-x-auto';
      output.insertBefore(block, promptEl);
      if (prefersReducedMotion) {
        block.textContent = text;
        output.scrollTop = output.scrollHeight;
        t(onDone, 200);
        return;
      }
      const lines = text.split('\n');
      let i = 0;
      const nextLine = () => {
        if (stopped) return;
        if (i >= lines.length) {
          t(onDone, 400);
          return;
        }
        if (i > 0) block.textContent += '\n';
        block.textContent += lines[i];
        i++;
        output.scrollTop = output.scrollHeight;
        t(nextLine, 140 + Math.floor(Math.random() * 60));
      };
      nextLine();
    };
    const commitPrompt = () => {
      const cmd = document.createElement('div');
      cmd.className = 'text-[var(--kp-terminal-heading)] mb-1 whitespace-pre-wrap break-all';
      const chevron = document.createElement('span');
      chevron.className = 'text-[var(--kp-terminal-muted)] mr-2';
      chevron.textContent = '\u276F';
      cmd.appendChild(chevron);
      cmd.appendChild(document.createTextNode(promptText.textContent));
      output.insertBefore(cmd, promptEl);
      promptText.textContent = '';
      output.scrollTop = output.scrollHeight;
    };
    const runSession = () => {
      const steps = SESSIONS[sessionIdx % SESSIONS.length];
      let stepIdx = 0;
      const runStep = () => {
        if (stopped || stepIdx >= steps.length) {
          t(() => {
            output.style.transition = 'opacity 0.4s ease';
            output.style.opacity = '0';
            t(() => {
              while (output.firstChild !== promptEl) output.removeChild(output.firstChild);
              output.style.transition = '';
              output.style.opacity = '1';
              sessionIdx++;
              t(runSession, 500);
            }, 450);
          }, 3000);
          return;
        }
        const step = steps[stepIdx];
        typeCmd(step.cmd, () => {
          t(() => {
            commitPrompt();
            printOutput(step.output, () => {
              stepIdx++;
              runStep();
            });
          }, 300);
        });
      };
      runStep();
    };
    runSession();
    return () => {
      stopped = true;
      timers.forEach(clearTimeout);
      timers.length = 0;
    };
  };
  const handleCopy = e => {
    const label = e.currentTarget.querySelector('[data-cli-label]');
    if (!navigator.clipboard) return;
    navigator.clipboard.writeText(INSTALL_CMD).then(() => {
      if (!label) return;
      label.textContent = 'Copied';
      setTimeout(() => {
        label.textContent = 'Install';
      }, 1500);
    }).catch(() => {});
  };
  return <div className="flex flex-col gap-4 w-full">
      <p className="m-0 text-[var(--kp-text-body)] text-sm leading-[1.6]">
        Trade, stream and stake from the command line — with paper trading against live market data. <a href="https://github.com/krakenfx/kraken-cli" className="text-[var(--kp-text-heading)]" target="_blank" rel="noopener noreferrer">Learn more on GitHub</a>.
      </p>
      {}
      <div className="kp-mono kp-terminal kp-terminal-card rounded-2xl overflow-hidden flex flex-col h-[330px] border border-[var(--kp-border)] min-w-0" role="region" aria-label="Kraken CLI demo" ref={el => {
    if (!el) return;
    if (el.dataset.init) return;
    el.dataset.init = '1';
    el._stopDemo = initTerminal(el);
  }}>
        <div className="flex items-center py-3 px-4 shrink-0">
          <div className="flex gap-2" aria-hidden="true">
            <span className="w-2.5 h-2.5 rounded-full bg-[var(--kp-terminal-muted)] opacity-50" />
            <span className="w-2.5 h-2.5 rounded-full bg-[var(--kp-terminal-muted)] opacity-50" />
            <span className="w-2.5 h-2.5 rounded-full bg-[var(--kp-terminal-muted)] opacity-50" />
          </div>
          <span className="flex-1 text-center text-[11px] text-[var(--kp-terminal-muted)] tracking-[0.03em]">kraken-cli</span>
          <div className="w-[54px]" />
        </div>
        <div className="kp-term-output flex-1 overflow-y-auto px-5 pt-1 pb-4 text-[13px] leading-[1.5] scroll-smooth" aria-hidden="true">
          <div className="kp-term-prompt flex items-center gap-2">
            <span className="text-[var(--kp-text-placeholder)] shrink-0 select-none" aria-hidden="true">{'\u276F'}</span>
            <span className="kp-term-prompt-text text-[var(--kp-text-heading)]" />
            <span className="kp-term-cursor inline-block w-2 h-[15px] bg-[var(--kp-terminal-heading)] opacity-50 shrink-0" aria-hidden="true" />
          </div>
        </div>
        <button type="button" className="kp-cli-install w-full text-left bg-transparent border-t border-[var(--kp-border)] py-3 px-5 flex items-center shrink-0 cursor-pointer" onClick={handleCopy} aria-label="Copy install command">
          <span data-cli-label aria-live="polite" className="text-[11px] text-[var(--kp-text-body)] tracking-[0.03em] mr-3 shrink-0">Install</span>
          <span className="kp-mono text-[13px] text-[var(--kp-text-body)] whitespace-nowrap overflow-hidden text-ellipsis flex-1">curl --proto '=https' --tlsv1.2 -LsSf .../kraken-cli-installer.sh | sh</span>
          <span className="kp-cli-copy-btn text-[var(--kp-text-placeholder)] flex items-center justify-center shrink-0 ml-3">
            {}
            <svg width="14" height="14" viewBox="0 0 448 512" fill="currentColor" aria-hidden="true"><path d="M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l140.1 0L400 115.9 400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-204.1c0-12.7-5.1-24.9-14.1-33.9L366.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-32-48 0 0 32c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l32 0 0-48-32 0z" /></svg>
          </span>
        </button>
      </div>
    </div>;
};

export const HeroActions = () => <div className="kp-hero-actions mt-6">
    <a href="/home/guides/quickstart" className="kp-hero-btn-primary inline-flex items-center justify-center py-1.5 px-3.5 rounded-xl text-sm font-medium no-underline cursor-pointer outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[var(--kp-brand)]">Quickstart</a>
  </div>;

<div className="kp-welcome-hero">
  <div className="kp-welcome-hero-actions">
    <h1 className="kp-welcome-title">Start building<br />with Kraken</h1>

    Build on Kraken — spot, derivatives, OTC, custody, and crypto payments over REST, WebSocket, and FIX.

    <HeroActions />
  </div>

  <div className="kp-welcome-hero-code">
    <CodeGroup>
      ```python Python theme={null}
      import krakenex

      api = krakenex.API()
      api.key    = 'API_KEY'
      api.secret = 'API_SECRET'

      resp = api.query_private('AddOrder', {
          'pair':      'XXBTZUSD',
          'type':      'buy',
          'ordertype': 'limit',
          'price':     '50000',
          'volume':    '1.0',
      })
      print(resp['result'])
      ```

      ```javascript Node.js theme={null}
      const KrakenClient = require('kraken-api');
      const kraken = new KrakenClient(
        process.env.API_KEY,
        process.env.API_SECRET
      );

      const resp = await kraken.api('AddOrder', {
        pair:      'XXBTZUSD',
        type:      'buy',
        ordertype: 'limit',
        price:     '50000',
        volume:    '1.0',
      });
      console.log(resp.result);
      ```

      ```bash cURL theme={null}
      curl -X POST "https://api.kraken.com/0/private/AddOrder" \
        -H "API-Key: $API_KEY" \
        -H "API-Sign: $API_SIGN" \
        -d "nonce=$NONCE" \
        -d "ordertype=limit" \
        -d "type=buy" \
        -d "pair=XXBTZUSD" \
        -d "price=50000" \
        -d "volume=1.0"
      ```
    </CodeGroup>
  </div>
</div>

## Browse by product

<ProductCards />

## Kraken CLI

<KrakenCliSection />

## Need help integrating?

<CardGroup cols={3}>
  <Card title="Help center" icon="circle-question" href="https://support.kraken.com">
    Browse account and product FAQs.
  </Card>

  <Card title="API status" icon="signal" href="https://status.kraken.com">
    Real-time API health and uptime.
  </Card>

  <Card title="Contact support" icon="headset" href="mailto:api@kraken.com">
    Open a ticket with API support.
  </Card>
</CardGroup>
