# Get Bars streaming without Python

**URL:** <https://forum.alpaca.markets/t/get-bars-streaming-without-python/535>\
**Category:** Alpaca Market Data\
**Created:** [December 15, 2019, 4:11am UTC](https://forum.alpaca.markets/t/get-bars-streaming-without-python/535 "2019-12-15T04:11:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishes](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@abhishes](https://forum.alpaca.markets/u/abhishes)\
**Post date:** [December 15, 2019, 4:11am UTC](https://forum.alpaca.markets/t/get-bars-streaming-without-python/535/1 "2019-12-15T04:11:47Z")

</div>

OK I googled a lot. Can someone show me an example where we have used getBars in a streaming manner for 5 seconds bars (I don’t have live trading account, only paper trading).

I am not using Python. I found this example

> def main():  
> stream = alpaca.StreamConn()  
> @stream.on(r’^AM’)  
> async def on\_bars(conn, channel, data):  
> print(f’received bar {data}')  
> stream.run([‘AM.SPY’])

But this is using your python SDK. How can I stream the bars using Java/Scala at 5 seconds internal?

Sorry if this question is FAQ. I couldn’t find an answer and I did my fair share of googling before posting this.
