> TickerLayer documentation for AI agents and LLMs, the Markdown version of https://tickerlayer.com/docs/quickstart
> REST base URL https://api.tickerlayer.com, API key in the `x-api-key` header. WebSocket wss://stream.tickerlayer.com?apiKey=YOUR_API_KEY.
> Any docs page reads as Markdown at its URL plus `.md`. Index: https://tickerlayer.com/llms.txt · Full API reference: https://tickerlayer.com/llms-full.txt

# Quickstart

Issue a key and make your first REST call in a few minutes, then stream over WebSocket on a paid plan or a trial.

## 1. Get an API key

Sign up (verify your email if asked), then open **Dashboard → API key** and reveal the key to copy it. If an older key cannot be revealed, keep using your saved copy or contact support before replacing it.

## 2. Authenticate

| Surface | Send the key as |
| --- | --- |
| REST | `x-api-key: <YOUR_API_KEY>` header on every request |
| WebSocket | `wss://stream.tickerlayer.com/?apiKey=<YOUR_API_KEY>` on the upgrade URL ([Connection](https://tickerlayer.com/docs/websocket/connection)) |

Servers, native apps, curl and Postman need nothing more. A browser app can call REST only from an approved origin: contact us to allowlist your domain. Full guide: [Authentication](https://tickerlayer.com/docs/authentication).

## 3. Make your first REST call

The latest BTC/USD quote:

```bash
curl -sS "https://api.tickerlayer.com/crypto/quote/BTCUSD" \
  -H "x-api-key: <YOUR_API_KEY>"
```

```python
import requests

res = requests.get(
    "https://api.tickerlayer.com/crypto/quote/BTCUSD",
    headers={"x-api-key": "<YOUR_API_KEY>"},
)
print(res.json())
```

```javascript
const res = await fetch("https://api.tickerlayer.com/crypto/quote/BTCUSD", {
  headers: { "x-api-key": "<YOUR_API_KEY>" },
});
const data = await res.json();
console.log(data);
```

```go
req, _ := http.NewRequest("GET", "https://api.tickerlayer.com/crypto/quote/BTCUSD", nil)
req.Header.Set("x-api-key", "<YOUR_API_KEY>")
```

**Response 200**

```json
{
  "symbol": "BTCUSD",
  "bid": 84210.12,
  "ask": 84210.45,
  "bid_size": 1.2,
  "ask_size": 0.8,
  "timestamp": 1743512400000
}
```

## 4. Open a WebSocket

WebSocket comes with the Individual and Business plans (Perpetuals streams on Business). On the Free plan the connection is refused with `403` and `WS_NOT_INCLUDED`; request a 7-day trial from the dashboard, under Plan & access.

Connect, wait for the `ready` frame, then subscribe. The first frame is always `{ "type": "system", "event": "ready", "ts": <unix_ms> }`.

```javascript
const key = "<YOUR_API_KEY>";
const ws = new WebSocket(
  "wss://stream.tickerlayer.com/?apiKey=" + encodeURIComponent(key)
);

ws.addEventListener("message", (ev) => {
  const msg = JSON.parse(String(ev.data));
  if (msg.type === "system" && msg.event === "ready") {
    ws.send(JSON.stringify({
      action: "subscribe",
      channels: ["crypto.quotes"],
      symbols: ["BTCUSD"],
    }));
    return;
  }
  console.log(msg); // quote | trade | system | error
});
```

## Next steps

- [Data feeds](https://tickerlayer.com/docs#what-you-can-access): Stocks, forex, crypto, indices, ETFs, commodities, bonds and perpetuals.
- [Symbols](https://tickerlayer.com/docs/rest/symbols): List the symbols your key can read.
- [Subscriptions](https://tickerlayer.com/docs/websocket/subscriptions): Channels, snapshots and subscribe limits.
- [Message types](https://tickerlayer.com/docs/websocket/messages): Every frame the stream sends, field by field.
- [Rate limits](https://tickerlayer.com/docs/limits): Monthly quotas, per-second limits and 429 responses.
- [Errors](https://tickerlayer.com/docs/errors): Status codes and error bodies.
