HTTP Request Timeout

I am in a decent bandwidth location however there is fairly significant latency.

I am trying to pull a large quantity of news articles and after the first few I start getting HTTP Timeouts requests. This works perfectly at home but happens every time at this location.

Is there a way to increase the timeout limits for

Alpaca.Markets.Environments.Live.GetAlpacaDataClient(new SecretKey(KEY_ID, SECRET_KEY)).GetNewsArticlesPagesAsAsyncEnumerable(newsArticleRequest)
?

The AlpacaDataClientConfiguration class has the property ThrottleParameters.Timeout explicitly designed for this use case. For example, your code can be rewritten using the following approach:

var configuration = Environments.Live.GetAlpacaDataClientConfiguration(new SecretKey(KEY_ID, SECRET_KEY));
configuration.ThrottleParameters.Timeout = TimeSpan.FromSeconds(300);

configuration.GetClient().GetNewsArticlesPagesAsAsyncEnumerable(newsArticleRequest);

Fantastic. Exactly what I was looking for. Thank you

1 Like