Coinbase WebSocket API
Stream Coinbase Advanced Trade market data (ticker, level2, market_trades, candles) and authenticated user channels with HMAC/JWT signing.
Stream Coinbase Advanced Trade market data (ticker, level2, market_trades, candles) and authenticated user channels with HMAC/JWT signing.
Coinbase Advanced Trade client — ticker, level2 order book, market_trades, candles, status and the authenticated user channel.
TsgcWSAPI_Coinbase
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Pair with a TsgcWebSocketClient, supply API key/secret for signed channels, then subscribe to ticker, level2, market_trades or user.
uses
sgcWebSocket, sgcWebSocket_API_Coinbase;
var
WSClient: TsgcWebSocketClient;
Coinbase: TsgcWSAPI_Coinbase;
begin
WSClient := TsgcWebSocketClient.Create(nil);
Coinbase := TsgcWSAPI_Coinbase.Create(nil);
Coinbase.Client := WSClient;
Coinbase.Coinbase.ApiKey := 'your-api-key';
Coinbase.Coinbase.ApiSecret := 'your-api-secret';
WSClient.Active := True;
Coinbase.SubscribeTicker(['BTC-USD']);
Coinbase.SubscribeLevel2(['BTC-USD']);
Coinbase.SubscribeMarketTrades(['BTC-USD']);
Coinbase.SubscribeUser;
end;
// uses: sgcWebSocket, sgcWebSocket_API_Coinbase
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_Coinbase *Coinbase = new TsgcWSAPI_Coinbase(this);
Coinbase->Client = WSClient;
WSClient->Active = true;
Coinbase->SubscribeTicker(OPENARRAY(UnicodeString, ("BTC-USD")));
Coinbase->SubscribeLevel2(OPENARRAY(UnicodeString, ("BTC-USD")));
Advanced Trade streams: ticker, ticker_batch, level2, market_trades, candles, status, plus the authenticated user channel.
SubscribeTicker, SubscribeTickerBatch, SubscribeLevel2, SubscribeMarketTrades, SubscribeCandles and SubscribeStatus handle every Advanced Trade public stream.
SubscribeUser opens the authenticated user channel and delivers order, fill and account-level events for the signed-in identity.
Coinbase Advanced Trade supports both legacy HMAC signing and newer JWT auth — the component picks the right scheme based on the credentials supplied.
level2 and market_trades deliver a sequence_num per envelope; the component watches for gaps and raises OnException if a re-subscribe is required.
Every subscribe call accepts an array of product IDs (BTC-USD, ETH-USD, ...) so a single connection can multiplex hundreds of instruments.
For snapshot data and order placement use the REST counterpart — the WebSocket component focuses on real-time streams.
Autorytatywne źródła API implementowanych przez ten komponent.
Deep-link do dokumentacji komponentu, gotowy do uruchomienia projekt demonstracyjny i pobranie wersji próbnej.
| Pomoc online — API_Coinbase Pełna dokumentacja właściwości, metod i zdarzeń tego komponentu. | Otwórz | |
| Projekt demonstracyjny — Demos\05.Crypto\09.Coinbase Gotowy do uruchomienia projekt przykładowy. Dostarczany wewnątrz pakietu sgcWebSockets — pobierz wersję próbną poniżej. | Otwórz | |
| Dokument techniczny (PDF) Funkcje, szybki start, przykłady kodu dla Delphi i C++ Builder oraz odniesienia do źródeł pierwotnych — tylko ten komponent. | Otwórz | |
| Podręcznik użytkownika (PDF) Kompleksowy podręcznik obejmujący każdy komponent biblioteki. | Otwórz |