# Quickstart



import { Callout } from 'fumadocs-ui/components/callout';

Get your first API response in minutes.

Prerequisites [#prerequisites]

* An MMT API key (get one from the dashboard)
* A tool to make HTTP requests (curl, Postman, or any HTTP client)

<Callout type="warn" title="Use API keys only on your backend">
  MMT API keys are secret credentials. Do not put them in browser JavaScript, mobile apps, or other public clients.
  Call MMT from your backend, then return only the data your client needs.
</Callout>

Your First Request [#your-first-request]

Fetch the last hour of 1-minute candles for BTC/USD on Binance Futures.

<Callout type="info" title="Unified Symbols">
  Use `btc/usd` (our unified format), not `BTCUSDT` (exchange ticker). See [Symbols](/api/basics/symbols) for details.
</Callout>

```bash
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://eu-central-1.mmt.gg/api/v1/candles?exchange=binancef&symbol=btc/usd&tf=1m&from=$(date -v-1H +%s)&to=$(date +%s)"
```

Response:

```json
{
  "data": [
    {
      "t": 1704067200,
      "o": 42000.50,
      "h": 42150.00,
      "l": 41950.00,
      "c": 42100.00,
      "vb": 1500000.00,
      "vs": 1400000.00,
      "tb": 1250,
      "ts": 1180
    }
  ],
  "exchange": "binancef",
  "symbol": "btc/usd",
  "tf": "1m",
  "from": 1704063600,
  "to": 1704067200,
  "points": 60
}
```

Understanding the Response [#understanding-the-response]

| Field              | Description                     |
| ------------------ | ------------------------------- |
| `data`             | Array of candles                |
| `t`                | Candle timestamp (Unix seconds) |
| `o`, `h`, `l`, `c` | Open, high, low, close prices   |
| `vb`, `vs`         | Buy and sell volume (USD)       |
| `tb`, `ts`         | Buy and sell trade counts       |

More Examples [#more-examples]

Get market statistics [#get-market-statistics]

```bash
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://eu-central-1.mmt.gg/api/v1/stats?exchange=binancef&symbol=btc/usd&tf=1m&from=1704067200&to=1704153600"
```

Get orderbook snapshot [#get-orderbook-snapshot]

```bash
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://eu-central-1.mmt.gg/api/v1/orderbook?exchange=binancef&symbol=btc/usd&levels=1000"
```

List available markets [#list-available-markets]

```bash
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://eu-central-1.mmt.gg/api/v1/markets"
```

Real-Time Data [#real-time-data]

From your backend service, connect to WebSocket for live updates:

```javascript
import WebSocket from 'ws';

const ws = new WebSocket('wss://eu-central-1.mmt.gg/api/v1/ws?api_key=YOUR_API_KEY');

ws.on('open', () => {
  ws.send(JSON.stringify({
    type: 'subscribe',
    channel: 'candles',
    exchange: 'binancef',
    symbol: 'btc/usd',
    tf: '1m'
  }));
});

ws.on('message', (data, isBinary) => {
  if (isBinary) return; // JSON format should not be binary
  const msg = JSON.parse(data.toString());
  console.log(msg);
});
```

For CBOR, connect with `?format=cbor` and decode incoming binary payloads with a CBOR decoder.

Next Steps [#next-steps]

* [Authentication](/api/basics/authentication) - Learn about API keys and access levels
* [Rate Limits](/api/basics/rate-limits) - Understand usage limits
* [REST API](/api/rest) - Explore all endpoints
* [WebSocket API](/api/websocket) - Real-time streaming guide
