# Any ways of getting 30min data?

**URL:** <https://forum.alpaca.markets/t/any-ways-of-getting-30min-data/11348>\
**Category:** Alpaca Market Data\
**Created:** [December 14, 2022, 10:22pm UTC](https://forum.alpaca.markets/t/any-ways-of-getting-30min-data/11348 "2022-12-14T22:22:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirname](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@sirname](https://forum.alpaca.markets/u/sirname)\
**Post date:** [December 14, 2022, 10:22pm UTC](https://forum.alpaca.markets/t/any-ways-of-getting-30min-data/11348/1 "2022-12-14T22:22:06Z")

</div>

Hello , i have developed a strategy that uses both 1min data and 30min data, however the websocket only streams 1min data.  
Is there a way to get live 30min data via the rest api ?  
Or should i just aggregate it myself

If so , how should i aggregate it ? Is there a specific technique that alpaca uses for their 30m rest api data?  
Or will a generic aggregation would work

---

<div class="post-metadata">

**Author:** ![rock](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/rock/32/4872_2.png) [@rock](https://forum.alpaca.markets/u/rock)\
**Post date:** [December 15, 2022, 1:59am UTC](https://forum.alpaca.markets/t/any-ways-of-getting-30min-data/11348/2 "2022-12-15T01:59:28Z")

</div>

can’t you resample to 30min time frame using 1min data?

---

<div class="post-metadata">

**Author:** ![warren\_effn\_buffett](https://avatars.discourse-cdn.com/v4/letter/w/35a633/32.png) [@warren\_effn\_buffett](https://forum.alpaca.markets/u/warren_effn_buffett)\
**Post date:** [December 15, 2022, 2:34am UTC](https://forum.alpaca.markets/t/any-ways-of-getting-30min-data/11348/3 "2022-12-15T02:34:13Z")

</div>

If you’re using the Python library, you can specify a duration and time units for a TimeFrame object, e.g.:  
timeframe=TimeFrame(amount=30,unit=TimeFrame.TimeFrameUnit.Minute)

---

<div class="post-metadata">

**Author:** ![sirname](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@sirname](https://forum.alpaca.markets/u/sirname)\
**Post date:** [December 15, 2022, 9:35am UTC](https://forum.alpaca.markets/t/any-ways-of-getting-30min-data/11348/4 "2022-12-15T09:35:17Z")

</div>

sounds great, can you explain what is the timeframe object? specifically is this a feature of the API or a separate libarary

---

<div class="post-metadata">

**Author:** ![victor\_kirubi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/victor_kirubi/32/4932_2.png) [@victor\_kirubi](https://forum.alpaca.markets/u/victor_kirubi)\
**Post date:** [December 15, 2022, 1:46pm UTC](https://forum.alpaca.markets/t/any-ways-of-getting-30min-data/11348/5 "2022-12-15T13:46:46Z")

</div>

@warren_effn_buffett I’ve used to timeframe for getting historical data by x minutes as in [alpaca-trade-api-python/rest.py at master · alpacahq/alpaca-trade-api-python · GitHub](https://github.com/alpacahq/alpaca-trade-api-python/blob/master/alpaca_trade_api/rest.py#L707). However, I’d like to know how I can configure real-time streaming to stream data in a custom x minutes interval e.g 5 as @sirname is asking.
