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

# Platform API

> The TakeProfit Platform API: historical candles, volume footprint and TPO profiles and the security catalog over REST, live candles, footprint and order book streams over WebSocket, with one API key.

export const Button = ({href, appearance = 'brand', size = 'l', wide = false, target, children}) => {
  const classes = ['tp-btn', 'not-prose', 'no-underline'];
  if (appearance && appearance !== 'outline') classes.push(`tp-btn-${appearance}`);
  if (size && size !== 'l') classes.push(`tp-btn-${size}`);
  if (wide) classes.push('tp-btn-wide');
  return <a href={href} target={target} rel={target === '_blank' ? 'noreferrer' : undefined} className={classes.join(' ')}>
      {children}
    </a>;
};

export const DocLink = ({href, children}) => <a href={href}>{children}</a>;

<div className="tp-hero not-prose relative overflow-hidden rounded-3xl border border-white/10">
  <span className="tp-hero-badge">Platform API</span>

  <div className="tp-hero-title">
    The data behind <span className="tp-hero-accent">our charts</span>
  </div>

  <p className="tp-hero-sub">Request historical candles, volume footprint and TPO profiles and the security catalog over REST, and subscribe to live candles, footprint profiles and order books over WebSocket. One key in one header works for both.</p>

  <div className="tp-hero-actions">
    <Button href="/docs/platform-api/quickstart"><Icon icon="bolt" size={14} /> Make your first request</Button>
    <Button href="/docs/platform-api/authentication" appearance="outline"><Icon icon="key" size={14} /> Get an API key</Button>
  </div>
</div>

## What you can request

<CardGroup cols={2}>
  <Card title="Candles" icon="chart-candlestick" href="/docs/platform-api/rest/overview">
    Historical candles for any supported timeframe, plus the list of timeframes. Over WebSocket, the latest candle and then live updates of the forming one.
  </Card>

  <Card title="Volume footprint" icon="chart-simple" href="/docs/platform-api/websocket/footprint">
    Buy and sell volume per price row, with the row size scale a settings UI can offer. Live profiles arrive as complete replacements.
  </Card>

  <Card title="TPO profiles" icon="chart-gantt" href="/docs/platform-api/rest/overview">
    Market Profile data for day, week and month timeframes, with point of control, initial balance and time blocks.
  </Card>

  <Card title="Order book" icon="layer-group" href="/docs/platform-api/websocket/orderbook">
    One snapshot of the top levels per side, then incremental updates. Available over WebSocket.
  </Card>

  <Card title="Securities" icon="magnifying-glass" href="/docs/platform-api/rest/overview">
    Search by name, ticker or ISIN, list exchanges and their securities, and read a security specification with tick size and precision.
  </Card>

  <Card title="One key for both" icon="key" href="/docs/platform-api/authentication">
    A personal API token from your TakeProfit settings, sent in the `x-api-key` header on every request and on the WebSocket handshake.
  </Card>
</CardGroup>

## Two ways in

<CardGroup cols={2}>
  <Card title="REST API" icon="server" href="/docs/platform-api/rest/overview">
    `https://public-api.takeprofit.com/api/v1/marketdata`

    History and reference data. Every endpoint answers `GET` only, and unknown query parameters are rejected.
  </Card>

  <Card title="WebSocket API" icon="bolt" href="/docs/platform-api/websocket/overview">
    `wss://public-api.takeprofit.com/api/v1/marketdata`

    Live streams. Subscription parameters go in the query string; the client sends nothing after the handshake.
  </Card>
</CardGroup>

Both sections open with an overview of the shared parameters, and their endpoint pages are generated from our OpenAPI and AsyncAPI specifications, so every parameter and response field matches the running API. The three streams are [candles](/docs/platform-api/websocket/candles), [volume footprint](/docs/platform-api/websocket/footprint) and [order book](/docs/platform-api/websocket/orderbook).

## From key to live data

<ol className="tp-steps tp-steps-4 not-prose mt-6">
  <li className="tp-step">
    <span className="tp-step-num">Step 1 of 4</span>
    <div className="tp-step-title" role="heading" aria-level="3">Create an API key</div>
    <p className="tp-step-text">In Settings, create a personal API token on a paid plan and copy it once: the full key is shown a single time.</p>

    <ul className="tp-step-links">
      <li><DocLink href="/docs/platform-api/authentication">Authentication</DocLink></li>
    </ul>
  </li>

  <li className="tp-step">
    <span className="tp-step-num">Step 2 of 4</span>
    <div className="tp-step-title" role="heading" aria-level="3">Find the security</div>
    <p className="tp-step-text">Search by name, ticker or ISIN and take the exchange and symbol pair from the hit. Every other endpoint speaks that pair.</p>

    <ul className="tp-step-links">
      <li><DocLink href="/docs/platform-api/quickstart#1-find-a-security">Find a security</DocLink></li>
    </ul>
  </li>

  <li className="tp-step">
    <span className="tp-step-num">Step 3 of 4</span>
    <div className="tp-step-title" role="heading" aria-level="3">Load history</div>
    <p className="tp-step-text">Ask for candles, footprint or TPO profiles over a range. Prices and volumes come as decimal strings, so nothing is rounded on the way.</p>

    <ul className="tp-step-links">
      <li><DocLink href="/docs/platform-api/quickstart#2-load-historical-candles">Load historical candles</DocLink></li>
      <li><DocLink href="/docs/platform-api/rest/overview">REST API overview</DocLink></li>
    </ul>
  </li>

  <li className="tp-step">
    <span className="tp-step-num">Step 4 of 4</span>
    <div className="tp-step-title" role="heading" aria-level="3">Go live</div>
    <p className="tp-step-text">Open a WebSocket connection with the same key in the handshake header and keep the picture up to date as the market moves.</p>

    <ul className="tp-step-links">
      <li><DocLink href="/docs/platform-api/quickstart#3-subscribe-to-live-candles">Subscribe to live candles</DocLink></li>
      <li><DocLink href="/docs/platform-api/websocket/overview">WebSocket API overview</DocLink></li>
    </ul>
  </li>
</ol>

## Good to know

* **One header, both protocols.** `x-api-key` authenticates REST requests and the WebSocket upgrade alike. Exactly one value is accepted.
* **Securities are identified by exchange and symbol.** Take them from the Securities endpoints; ISINs work in search only.
* **Unknown query parameters are rejected** with `400`, so a typo fails loudly instead of being ignored.
* **Requests draw credits from your key's quota.** Heavier requests cost more, a stream is charged once per subscription rather than per frame, and an exhausted quota answers `429`.

<Note>
  Questions and suggestions go to [support@takeprofit.com](mailto:support@takeprofit.com). The Platform API is separate from the [Partner API](/docs/partner/introduction), which has its own credentials and endpoints.
</Note>
