# Quickstart

### Set-up Blochouse

To use the Blockhouse SDK, you need to authenticate using an API key. Each API key is a 32-character string, that can be found from API keys page on your portal. The authentication process ensures secure access to the Blockhouse services and protects your data.

{% stepper %}
{% step %}

#### Step 1: Create a Blockhouse Account

To generate an API key, you must first create an account on the Blockhouse platform:

1. Visit [Blockhouse](https://dashboard.blockhouse.app).
2. Click on **Sign Up** and provide the required details.
3. Verify your email and log in to your account.
   {% endstep %}

{% step %}

#### Step 2: Generate an API Key

Once you have an account, follow these steps to generate an API key:

1. Navigate to the **API Keys** section in your Blockhouse dashboard.
2. Click on **Create New API Key**.
3. Copy and securely store the API key as it will be required to authenticate requests.
   {% endstep %}

{% step %}

#### Step 3: Authenticate API Requests

To use the SDK, you need to provide the API key in your application. The API key can be set as an environment variable or passed explicitly in your script:

**Option 1: Using an Environment Variable**

Set the API key in your system environment variables:

```
export BLOCKHOUSE_API_KEY='your_api_key_here'
```

On Windows (PowerShell):

```
$env:BLOCKHOUSE_API_KEY="your_api_key_here"
```

**Option 2: Passing API Key in the Code**

You can also pass the API key directly when initializing the SDK:

```
from blockhouse import Client

api_key = "your_api_key_here"
client = Client(api_key)
```

{% endstep %}
{% endstepper %}

#### Best Practices for API Key Security

{% hint style="warning" %}

#### Best Practices for API Key Security

* Never share your API key publicly or hard-code it in source code.
* Use environment variables or secure storage solutions.
* Rotate API keys periodically to enhance security.
  {% endhint %}

### Choose a service

Blockhouse offers two data services: historical and live. While these services are largely similar, they are separated due to licensing costs and differences between request-response and real-time streaming APIs. You have the flexibility to integrate either one or both services.

|          | Historical                                                                          | Live          |
| -------- | ----------------------------------------------------------------------------------- | ------------- |
| Coverage | Details are available [here](/blockhouse/asset-classes/fixed-income.md).            | coming soon.. |
| Pricing  | Prices vary. Visit [Blockhouse](https://www.blockhouse.app/) website for more info. | coming soon.. |
| Access   | Client libraries (C++, Python, and Rust) and API (HTTP).                            | coming soon.. |

### Uncover your first set of trading insights

{% tabs %}
{% tab title="Historical" %}
Install SDK

{% code title="bash" overflow="wrap" %}

```bash
pip install blockhouse
```

{% endcode %}

Authenticate & Send

{% code title="python" overflow="wrap" %}

```python
from blockhouse import Transfer

client = Transfer(api_key="your_api_key") 

result = client.process_data(
    market_data_path='trade_data.csv',
    trade_data_path='market_data.csv',
    bucket_name="blockhouse-sdk",
)
print(result)
```

{% endcode %}

**NOTE : You must provide at least one of trade\_data\_path or market\_data\_path. You may provide both.**

[**View SDK Documentation →**](/blockhouse/core-product/how-to-send-your-data.md)
{% endtab %}

{% tab title="Live" %}
Coming soon...
{% endtab %}
{% endtabs %}

### Next steps

You have successfully integrated the Blockhouse SDK! Here’s what you can do next:

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>Explore</strong> <strong>Dashboards</strong></td><td>Visualize pre-trade, real-time, and post-trade execution costs.</td><td><a href="/pages/etWfgWbD9kHVSvlbJPDi"><strong>View Dashboards →</strong></a></td><td><a href="/files/NDJOfadhqYW66db6l1yx">/files/NDJOfadhqYW66db6l1yx</a></td></tr><tr><td><strong>Analyze Execution Metrics</strong></td><td>Break down slippage, market impact, and spread capture. </td><td><a href="/pages/OYqNEOTwtVcTVcEpIfiy"><strong>View Analytics →</strong></a></td><td><a href="/files/Y3JvV6F2iqmKDyxbf6C7">/files/Y3JvV6F2iqmKDyxbf6C7</a></td></tr><tr><td><strong>Generate Reports</strong></td><td> Download best execution &#x26; compliance reports. </td><td><a href="/pages/OYqNEOTwtVcTVcEpIfiy"><strong>View Reports →</strong></a></td><td><a href="/files/48oDtOhdjshOCQtobX2O">/files/48oDtOhdjshOCQtobX2O</a></td></tr><tr><td><strong>Deploy AI Execution Algorithms</strong></td><td>Automate order routing &#x26; reduce slippage. </td><td><a href="/pages/wK2TwBYAiXllULmiTSe0"><strong>Run AI Execution →</strong></a></td><td><a href="/files/bH74i8NWrFaKi2PwJekm">/files/bH74i8NWrFaKi2PwJekm</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blockhouse-app.gitbook.io/blockhouse/undefined/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
