Bitstamp WebSocket API
Subscribe to Bitstamp v2 public channels for live ticker, trade and order book updates across BTC, ETH, XRP, LTC and the rest of the trading pairs.
Subscribe to Bitstamp v2 public channels for live ticker, trade and order book updates across BTC, ETH, XRP, LTC and the rest of the trading pairs.
Bitstamp WebSocket v2 client — live trades, order book and detailed order events for every supported instrument.
TsgcWSAPI_Bitstamp
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Pair the component with a TsgcWebSocketClient, then call SubscribeLiveTrades, SubscribeOrderBook or SubscribeLiveOrders per currency pair.
uses
sgcWebSocket, sgcWebSocket_API_Bitstamp;
var
WSClient: TsgcWebSocketClient;
Bitstamp: TsgcWSAPI_Bitstamp;
begin
WSClient := TsgcWebSocketClient.Create(nil);
Bitstamp := TsgcWSAPI_Bitstamp.Create(nil);
Bitstamp.Client := WSClient;
WSClient.Active := True;
Bitstamp.SubscribeLiveTrades('btcusd');
Bitstamp.SubscribeOrderBook('btcusd');
Bitstamp.SubscribeLiveOrders('btcusd');
end;
// uses: sgcWebSocket, sgcWebSocket_API_Bitstamp
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Bitstamp *Bitstamp = new TsgcWSAPI_Bitstamp(this);
Bitstamp->Client = WSClient;
WSClient->Active = true;
Bitstamp->SubscribeLiveTrades("btcusd");
Bitstamp->SubscribeOrderBook("btcusd");
Bitstamp->SubscribeLiveOrders("btcusd");
Live trade tape, detailed order events, full order-book snapshots and incremental detail-order-book updates.
SubscribeLiveTrades opens the live_trades_xxx channel and delivers individual trade ticks (price, amount, microtimestamp, buy/sell side) per pair.
SubscribeOrderBook (top 100), SubscribeDetailOrderBook (full L3 detail) and SubscribeDiffOrderBook (incremental updates) cover every level of order-book detail Bitstamp exposes.
SubscribeLiveOrders publishes order_created, order_changed and order_deleted events for the chosen currency pair — the raw L3 order tape.
On TsgcWebSocketClient WatchDog reconnect the component re-subscribes to every previously active channel so no manual replay is needed.
Bitstamp v2 uses connection-level heartbeats — configure the underlying client's HeartBeat property to keep the connection alive through firewalls and NAT translators.
A single component handles many currency pairs concurrently; OnBitstamp* events surface the originating pair so you can route the payload appropriately.
Authoritative sources for the APIs this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — API_Bitstamp Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\05.Crypto\02.Bitstamp Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |