Websocket Ticker

Hi ,
Iam using the websocket to fetch the live prices of the coins . Iam getting an error {type:“error”,message:“Malformed JSON”} intermittently . Please check the issue . The payload is added .

{“type”:“subscribe”,“channels”: [“ticker”],“product_ids”:[“BTC-USDT”,“ETH-USDT”]}

Hello @Bejo, Welcome to the forum! Thank you for taking interest in our Coinbase Cloud services.

Upon checking the API payload that you have sent, we noticed that the double quotation marks seem to be formatted differently. And so, we manually replaced all the quotation marks on the API payload and we were able to successfully subscribe to the ticker channel.

You can also try to utilize a JSON formatter if you don’t want to change those characters manually. You can search for a JSON formatter online if you don’t have it.

We hope this helps! If you have further questions feel free to respond to this thread!

1 Like