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

# Quickstart

> Create an account, get an API key and run your first query.

**1. Sign in to the dashboard**

Go to [dashboard.bloklake.com](https://dashboard.bloklake.com) and sign in with Google,
GitHub or email. Signing in creates your account and a personal project.

![A new project's overview with the Get started checklist](https://mintcdn.com/my-company-7009db77/nDT36TDcB0Wx8-XA/images/dashboard/overview-new-project.png?fit=max\&auto=format\&n=nDT36TDcB0Wx8-XA\&q=85\&s=08f6bfc02fb57e577df3266b8ee0550a)

**2. Choose how to pay**

Open **Billing** and pick one:

* **Pay-as-you-go**: \$0.50 per GB of data, prepaid in USDC from \$5. Good for trying things
  out and for small or bursty workloads.
* **Standard**: \$200 per month with 1 TB of data included and 10 requests per second.

See [Pricing](https://docs.bloklake.com/billing/pricing.md) for the details and a comparison.

**3. Copy your API key**

Your plan comes with an API key. It is shown **once**, when it is created. Copy it and keep it
in a secret store or an environment variable:

```bash theme={null}
export BLOKLAKE_API_KEY=bl_live_...
```

Lost it? Rotate the key on **API keys** to get a new one. See [API keys](https://docs.bloklake.com/account/api-keys.md).

**4. Make your first request**

Every USDC transfer in ten Ethereum blocks, as JSON:

```bash theme={null}
curl https://api.bloklake.com/v1/chains/eth/query/json \
  -H "Authorization: Bearer $BLOKLAKE_API_KEY" \
  -H 'content-type: application/json' \
  -d '{
    "fromBlock": 19426000,
    "toBlock": 19426009,
    "logs": [{"address": ["0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"],
              "topic0": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}],
    "fields": {"log": {"blockNumber": true, "transactionHash": true, "topic1": true, "topic2": true, "data": true}}
  }'
```

The response is one JSON object: the rows under `logs`, plus metadata about the range it
covers.

```json theme={null}
{
  "archive_height": 21034551,
  "finalized_block": 21034480,
  "from_block": 19426000,
  "to_block": 19426009,
  "next_block": 19426010,
  "objects": 72,
  "logs": [
    {
      "block_number": 19426000,
      "transaction_hash": "0x…",
      "topic1": "0x0000000000000000000000004622df6fb2d9bee0dcdacf545acdb6a2b2f4f863",
      "topic2": "0x000000000000000000000000…",
      "data": "0x000000000000000000000000000000000000000000000000000000016a6c3a5d"
    }
  ],
  "query_id_template": "0x…",
  "to_block_hash": null,
  "unavailable_fields": []
}
```

**5. Use a client library for real workloads**

`/query/json` is for trying things out. For anything bigger, use one of the official
[client libraries](https://docs.bloklake.com/clients.md). They send the same query to `/query`, which returns the rows as
Apache Arrow: about 2–2.5× smaller than JSON, so 2–2.5× cheaper. The client decodes it back
into JSON rows for you, and handles pagination, retries and truncated responses.

```bash TypeScript / Node.js theme={null}
npm install @bloklake/client
```

```bash Python theme={null}
pip install bloklake
```

```bash Rust theme={null}
cargo add bloklake
cargo add tokio --features full
```

```typescript TypeScript theme={null}
import { Bloklake } from "@bloklake/client";

const bl = new Bloklake({ chain: "eth" }); // API key from BLOKLAKE_API_KEY

const page = await bl.query({
  fromBlock: 19426000,
  toBlock: 19426009,
  logs: [{
    address: ["0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"],
    topic0: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],
  }],
  fields: { log: ["blockNumber", "transactionHash", "topic1", "topic2", "data"] },
});

console.log(page.logs.length, page.logs[0].blockNumber, page.logs[0].data);
console.log("next page starts at", page.meta.nextBlock);
```

```python Python theme={null}
from bloklake import Bloklake

bl = Bloklake(chain="eth")  # API key from BLOKLAKE_API_KEY

page = bl.query({
    "from_block": 19426000,
    "to_block": 19426009,
    "logs": [{
        "address": ["0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"],
        "topic0": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],
    }],
    "fields": {"log": ["block_number", "transaction_hash", "topic1", "topic2", "data"]},
})

print(len(page.logs), page.logs[0]["block_number"], page.logs[0]["data"])
print("next page starts at", page.meta.next_block)
```

```rust Rust theme={null}
use bloklake::{Client, LogField, LogFilter, Query};

#[tokio::main]
async fn main() -> bloklake::Result<()> {
    let client = Client::builder().chain("eth").build()?; // API key from BLOKLAKE_API_KEY

    let query = Query::new()
        .from_block(19426000)
        .to_block(19426009)
        .log(LogFilter::new()
            .address(["0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"])
            .topic0(["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]))
        .log_fields([LogField::BlockNumber, LogField::TransactionHash, LogField::Topic1, LogField::Topic2, LogField::Data]);

    let page = client.query(&query).await?;
    let first = &page.logs[0];
    println!("{} {} {}", page.logs.len(), first.block_number.unwrap(), first.data.as_deref().unwrap());
    println!("next page starts at {}", page.meta.unwrap().next_block);
    Ok(())
}
```

```text theme={null}
72 19426000 0x000000000000000000000000000000000000000000000000000000016a6cff5d
next page starts at 19426010
```

Another language, or want Arrow tables? See [Reading Arrow](https://docs.bloklake.com/responses/reading-arrow.md).

## Next steps

> [card] [Build a filter](https://docs.bloklake.com/querying/filters.md)
>
> Addresses, topics, senders, function selectors, and how they combine.

> [card] [Client libraries](https://docs.bloklake.com/clients.md)
>
> Paging, retries, types and errors in TypeScript, Python and Rust.

> [card] [Page through a large range](https://docs.bloklake.com/querying/pagination.md)
>
> The `next_block` loop every client needs.

> [card] [Index ERC-20 transfers](https://docs.bloklake.com/guides/erc20-transfers.md)
>
> A complete backfill, end to end.

> [card] [Production checklist](https://docs.bloklake.com/production/best-practices.md)
>
> Retries, rate limits, reorgs and cost.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.