Hi, I am new to Binance API.
What I am trying is that to make my React.js web application display the real-time BTC price in USD.
const ws = new WebSocket('wss://stream.binance.com:9443/ws/btsusdt@trade');
I was using the line of code to open the WebSocket, and want to get the BTC price in USD, not USDT. But when I tried it with ‘btcusd’, it does not return any information at all. I have been Googling for this for a long time and could not find anything helpful.
My current code returns something like 0.089 as a ‘p’ value, which represents ‘price’ as shown in the official documentation: link, while the Binance website says that the BTC price is around 48,000 USD now.
I tried to get the Ethereum price by using the following line of code for a test:
const ws = new WebSocket('wss://stream.binance.com:9443/ws/etheur@trade');
And it returns the right information.
How can I get the BTC price in USD?
And, can anyone help me where I can find information regarding symbols I can use for the Binance API, especially for the WebSocket? I could not find it even I read the official documentation.
Thank you!