Skip to main content

Connect to the WebSocket Stablecoin Price Feed

Open a WebSocket connection to the Sandbox USDCUSD feed.

Use the command line to open a WebSocket connection to the Sandbox USDCUSD stablecoin market price feed.

See the WebSocket API reference for more details.

➊ 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.

➋ Connect to Sandbox Feed

Open a long-lived connection to the Sandbox USDCUSD stablecoin market price feed.

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

➌ Review Sandbox Feed

If everything worked, USDCUSD the pricing data streams to the terminal.

Sandbox USDCUSD stablecoin market price feed (wscat)
Connected (press CTRL+C to quit)
{"market":"USDCUSD","price":"0.9996","timestamp":"2024-11-04T16:12:38.053038191Z"}

{"market":"USDCUSD","price":"0.9996","timestamp":"2024-11-04T16:12:39.080704227Z"}

{"market":"USDCUSD","price":"0.9996","timestamp":"2024-11-04T16:12:40.044403631Z"}

...