MaxPC08
MaxPC08

Reputation: 94

How do I get data through my alpaca datastream?

I am trying to get live stock data through my Alpaca API, however, when I run my script, nothing happens at all. Here is the script.

from alpaca.data.live import StockDataStream

async def quote_handler(quote):
    print(quote)

stream = StockDataStream("<key>", "<secret>")
stream.subscribe_quotes(quote_handler, "TSLA")
stream.run()

Upvotes: 0

Views: 594

Answers (1)

logn
logn

Reputation: 150

First, you should not give away your keys, it's called secret key...

Second, if there is no stream, maybe you try to get data when the market is closed

Upvotes: 2

Related Questions