Skip to main content

WebSockets Quickstart

Create a connection to the Sandbox BTC Market Data Feed in less than five minutes.

Use the command line to open a WebSocket connection to the Sandbox BTC Market Data Feed.

1. Install WebSocket Client

The quickest way to open a connection is by using wscat, which runs in the terminal. Using the Python websocket-client package requires a bit of code and the Python shell.

Open the terminal and install wscat using the -g (global) flag.

npm install -g wscat

Ensure wscat is working. If you see the version number, the module is working:

wscat --version

Leave the terminal window open.

2. Connect to Sandbox Feed

Open a long-lived connection to the Sandbox BTC Market Data Feed.

wscat --connect wss://ws.sandbox.paxos.com/marketdata/BTCUSD

3. Review Sandbox Feed

If everything worked, you see the initial SNAPSHOT and then an UPDATE stream in the terminal.

Sandbox BTC Market Data Feed (wscat)
Connected (press CTRL+C to quit)
< {
"type": "SNAPSHOT",
"market": "BTCUSD",
"bids": [
{
"price": "19994.25",
"amount": "0.7755"
},
{
"price": "19993.75",
"amount": "0.83676985"
},
...
],
"asks": [
{
"price": "19994.5",
"amount": "0.97548541"
},
{
"price": "19996",
"amount": "1.135"
},
...
],
"final_snapshot": true
}

< {
"type": "UPDATE",
"market": "BTCUSD",
"side": "BUY",
"price": "19958.5",
"amount": "0.62649999"
}

< {
"type": "UPDATE",
"market": "BTCUSD",
"side": "SELL",
"price": "20115.25",
"amount": "0"
}
...

Next Steps

Connect to other Sandbox data feeds.

wss://ws.sandbox.paxos.com/marketdata
wss://ws.sandbox.paxos.com/marketdata/{market}
wss://ws.sandbox.paxos.com/executiondata
wss://ws.sandbox.paxos.com/executiondata/{market}

Learn more about Paxos WebSockets in the WebSocket reference.

✉️ Question? Contact us:
Crypto Brokerage Support | Commodities Settlement Support | Help Desk

📃 Check out our Changelog.