Skip to main content
1

Install WebSocket client

We recommend using websocat for testing WebSocket connections.
brew install websocat
2

Connect

Connect to the WebSocket API using your API key. Replace <YOUR_API_KEY> with your actual key. You can connect to any of the supported channels, such as currencies/quotes.
websocat -H='api-key: <YOUR-API-KEY>' wss://api.tradewatch.io/currencies/quotes
Upon connecting, you will receive a status message indicating the current subscriptions (initially empty):
{"event": "status", "symbols": []}
3

Subscribe

Once connected, paste the following JSON message to subscribe to currency pairs:
{
  "action": "subscribe",
  "symbols": [
    "EURUSD",
    "GBPUSD"
  ]
}
4

Receive Data

You will receive a status message confirming your subscription, followed by live quote updates.
{"event": "status", "symbols": ["EURUSD", "GBPUSD"]}
{"symbol": "EURUSD", "timestamp": "1767389239253", "ask": "1.17174", "bid": "1.17164", "mid": "1.17169"}
{"symbol": "GBPUSD", "timestamp": "1767389242294", "ask": "1.34556", "bid": "1.34543", "mid": "1.3455"}
5

Unsubscribe

To stop receiving updates for specific symbols, send an unsubscribe message:
{
  "action": "unsubscribe",
  "symbols": [
    "EURUSD"
  ]
}
You will receive a confirmation message with the list of remaining subscribed symbols:
{"event": "status", "symbols": ["GBPUSD"]}

What’s Next

Now that you’re connected, check out these resources to build your integration: