# Data not streaming

**URL:** <https://forum.alpaca.markets/t/data-not-streaming/5287>\
**Category:** Getting Started with Alpaca\
**Created:** [April 2, 2021, 7:58pm UTC](https://forum.alpaca.markets/t/data-not-streaming/5287 "2021-04-02T19:58:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qsnell](https://avatars.discourse-cdn.com/v4/letter/q/b5e925/32.png) [@qsnell](https://forum.alpaca.markets/u/qsnell)\
**Post date:** [April 2, 2021, 7:58pm UTC](https://forum.alpaca.markets/t/data-not-streaming/5287/1 "2021-04-02T19:58:18Z")

</div>

I am just getting started with Alpaca. I set up all my keys etc and tried to get data streaming. It worked once or twice but now isn’t streaming. I am using wscat to debug things. It connects and I am able to authenticate and subscribe but I am not getting any data. Here is my session - with the keys appropriately masked.

$ wscat -c wss://stream.data.alpaca.markets/v2/iex

Connected (press CTRL+C to quit)

\< [{“T”:“success”,“msg”:“connected”}]

> {“action”: “auth”, “key”:“PK\*\*\*\*\*\*\*\*\*\*\*\*\*”, “secret”:“\*\*\*\*\*\*\*\*\*\*\*\*\*\*” }

\< [{“T”:“success”,“msg”:“authenticated”}]

> {“action”:“subscribe”,“trades”:[“AAPL”]}

\< [{“T”:“subscription”,“trades”:[“AAPL”],“quotes”:,“bars”:}]

> 

I am getting nothing. I have tried different subscriptions and still get nothing. Here is another subscription I tried and the answer back

> {“action”: “subscribe”, “quotes”:[“AAPL”,“AMD”]}

\< [{“T”:“subscription”,“trades”:,“quotes”:[“AAPL”,“AMD”],“bars”:}]

It still just sits there with no data.

I have also tried to get it working with the python websocket package. It has basically the same results. Here is my code.

import websocket, json  
SYMBOL = “AAPL”  
TICKERS = [“AAPL”,“AMD”]  
API\_KEY = “PK\*\*\*\*\*\*\*\*\*”  
SECRET\_KEY = “\*\*\*\*\*\*\*\*”  
connection\_url = “wss://stream.data.alpaca.markets/v2/iex”

def on\_open(ws):  
print(“Connection opened”)  
auth\_data = {  
“action”: “auth”,  
“key”: API\_KEY,  
“secret”: SECRET\_KEY  
}  
ws.send(json.dumps(auth\_data))

```
channel_data = {
    "action": "subscribe",
    "quotes": TICKERS
}
ws.send(json.dumps(channel_data))

```

def on\_message(ws, message):  
print("Message: ")  
print(message)

def on\_close(ws):  
print(“Connection closed”)

ws = websocket.WebSocketApp(connection\_url, on\_open=on\_open, on\_message=on\_message, on\_close=on\_close)  
ws.run\_forever()

Which results in:

Connection opened  
Message:  
[{“T”:“success”,“msg”:“connected”}]  
Message:  
[{“T”:“success”,“msg”:“authenticated”}]  
Message:  
[{“T”:“subscription”,“trades”:,“quotes”:[“AAPL”,“AMD”],“bars”:}]

but nothing after that.

Am I doing something wrong?

Thank you.

---

<div class="post-metadata">

**Author:** ![rossjeremyd](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rossjeremyd](https://forum.alpaca.markets/u/rossjeremyd)\
**Post date:** [August 29, 2023, 11:59am UTC](https://forum.alpaca.markets/t/data-not-streaming/5287/2 "2023-08-29T11:59:19Z")

</div>

were you able to resolve this? If so, what did you do?
