# Real Time Data with Alpaca-py

**URL:** <https://forum.alpaca.markets/t/real-time-data-with-alpaca-py/14115>\
**Category:** Getting Started with Alpaca\
**Created:** [April 30, 2024, 5:41pm UTC](https://forum.alpaca.markets/t/real-time-data-with-alpaca-py/14115 "2024-04-30T17:41:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dualite2](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dualite2](https://forum.alpaca.markets/u/dualite2)\
**Post date:** [April 30, 2024, 5:41pm UTC](https://forum.alpaca.markets/t/real-time-data-with-alpaca-py/14115/1 "2024-04-30T17:41:24Z")

</div>

Hello,  
I try to use StockDataStream for gettin bar minute update.  
The [documentation](https://alpaca.markets/sdks/python/api_reference/data/stock/live.html) talk of BaseStream (“See BaseStream”) for which i can litteraly found 0 result.

So… does anyone know what is “BaseStream” ?

I found that the documentation lack to explain the intent use :

- How to update your subcription on symbol ?
- Where i can do that (for example you can’t do that on _handler_ function) ?
- How to close the event loop (for example : you can close it on _handler_ but you stuck here after that) ?

In brief i need a hight level of understanding of how using this object.  
I can probably do with a good example…  
I hope somebody can share insight of that.  
And i think updating the documentation is probably needed (at least for the “see BaseStream” part).

---

<div class="post-metadata">

**Author:** ![dualite2](https://avatars.discourse-cdn.com/v4/letter/d/848f3c/32.png) [@dualite2](https://forum.alpaca.markets/u/dualite2)\
**Post date:** [April 30, 2024, 9:55pm UTC](https://forum.alpaca.markets/t/real-time-data-with-alpaca-py/14115/2 "2024-04-30T21:55:44Z")

</div>

So… I found BaseStream that the ancestor of StockDataStream in code.  
However, no documentation exists in Alpaca-py for BaseStream.

So studying the code library is the “proper” way for understanding the documentation ?  
It’s like taking my car apart for using it.

Let say the doc is not totally wrong just useless.

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dave/32/6722_2.png) [@Dave](https://forum.alpaca.markets/u/Dave)\
**Post date:** [November 28, 2024, 2:34pm UTC](https://forum.alpaca.markets/t/real-time-data-with-alpaca-py/14115/3 "2024-11-28T14:34:34Z")

</div>

I’m curious how to update a stream as well.

I’m tempted to do the following in alpaca-py

```auto
client.unsubscribe_bars()
client.stop()
client.subscribe_bars(handler, new_stocks)
client.run()

```
