# Hitting Rate Limit on Pro MarketData

**URL:** <https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012>\
**Category:** Alpaca Market Data\
**Created:** [March 17, 2021, 9:01pm UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012 "2021-03-17T21:01:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dynamic3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dynamic3/32/1646_2.png) [@dynamic3](https://forum.alpaca.markets/u/dynamic3)\
**Post date:** [March 17, 2021, 9:01pm UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/1 "2021-03-17T21:01:12Z")

</div>

Considering I cannot partition symbols into a historical bars request; I went ahead and upgraded to Pro and sending 1 symbol at a time for my desired time window. And now I’m hitting a rate limit on requests.

Why is there a rate limit for Pro MarketData subscriptions? I thought it was unlimited calls per minute? @Alpaca

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [March 18, 2021, 5:17pm UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/2 "2021-03-18T17:17:36Z")

</div>

The Pro data rate limits (or lack of) are only applicable to the v2 APIs. What API or SDK method are you using when you get the rate limit error?

---

<div class="post-metadata">

**Author:** ![dynamic3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dynamic3/32/1646_2.png) [@dynamic3](https://forum.alpaca.markets/u/dynamic3)\
**Post date:** [March 18, 2021, 5:36pm UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/3 "2021-03-18T17:36:30Z")

</div>

client = Alpaca.Markets.Environments.Live.GetAlpacaDataClient(new SecretKey(LIVE\_API\_KEY, LIVE\_API\_SECRET));

foreach( string tradeable in lstAlpacaTradeables){

**client.ListHistoricalBarsAsync(new HistoricalBarsRequest(symbol, startTime, endTime, BarTimeFrame.Minute))**  
}

Where startTime = DateTime.UtcNow.AddDays(-1) and endTime = DateTime.UtcNow and symbol is the symbolname

I get a response with the requested symbol-name back in the property of the response but the bars propertyis empty and some calls will return and some other calls will give a strange IThrottle exception coming from the Alpaca library itself.

Let me know…

---

<div class="post-metadata">

**Author:** ![dynamic3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dynamic3/32/1646_2.png) [@dynamic3](https://forum.alpaca.markets/u/dynamic3)\
**Post date:** [March 18, 2021, 5:38pm UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/4 "2021-03-18T17:38:04Z")

</div>

I’m using the latest SDK from NuGet package manager

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [March 18, 2021, 5:48pm UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/5 "2021-03-18T17:48:32Z")

</div>

The latest ‘production’ alpaca-trade-api-csharp SDK doesn’t support the v2 data plans. Unless you have loaded [SDK 5.0.1 1st alpha](https://github.com/alpacahq/alpaca-trade-api-csharp/releases/tag/sdk-5.0.1-alpha) you are still fetching the v1 data and will be rate limited.

Could that be the issue?

---

<div class="post-metadata">

**Author:** ![dynamic3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dynamic3/32/1646_2.png) [@dynamic3](https://forum.alpaca.markets/u/dynamic3)\
**Post date:** [March 18, 2021, 6:02pm UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/6 "2021-03-18T18:02:28Z")

</div>

OK i see, that may be the issue. I will update this and try again

---

<div class="post-metadata">

**Author:** ![oleg.rakhmatulin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/oleg.rakhmatulin/32/559_2.png) [@oleg.rakhmatulin](https://forum.alpaca.markets/u/oleg.rakhmatulin)\
**Post date:** [March 18, 2021, 8:52pm UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/7 "2021-03-18T20:52:59Z")

</div>

Please, report this issue on [GitHub](https://github.com/alpacahq/alpaca-trade-api-csharp) and provide more information about the IThrottle exception. The AlpacaDataClient shouldn’t throttle any requests for v2 calls. And I strongly recommend you to use the LTS 4.1.2 version instead of highly experimental 5.0.x builds.

---

<div class="post-metadata">

**Author:** ![dynamic3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dynamic3/32/1646_2.png) [@dynamic3](https://forum.alpaca.markets/u/dynamic3)\
**Post date:** [March 19, 2021, 3:05am UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/8 "2021-03-19T03:05:16Z")

</div>

Hello, so I changed the package to SDK 5.0.1 1st alpha. And still getting this error but not on every call, some calls return symbol but the items count is empty. See below error and piece of code that triggers error:

> Error :internal server error occurred  
> StackTrace: at Alpaca.Markets.HttpResponseMethodExtensions.DeserializeAsync[TApi,TJson](HttpResponseMessage response)  
> at Alpaca.Markets.HttpClientExtensions.callAndDeserializeAsync[TApi,TJson](HttpClient httpClient, HttpRequestMessage request, CancellationToken cancellationToken, IThrottler throttler)  
> at Alpaca.Markets.HttpClientExtensions.callAndDeserializeAsync[TApi,TJson](HttpClient httpClient, HttpMethod method, Uri endpointUri, CancellationToken cancellationToken, IThrottler throttler)

> try{  
> var iclient = Alpaca.Markets.Environments.Live.GetAlpacaDataClient(new SecretKey(LIVE\_API\_KEY, LIVE\_API\_SECRET));
> 
> ```
> DateTime startTime = DateTime.UtcNow.AddDays(-1);
> DateTime endTime = DateTime.UtcNow;
>             
> HistoricalBarsRequest barRequest= new HistoricalBarsRequest(stub.symbolCode, startTime, endTime, BarTimeFrame.Minute);
> var unprocessed_bars = await iclient.ListHistoricalBarsAsync(barRequest);
> 
> System.Console.WriteLine("{0}: RECV: {1} {2}", DateTime.UtcNow, unprocessed_bars.Symbol, unprocessed_bars.Items.Count);
> 
> }catch(Exception ex)
> {
> System.Console.WriteLine("GetNewCandlesAsync():Error :{0} \nStackTrace: {1}", ex.Message,ex.StackTrace);
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![dynamic3](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dynamic3/32/1646_2.png) [@dynamic3](https://forum.alpaca.markets/u/dynamic3)\
**Post date:** [March 19, 2021, 3:08am UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/9 "2021-03-19T03:08:41Z")

</div>

The 4.1.2 version also gives me same internal server error and also items count are still empty in the response.

---

<div class="post-metadata">

**Author:** ![gearhead](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/gearhead/32/1398_2.png) [@gearhead](https://forum.alpaca.markets/u/gearhead)\
**Post date:** [June 14, 2021, 4:14pm UTC](https://forum.alpaca.markets/t/hitting-rate-limit-on-pro-marketdata/5012/10 "2021-06-14T16:14:49Z")

</div>

I am having the same problem for time frame of hourly
