Protocols Overview
| HTTP (Rest API) | WebSocket (Real-time data) | |
|---|---|---|
| Purpose | Ideal for on-demand queries, especially when specific data is required. | Designed for long-lived connections that demand real-time updates. |
| Usage | Suitable for fetching the latest financial instrument price or making a parameterized call, like acquiring historical data or converting from one instrument to another. | By connecting to the WebSocket protocol and providing a list of symbols to monitor, the server establishes an active connection. When there is a price change for the specified instruments, the server pushes a message to notify the client immediately. |
Choosing the Right Protocol
| HTTP (Rest API) | WebSocket (Real-time data) | |
|---|---|---|
| When to Use | If your application necessitates on-demand data queries. | If your application requires continuous real-time updates for specific instruments. |
| Usage | Quick responses, ideal for occasional or one-off requests. | Always-on connection, instant notifications on price changes, optimized for monitoring multiple instruments simultaneously. |
Examples and Use Cases
| HTTP (Rest API) | WebSocket (Real-time data) |
|---|---|
|
|
