Documentation Index
Fetch the complete documentation index at: https://tradewatch.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
This page will help you understand the two main protocols available for accessing financial data through TradeWatch: HTTP (Rest API) and WebSocket (Real-time data). We will explain the differences between these APIs and guide you in choosing the appropriate one for your specific needs.
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) |
|---|
- Fetch the current price of Bitcoin
- Get historical price data of Apple stocks for the past year
- Convert US Dollars to Euros using the latest conversion rate
- Convert US Dollars to Euros using the latest conversion rate
| - Monitor price fluctuations of NASDAQ, Dow Jones, and S&P500 in real-time.
- Track currency pairs like EUR/USD, GBP/USD for forex trading platforms.
- Monitor multiple cryptocurrencies like Bitcoin, Ethereum, and Litecoin for instant trade decisions.
|