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

# Quickstart

> Fetch a token, its trades and its chart, then stream them live.

Base URL: `https://api.raze.bot`. Every route except `/health` and `/v1/openapi.yaml` needs a key.

<Steps>
  <Step title="Get a key">
    Create a key in the [portal](https://raze.bot/pricing). Send it as `x-api-key` (or `Authorization: Bearer`, or `?apiKey=` where headers are impossible).
  </Step>

  <Step title="Pick a chain">
    `sol`, `eth`, `bsc`, `base` or `robinhood`. See [Chains](/get-started/chains).
  </Step>

  <Step title="Fetch a token">
    `GET /v1/tokens/{chain}/{address}` answers `{"data": Token}`.
  </Step>
</Steps>

## curl

```bash theme={null}
export KEY=your_key
export API=https://api.raze.bot
MINT=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263   # BONK

# Everything about a token
curl -sS -H "x-api-key: $KEY" "$API/v1/tokens/sol/$MINT"

# Its last 100 trades, and its last 300 one-second candles
curl -sS -H "x-api-key: $KEY" "$API/v1/tokens/sol/$MINT/trades?limit=100"
curl -sS -H "x-api-key: $KEY" "$API/v1/tokens/sol/$MINT/candles?interval=1s&limit=300"

# What just launched, what is about to graduate, what graduated
curl -sS -H "x-api-key: $KEY" "$API/v1/launchpad/new?chain=sol"
curl -sS -H "x-api-key: $KEY" "$API/v1/launchpad/graduating"
curl -sS -H "x-api-key: $KEY" "$API/v1/launchpad/graduated?chain=bsc"
```

The same token routes on every chain:

| Chain | Example |
| - | - |
| `sol` | `GET /v1/tokens/sol/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263` |
| `eth` | `GET /v1/tokens/eth/0x6982508145454ce325ddbe47a25d4ec3d2311933` |
| `bsc` | `GET /v1/tokens/bsc/0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82` |
| `base` | `GET /v1/tokens/base/0x532f27101965dd16442e59d40670faf5ebb142e4` |
| `robinhood` | `GET /v1/tokens/robinhood/0xd0601ce157db5bdc3162bbac2a2c8af5320d9eec` |

## Node.js

```javascript theme={null}
const API = process.env.RAZE_API ?? "https://api.raze.bot";
const KEY = process.env.RAZE_API_KEY;

const res = await fetch(`${API}/v1/tokens/sol/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263`, {
  headers: { "x-api-key": KEY },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const t = body.data;
console.log(t.symbol, t.priceUsd, t.marketCapUsd, t.stats["24h"].volumeUsd);
```

## Python

```python theme={null}
import os, requests

API = os.environ.get("RAZE_API", "https://api.raze.bot")
KEY = os.environ["RAZE_API_KEY"]

r = requests.get(
    f"{API}/v1/tokens/sol/DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
    headers={"x-api-key": KEY},
    timeout=30,
)
body = r.json()
if not r.ok:
    raise RuntimeError(body["error"])
t = body["data"]
print(t["symbol"], t["priceUsd"], t["marketCapUsd"])
```

## Live

One WebSocket carries every channel. Each subscription answers a `snapshot` first, then changes, so you never need the REST call and the stream at the same time.

```javascript theme={null}
const ws = new WebSocket(`wss://api.raze.bot/v1/ws?apiKey=${KEY}`);
ws.onopen = () => {
  ws.send(JSON.stringify({ op: "subscribe", id: "tape", channel: "trades", chain: "sol", token: mint }));
  ws.send(JSON.stringify({ op: "subscribe", id: "chart", channel: "candles", chain: "sol", token: mint, interval: "1s" }));
  ws.send(JSON.stringify({ op: "subscribe", id: "new", channel: "launchpad", board: "new" }));
};
ws.onmessage = (e) => {
  const f = JSON.parse(e.data); // {id, channel, type: "snapshot" | "trade" | "candle" | "add" | …, data}
  if (f.id === "tape" && f.type === "trade") console.log(f.data.side, f.data.volumeUsd);
};
```

<Warning>
  `?apiKey=` puts the key in a URL the browser can see. Use it from your server, or proxy the socket through your backend; do not ship a key to end users.
</Warning>

## What to call next

<CardGroup cols={2}>
  <Card title="Trades" href="/api-reference/tokens/trades">
    `GET /v1/tokens/{chain}/{address}/trades`
  </Card>

  <Card title="Screener" href="/api-reference/discovery/screener">
    `GET /v1/screener?chain=bsc`
  </Card>

  <Card title="Channels" href="/streaming/channels">
    Every live frame
  </Card>

  <Card title="WebSocket" href="/streaming/websocket">
    `GET /v1/ws`
  </Card>
</CardGroup>


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