> For the complete documentation index, see [llms.txt](https://docs.koinju.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.koinju.io/readme.md).

# Quick start

Koinju delivers institutional-grade crypto market data — tick trades (418 billion+ since 2013), OHLCV candles, funding rates, and recomputed option Greeks — across 13 exchanges under one normalized schema.

Two ways in: a **REST API** for simple pulls, and **direct SQL** (ClickHouse) for bulk analytics and server-side compute. See [Pricing](/pricing.md) for tiers.

Zero to a plotted BTC chart in three steps. Full connector reference (Rust, Go, CLI, BI tools, REST) is in [How to connect](/how-to-connect.md).

{% hint style="success" %}
**Using an AI coding agent?** Install the [Koinju agent skill](/ai-agent-skill.md) so Claude Code / Cursor / Copilot already know the schema, auth, and query patterns and can help you get started with Koinju API faster.

```bash
npx skills add https://gitlab.com/koinju-public/agent-skill
```

{% endhint %}

## 1. Get credentials

You need a database URL (host), username, and password. Sign up at [koinju.io/pricing](https://koinju.io/pricing) to get them, or email [support@koinju.io](mailto:support@koinju.io?subject=SQL%20API%20credentials%20request).

## 2. First SQL query (Python)

```
pip install clickhouse-connect pandas matplotlib
```

```python
import clickhouse_connect

conn = clickhouse_connect.get_client(
    host="<provided_database_url>",
    port=8443,
    secure=True,
    username="<username>",
    password="<password>",
    database="api",
)

df = conn.query_df(
    """
    SELECT start, exchange, market, toFloat64(close) AS close
    FROM api.ohlcv(candle_duration_in_minutes = 1440)
    WHERE market IN ('BTC-USD', 'BTC-USDT')
      AND start >= now() - INTERVAL 90 DAY
    ORDER BY start
    """
)
print(df.head())
```

`api.ohlcv(candle_duration_in_minutes = 1440)` is a parameterized view (`1440` = daily candles). `close` is a high-precision Decimal — cast it with `toFloat64(close)` before arithmetic.

{% hint style="info" %}
The `market` symbol is quoted per venue: USD venues (Coinbase, Kraken, Bitstamp) publish `BTC-USD`; USDT venues (Binance, OKX, Bybit, KuCoin, Gate.io) publish `BTC-USDT`. These are **different markets** — to see BTC across all exchanges filter `market IN ('BTC-USD', 'BTC-USDT')`.
{% endhint %}

## 3. First plot — average BTC price across all exchanges

```python
import matplotlib.pyplot as plt

avg = df.groupby("start")["close"].mean()

avg.plot()
plt.title("Average BTC price across all exchanges (daily close)")
plt.ylabel("USD")
plt.show()
```

Next: browse [Data](/data/coverage.md), or use the REST option in [How to connect](/how-to-connect.md).
