Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.amberdata.io/llms.txt

Use this file to discover all available pages before exploring further.

WebSocket URL Notice

This endpoint currently uses the following WebSocket URL:
wss://analytics-ws.amberdata.com/prices
This temporary URL applies only to the Prices WebSocket endpoint while we complete internal infrastructure updates for the new Prices WebSocket service. All other WebSocket endpoints will continue to use the existing standard WebSocket URL. Once this work is complete, the Prices WebSocket endpoint will be migrated to align with our standard WebSocket URL structure. We will provide notice before making any changes that require client-side updates.

Asset Prices

Request

All assets:
{"jsonrpc":"2.0","id":1,"method":"subscribe","params":["prices:spot:asset",{"asset":"all"}]}
Specific asset:
{"jsonrpc":"2.0","id":1,"method":"subscribe","params":["prices:spot:asset",{"asset":"btc"}]}
ParamTypeDescription
assetstringThe asset by which to filter. Use all for all assets.

Response

{
  "jsonrpc": "2.0",
  "method": "subscription",
  "params": {
    "subscription": "a3fd4e8d-b344-480f-b1c4-2726c014ae85",
    "result": {
      "asset": "btc",
      "assetArcId": "AMB:BTC000000000",
      "priceUSD": 81650.48236869258,
      "timestamp": 1777995360000,
      "type": "asset",
      "volumeAsset": 74.17509235915826
    }
  }
}
FieldTypeDescription
assetstringThe asset symbol.
assetArcIdstringThe Amberdata ARC ID for the asset.
priceUSDnumberThe USD price of the asset.
timestampnumberThe time at which the price update occurred.
typestringThe price update type.
volumeAssetnumberThe asset volume.

Example

const WebSocket = require('ws');

const ws = new WebSocket('wss://analytics-ws.amberdata.com/prices', {
  headers: { 'x-api-key': '<api_key>' }
});

ws.on('open', () => {
  ws.send(JSON.stringify({
    jsonrpc: '2.0',
    method: 'subscribe',
    params: ['prices:spot:asset', { asset: 'all' }],
    id: 1
  }));
});

ws.on('message', data => {
  console.log(JSON.stringify(JSON.parse(data), null, 2));
});

Instrument Prices

Request

All instruments:
{"jsonrpc":"2.0","id":1,"method":"subscribe","params":["prices:spot:instrument",{"instrument":"all"}]}
Specific instrument:
{"jsonrpc":"2.0","id":1,"method":"subscribe","params":["prices:spot:instrument",{"instrument":"btc_usdt"}]}
ParamTypeDescription
instrumentstringThe instrument by which to filter. Use all for all instruments.

Response

{
  "jsonrpc": "2.0",
  "method": "subscription",
  "params": {
    "subscription": "3276cfc7-0d2d-43bb-8b5a-0ff4f94af296",
    "result": {
      "arcInstrumentId": "AMB:BTC000000000_AMB:USD000000335",
      "instrument": "btc_usdt",
      "priceUSD": 81640.61888782766,
      "timestamp": 1777995360000,
      "type": "instrument",
      "volumeAsset": 28.394765248158286
    }
  }
}
FieldTypeDescription
arcInstrumentIdstringThe Amberdata ARC ID for the instrument.
instrumentstringThe instrument symbol.
priceUSDnumberThe USD price of the instrument.
timestampnumberThe time at which the price update occurred.
typestringThe price update type.
volumeAssetnumberThe asset volume.

Example

const WebSocket = require('ws');

const ws = new WebSocket('wss://analytics-ws.amberdata.com/prices', {
  headers: { 'x-api-key': '<api_key>' }
});

ws.on('open', () => {
  ws.send(JSON.stringify({
    jsonrpc: '2.0',
    method: 'subscribe',
    params: ['prices:spot:instrument', { instrument: 'all' }],
    id: 1
  }));
});

ws.on('message', data => {
  console.log(JSON.stringify(JSON.parse(data), null, 2));
});