Having issues with websocket

Here is the websocket I used with CoinBasePro. Notice it runs for 1.5 seconds and outputs the data to a dataframe. I had installed a package from github called cbpro that was also used. Can someone show me how to do this with Coinbase Advaced Trade without the need for an outside package from github?

import time
import cbpro
import numpy
import pandas as pd

results =

class myWebsocketClient(cbpro.WebsocketClient):

def on_open(self):
self.url = “wss://ws-feed.pro.coinbase.com/”
self.products = [“BTC-USD”
self.channels = [“ticker”]

def on_message(self, msg):
if “price” in msg and “product_id” in msg:

wsClient = myWebsocketClient()


df = pd.DataFrame(results)

Hey @Hawkster, To subscribe the Websockets feeds for Advanced Trade, you may refer the documentation here: Advanced Trade WebSocket Overview | Coinbase Cloud

Endpoint: wss://advanced-trade-ws.coinbase.com

You may also refer the documentation here for Subscribe code example

We hope this helps. We’d be happy to answer any more questions.

Thank you!