Skip to main content
1

Get your API key

You’ll need an API key to authenticate your requests. You can create one in Profile -> Keys.More information about API keys can be found on the Authentication page.
2

Install WebSocket client

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

Connect

Connect to the WebSocket API using your API key. Replace <YOUR_API_KEY> with your actual key.
websocat -H='api-key: <YOUR-API-KEY>' wss://api.xchangeapi.com/websocket/live
You won’t receive a confirmation message upon connecting. You can proceed directly to the next step.
4

Subscribe

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

Receive Data

You will receive an initial message followed by live updates.
0{"session_uid":"572733aab7e148cb852564cd5eef5d14","time_mult":1000,"start_time":1766933673.1651759148,"order":["name","ask","bid","time"],"mapping":{"1":"GBPUSD","0":"EURUSD"}}
10|1.17714|1.17680|-14373540
11|1.35004|1.34965|-14373539

What’s Next

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