> 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/connect-your-tools/excel.md).

# Excel

Pull Koinju market data straight into Microsoft Excel using either the ClickHouse ODBC driver or Excel's built-in Power Query connector.

## Before you start

| Setting       | Value                     |
| ------------- | ------------------------- |
| Host          | the provided database URL |
| Port          | 8443                      |
| Protocol      | HTTPS / SSL enabled       |
| Database      | api                       |
| User/Password | provided by Koinju        |

Don't have credentials yet? See [How to connect](/how-to-connect.md).

## Step-by-step

### Option A — ODBC driver

1. Download the Windows ODBC driver MSI from the [ClickHouse ODBC releases page](https://github.com/ClickHouse/clickhouse-odbc/releases) and install it.
2. Open **ODBC Data Sources** (Windows) and create a new **DSN** for the ClickHouse driver:
   * **Host**: the provided database URL
   * **Port**: `8443`
   * **SSL**: on
   * **Database**: `api`
3. In Excel: **Data ▸ Get Data ▸ From Other Sources ▸ From ODBC**.
4. Pick the DSN you created, enter the **username** and **password** provided by Koinju.
5. Choose a table (or supply a SQL statement) and **Load**.

### Option B — Power Query connector

1. Make sure the ClickHouse ODBC driver from Option A is installed (the Power Query ClickHouse connector relies on it).
2. In Excel: **Data ▸ Get Data ▸ From Database ▸ ClickHouse**.
3. Enter:
   * **Server / Host**: the provided database URL, port `8443`
   * **SSL**: enabled
   * **Database**: `api`
4. Supply the **username** and **password** provided by Koinju and load the data.

{% hint style="info" %}
The ClickHouse ODBC driver connects over the **HTTP(S) interface on port 8443** — the same endpoint used by every other tool in this section.
{% endhint %}

If timezone-aware datetimes look shifted or misbehave once loaded into a worksheet, see the timezone guidance in [How to connect](/how-to-connect.md).

## First sanity query

When prompted for a SQL statement (Option A's "advanced" entry or a Power Query native query), run:

```sql
SELECT exchange, market, timestamp, price
FROM api.trade
WHERE market LIKE 'BTC%' AND timestamp > toStartOfDay(now())
ORDER BY timestamp DESC LIMIT 20
```

If you get \~20 rows back, you're connected. Next, explore what data is available in [Data](/data/coverage.md).
