I’ve tried various posts on here with working websockets but can’t get them to work. Looks like coinbase advanced websocket needs the api keys and I put those in and still couldn’t get it to work.
Here’s my scenario. I have a websocket that works with coinbase pro and I’m trying to convert it to work with coinbase advanced. I had installed a package from github called “cbpro” and used that for the websocket on coinbase pro. I would run the websocket every 20 seconds or so and bring the prices in. I’m not wanting it to run continuously. It also put it in a dataframe and returned the results.
Here is my code for the coinbase pro websocket. Can anyone convert this to work with coinbase advanced? Any help is appreciated.
import pandas as pd
self.url = “wss://ws-feed.pro.coinbase.com/”
self.products = [“00-USD”,
self.channels = [“ticker”]
def on_message(self, msg):
if “price” in msg and “product_id” in msg:
wsClient = myWebsocketClient()
df = pd.DataFrame(results)