Skip to content

viceroypenguin/AlphaVantage.Net

Repository files navigation

AlphaVantage.Net

Name Status History
GitHub Actions Build GitHub Actions Build History

NuGet GitHub release GitHub license GitHub issues GitHub issues-closed

What is AlphaVantage.Net?

AlphaVantage.Net is a library for interacting with Alpha Vantage's equity APIs. See their documentation here. It is supported for .net 6.0+.

Where can I get it?

AlphaVantage.Net is available at nuget.org.

Package Manager PM > Install-Package AlphaVantage.Net

How it works?

You can make all calls to Alpha Vantage's API via the AlphaVantage.AlphaVantageClient class.

var client = new AlphaVantageClient(
	"<key>",
	maxApiCallsPerMinute: 5);

// Retrieving the most recent daily history for IBM.
var result = await client.GetDailyTimeSeries(
	new()
	{
		Symbol = "IBM",
	});

.NET Core Configuration Options

Easy to use:

Call services.AddAlphaVantageClient(IConfigurationRoot). This will automatically bind options from the AlphaVantage section of the root; configure a named HttpClient for AlphaVantage.Net; and configure AlphaVantageClient as a transient.

It is recommended to use AlphaVantage.Net in this way. When using this pattern, all requested instances of AlphaVantageClient will respect the common rate limit specified in the options.

If AlphaVantageClient is constructed directly using the constructor, the rate limiter will only be used by that instance of the AlphaVantageClient; that is, multiple instances of AlphaVantageClient will each have their own rate limiter.