WebSocket APIs

There are several implementations based on WebSockets: finance, message publishing, queues... sgcWebSockets implements the most important APIs based on WebSocket protocol. In order to use an API, just attach API component to the client and all messages will be handled by API component (only one API component can be attached to a client).

 

Client APIs

 

API Description
Binance is an international multi-language cryptocurrency exchange.
Binance Futures allows you to connect to Binance Futures WebSocket / REST Market Streams.
Coinbase

Coinbase is a US-based crypto exchange. Trade Bitcoin (BTC), Ethereum (ETH), and more for USD, EUR, and GBP. Support for WebSocket API and REST API.

SignalR is a library for ASP.NET developers that makes developing real-time web functionality using WebSockets as transport.
SignalRCore

ASP.NET Core SignalR is an open-source library that simplifies adding real-time web functionality to apps.

SocketIO is a JavaScript library for real-time web applications. It enables real-time, bi-directional communication between web clients and servers.
Kraken is a US-based cryptocurrency exchange.
Kraken Futures allows you to connect to Kraken Futures WebSocket / REST Market data.
Pusher Pusher is an easy and reliable platform with flexible pub/sub messaging, live user lists, authentication...
Bitfinex Bitfinex is one of the world's largest and most advanced cryptocurrency trading platform. Users can exchange Bitcoin, Ethereum, Ripple, EOS, Bitcoin Cash, Iota, NEO, Litecoin, Ethereum Classic...
Bitstamp Bitstamp is one of the world's longest standing crypto exchange, supporting the blockchain ecosystem since 2011.
Huobi is an international multi-language cryptocurrency exchange.
Cex is a cryptocurrency exchange and former Bitcoin cloud mining provider.
Cex Plus CEX.IO Exchange Plus is the ultimate crypto trading platform that features deep liquidity and advanced trading tools
Bitmex is a cryptocurrency exchange and derivative trading platform.
3Commas It's a crypto trading bot.
Kucoin is a cryptocurrency exchange that allows you to buy, sell, and store cryptocurrencies like BTC, ETH, KCS, SHIB, DOGE
Kucoin Futures allows you to connect to Kucoin Futures Servers (WebSocket and REST)
OKX formerly known as OKEx, is one of the largest crypto spot and derivatives trading exchanges.
XTB FX and CFD trading, providing access to over +2000 financial markets.
Discord is one of the most popular communication tools for online gaming and streaming.
Bybit cryptocurrency exchange and trading platform
OpenAI API The OpenAI Realtime API enables low-latency, multimodal interactions including speech-to-speech conversational experiences and real-time transcription.
MEXC Centralized cryptocurrency exchange and trading platform, this component implements the SPOT API.
MEXC Futures Centralized cryptocurrency exchange and trading platform, this component implements the Futures API.
Bitget Cryptocurrency exchange and trading platform supporting Spot and Futures markets.
Gate.io Cryptocurrency exchange supporting Spot and Futures trading with WebSocket and REST APIs.
Deribit Cryptocurrency derivatives exchange offering futures and options trading on Bitcoin and Ethereum.
Crypto.com Cryptocurrency exchange supporting Market and User channels with WebSocket and REST APIs.
HTX International cryptocurrency exchange (formerly Huobi) with REST API for market data and trading.

 

 

WebSocket APIs can be registered at runtime, just call Method RegisterAPI and pass API component as a parameter.

 

 

Other Client APIs

 

API Description
Telegram is a cloud-based instant messaging and voice over IP service. Users can send messages and exchange photos, videos, stickers, audio and files of any type.
Whatsapp is an internationally available American freeware, cross-platform centralized instant messaging and voice-over-IP service
RCON is a TCP/IP-based communication protocol which allows console commands to be issued to the server.
CryptoHopper It's a crypto trading bot and portfolio manager.
CryptoRobotics It's a crypto trading robot.

 

 

 

Server APIs

API Description
RTCMultiConnection RTCMultiConnection is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)
WebPush The Web Push protocol allows web applications to send notifications to users even when the application is not open or active.
WebAuthn FIDO2/WebAuthn server API for passwordless authentication using biometrics, security keys and passkeys.

 

 

Errors in HTTP Requests

The API components send their REST requests through a common HTTP client. When a request fails with an HTTP error status, the client raises EsgcHTTPAPIProtocolException, declared in the unit sgcHTTP_API. This exception descends from the exception raised in previous versions, so existing exception handlers keep working without any change, and it carries the response headers of the failed request. Before, the HTTP object was destroyed before the error reached the application and those headers were lost, so a Retry-After header on an HTTP 429, or the rate-limit counters returned by the exchanges, could not be read at all.

 

 

The ResponseHeaders parameter accepted by the Post and Query methods is now filled when the request fails too, not only when it succeeds.

 

Read Binance | Get Market Data for a complete example.

 

 

Throttle

Every WebSocket API client has a Throttle property, which limits the messages the client sends to the server. Exchanges close a connection that exceeds their message rate, so a burst of subscribe frames can drop the socket.