Forex Realtime

You can access any endpoint via websockets if you have subscriped to the premium or enterprise package

To access forex realtime data use both subscribe and unsubscribe action. You will receive an update if the forex data has changed.

  • Subscribe: {"action": "subscribe", "channel": "forex", "symbol": "EUR/USD"}
  • Unsubscribe: {"action": "unsubscribe", "channel": "forex", "symbol": "EUR/USD"}

Example

1. Connect to the websocket

CLI command:
wscat -c "wss://ws.bavest.co/v0" -H "x-api-key: <API KEY>"

2. Subscribe to forex data

{"action": "subscribe", "channel": "forex", "symbol": "EUR/USD"}

3. Unsubscribe if needed

{"action": "unsubscribe", "channel": "forex", "symbol": "EUR/USD"}

Parameter description

Symbol: In the context of forex data, a "symbol" refers to a currency pair that represents the exchange rate between two currencies.

Channel : A "channel" is a logical stream of information that the server provides.

Action The "action" is a directive you send to the server to indicate what operation you want to perform. Common actions include "subscribe" and "unsubscribe." When you send a message with the action "subscribe," you are requesting to start receiving updates for the specified channel and symbol. Conversely, when you send a message with the action "unsubscribe," you are indicating that you want to stop receiving updates for the given channel and symbol.