# 1 Hour Barchart Data

**URL:** <https://forum.alpaca.markets/t/1-hour-barchart-data/6580>\
**Category:** Alpaca Trading\
**Created:** [August 14, 2021, 11:02pm UTC](https://forum.alpaca.markets/t/1-hour-barchart-data/6580 "2021-08-14T23:02:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Nelson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/mike_nelson/32/2218_2.png) [@Mike\_Nelson](https://forum.alpaca.markets/u/Mike_Nelson)\
**Post date:** [August 14, 2021, 11:02pm UTC](https://forum.alpaca.markets/t/1-hour-barchart-data/6580/1 "2021-08-14T23:02:56Z")

</div>

I am receiving the following error when trying to access hourly chart information in python. I have referenced the “Missing hourly data” forum post and a couple of other sites that use an hour timeframe.

I tried the following reference code from the forum post above to see if it was just my code, but I get the following error.

Error:  
“alpaca\_trade\_api.rest.APIError: your subscription does not permit querying data from the past 15 minutes”

Code Test:

```auto
symbol = 'SPY'
start_date = '2021-01-01'
end_date = '2021-05-25'

bars = api.get_bars(symbol, TimeFrame.Hour, start=start_date, end=end_date, adjustment='raw').df
bars.index = bars.index.tz_convert('America/New_York')

# Add a day column and count the number of hour bars per day.
bars['day'] = bars.index.date
hour_bars_per_day = bars.groupby('day').close.count()

# Display the bars
display(bars)

# Display the count per day
display(hour_bars_per_day)

# Display those days where the count is less than 16
display('days with less than 16 hour bars: ', hour_bars_per_day[hour_bars_per_day < 16])

```

Does this mean, hourly bar chart data is not available on the free subscription?? Or does the market need to be open for the timeframe to work?

Thank you

---

<div class="post-metadata">

**Author:** ![Brian\_Rowe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/brian_rowe/32/2322_2.png) [@Brian\_Rowe](https://forum.alpaca.markets/u/Brian_Rowe)\
**Post date:** [August 17, 2021, 10:12pm UTC](https://forum.alpaca.markets/t/1-hour-barchart-data/6580/2 "2021-08-17T22:12:36Z")

</div>

This part of the documentation: " This URL is the **same for both subscription plans** but users with Free subscription will receive an error when trying to access data that is too recent." Is my guess. I have a paid plan, so I can’t test it. I’m interested to see what answer you get from anyone else.

---

<div class="post-metadata">

**Author:** ![Mike\_Nelson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/mike_nelson/32/2218_2.png) [@Mike\_Nelson](https://forum.alpaca.markets/u/Mike_Nelson)\
**Post date:** [August 18, 2021, 8:36pm UTC](https://forum.alpaca.markets/t/1-hour-barchart-data/6580/3 "2021-08-18T20:36:29Z")

</div>

Thanks for the feedback!  
What’s strange though is that you can call get\_barchart with a minute timeframe and it’s fine. But if you ask for “hour” bar chart data it’s too recent? Some of the GitHub repo examples use the hour timeframe as well. I’m on Tokyo time, so I feel like maybe it’s something to do with the market needing to be open? Hopefully, we hear back from the Alpaca team soon

---

<div class="post-metadata">

**Author:** ![Mike\_Nelson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/mike_nelson/32/2218_2.png) [@Mike\_Nelson](https://forum.alpaca.markets/u/Mike_Nelson)\
**Post date:** [August 22, 2021, 6:33am UTC](https://forum.alpaca.markets/t/1-hour-barchart-data/6580/4 "2021-08-22T06:33:57Z")

</div>

Bringing this back to the top of the thread? Anyone have a get\_barchart example of how to return hour bar data without getting the listed error? My algo is based on that timeframe.
