Quick Start
Prerequisites
- Valid Amberdata API key
- WebSocket client (we’ll use
wscatfor examples)
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Learn how to connect to Amberdata’s WebSocket services and make your first subscription for real-time, low-latency data streaming.
wscat for examples)npm install -g wscat
wscat -c "wss://ws.amberdata.com/spot" -H "x-api-key: <your-api-key>"
{
"jsonrpc": "2.0",
"id": 1,
"method": "subscribe",
"params": ["market:spot:trades", {"exchange": "binance", "pair": "btc_usdt"}]
}
{
"jsonrpc": "2.0",
"id": 1,
"result": "a04c6fe3-f85a-402c-8f29-d17627b48576",
"metadata": [
"exchange",
"pair",
"timestamp",
"timestampNanoseconds",
"tradeId",
"price",
"volume",
"isBuy"
]
}
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"subscription": "a04c6fe3-f85a-402c-8f29-d17627b48576",
"result": [
[
"binance",
"btc_usdt",
1755108576827,
747408,
"5154882831",
121651.18,
0.00041,
true
]
]
}
}
| Data Type | Connection URL | Best For |
|---|---|---|
| General | wss://ws.amberdata.com | Blockchain data, general subscriptions |
| Spot Markets | wss://ws.amberdata.com/spot | Spot trading data (OHLCV, tickers, trades) |
| Futures | wss://ws.amberdata.com/futures | Futures data (funding rates, liquidations, OI) |
| Options | wss://ws.amberdata.com/options | Options data (liquidations, OI, trades) |
| DEX | wss://ws.amberdata.com/defi/dex | Decentralized exchange trades |
| Field | Type | Required | Description |
|---|---|---|---|
jsonrpc | string | Yes | Must be “2.0” |
method | string | Yes | ”subscribe” or “unsubscribe” |
params | array | Yes | [subscription_type, options_object] |
id | number | Yes | Client-generated identifier |
{
"jsonrpc": "2.0",
"id": 1,
"method": "subscribe",
"params": ["market:spot:trades", {"exchange": "coinbase", "pair": "btc_usd"}]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "subscribe",
"params": ["market:spot:trades", {"exchange": "binance", "pair": "btc_usdt"}]
}
{
"jsonrpc": "2.0",
"id": 2,
"method": "subscribe",
"params": ["market:spot:trades", {"exchange": "binance", "pair": "eth_usdt"}]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "subscribe",
"params": ["market:spot:trades", {"pair": "btc_usdt"}]
}
wscat -c "wss://ws.amberdata.com" -H "x-api-key: <your-api-key>" -H "x-amberdata-blockchain-id: ethereum-mainnet"
| Blockchain | Network | Blockchain ID |
|---|---|---|
| Bitcoin | Mainnet | bitcoin-mainnet |
| Bitcoin Cash | Mainnet | bitcoin-abc-mainnet |
| Ethereum | Mainnet | ethereum-mainnet |
| Litecoin | Mainnet | litecoin-mainnet |
{
"jsonrpc": "2.0",
"method": "unsubscribe",
"params": ["242d29d5c0ec9268f51a39aba4ed6a36c757c03c183633568edb0531658a9799"],
"id": 1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
{
"jsonrpc": "2.0",
"id": 0,
"error": {
"description": "invalid api key 'UAKHelloCryptoHiAmberdata'",
"code": 401
}
}
Was this page helpful?