VSLee.IEXSharp 2.4.7

IEX Cloud API for C# and other .net languages. Supports SSE streaming

Install-Package VSLee.IEXSharp -Version 2.4.7
dotnet add package VSLee.IEXSharp --version 2.4.7
<PackageReference Include="VSLee.IEXSharp" Version="2.4.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VSLee.IEXSharp --version 2.4.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

IEXSharp

IEX Cloud API for C# and other .net languages. Supports SSE streaming.

Prerequisites

This library currently targets netstandard20. Thus, it can be used with .net framework 4.6.1+ or .net core 2.0+

Usage

Prereleases are on GH Packages. A new prerelease is built automatically after every commit.

NuGet Badge Releases are on NuGet

IEX Cloud

public IEXCloudClient(string publishableToken, string secretToken, bool signRequest, bool useSandBox,
	APIVersion version = APIVersion.stable, RetryPolicy retryPolicy = RetryPolicy.Exponential)

First, create an instance of IEXCloudClient

// For FREE and LAUNCH users
IEXCloudClient iexCloudClient = 
	new IEXCloudClient("publishableToken", "secretToken", signRequest: false, useSandBox: false); 

// For SCALE and GROW users
IEXCloudClient iexCloudClient = 
	new IEXCloudClient("publishableToken", "secretToken", signRequest: true, useSandBox: false); 

// Sandbox
IEXCloudClient iexCloudClient = 
	new IEXCloudClient("publishableToken", "secretToken", signRequest: false, useSandBox: true); 

To display historical prices. Read more about DateTime in the wiki.

using (var iexCloudClient = 
	new IEXCloudClient("publishableToken", "secretToken", signRequest: false, useSandBox: false))
{
	var response = await iexCloudClient.StockPrices.HistoricalPriceAsync("AAPL", ChartRange.OneMonth);
	if (response.ErrorMessage != null)
	{
		Console.WriteLine(response.ErrorMessage);
	}
	else
	{
	   foreach (var ohlc in response.Data)
	   {
	      var dt = ohlc.GetTimestampInEST(); // note use of the extension method instead of ohlc.date
	      Console.WriteLine(
	   	  $"{dt} Open: {ohlc.open}, High: {ohlc.high}, Low: {ohlc.low}, Close: {ohlc.close}, Vol: {ohlc.volume}");
	   }
	}
}

To use SSE streaming (only included with paid IEX subscription plans). Extended example in the wiki.

using (var sseClient = iexCloudClient.StockPrices.QuoteStream(symbols: new string[] { "spy", "aapl" }, 
	UTP: false, interval: StockQuoteSSEInterval.OneSecond))
{
	sseClient.Error += (s, e) =>
	{
		Console.WriteLine("Error Occurred. Details: {0}", e.Exception.Message);
	};
	sseClient.MessageReceived += m =>
	{
		Console.WriteLine(m.ToString());
	};
	await sseClient.StartAsync(); // this will block until Stop() is called
}

Additional usage examples are illustrated in the test project: IEXSharpTest

Legacy

IEX has deprecated most of their legacy API. However, some functions are still active and you can access them via:

IEXLegacyClient iexLegacyClient = new IEXLegacyClient();

Contributing

We welcome pull requests! See CONTRIBUTING.md.

License

License: MIT

Disclaimers

Data provided for free by IEX via their IEX Cloud API
Per their guidelines:

  • Required: If you display any delayed price data, you must display “15 minute delayed price” as a disclaimer.
  • Required: If you display latestVolume you must display “Consolidated Volume in Real-time” as a disclaimer.
  • Note on pricing data: All CTA and UTP pricing data is delayed at least 15 minutes.

This project is not related to the similarly named IEX-Sharp

Acknowledgments

IEXSharp

IEX Cloud API for C# and other .net languages. Supports SSE streaming.

Prerequisites

This library currently targets netstandard20. Thus, it can be used with .net framework 4.6.1+ or .net core 2.0+

Usage

Prereleases are on GH Packages. A new prerelease is built automatically after every commit.

NuGet Badge Releases are on NuGet

IEX Cloud

public IEXCloudClient(string publishableToken, string secretToken, bool signRequest, bool useSandBox,
	APIVersion version = APIVersion.stable, RetryPolicy retryPolicy = RetryPolicy.Exponential)

First, create an instance of IEXCloudClient

// For FREE and LAUNCH users
IEXCloudClient iexCloudClient = 
	new IEXCloudClient("publishableToken", "secretToken", signRequest: false, useSandBox: false); 

// For SCALE and GROW users
IEXCloudClient iexCloudClient = 
	new IEXCloudClient("publishableToken", "secretToken", signRequest: true, useSandBox: false); 

// Sandbox
IEXCloudClient iexCloudClient = 
	new IEXCloudClient("publishableToken", "secretToken", signRequest: false, useSandBox: true); 

To display historical prices. Read more about DateTime in the wiki.

using (var iexCloudClient = 
	new IEXCloudClient("publishableToken", "secretToken", signRequest: false, useSandBox: false))
{
	var response = await iexCloudClient.StockPrices.HistoricalPriceAsync("AAPL", ChartRange.OneMonth);
	if (response.ErrorMessage != null)
	{
		Console.WriteLine(response.ErrorMessage);
	}
	else
	{
	   foreach (var ohlc in response.Data)
	   {
	      var dt = ohlc.GetTimestampInEST(); // note use of the extension method instead of ohlc.date
	      Console.WriteLine(
	   	  $"{dt} Open: {ohlc.open}, High: {ohlc.high}, Low: {ohlc.low}, Close: {ohlc.close}, Vol: {ohlc.volume}");
	   }
	}
}

To use SSE streaming (only included with paid IEX subscription plans). Extended example in the wiki.

using (var sseClient = iexCloudClient.StockPrices.QuoteStream(symbols: new string[] { "spy", "aapl" }, 
	UTP: false, interval: StockQuoteSSEInterval.OneSecond))
{
	sseClient.Error += (s, e) =>
	{
		Console.WriteLine("Error Occurred. Details: {0}", e.Exception.Message);
	};
	sseClient.MessageReceived += m =>
	{
		Console.WriteLine(m.ToString());
	};
	await sseClient.StartAsync(); // this will block until Stop() is called
}

Additional usage examples are illustrated in the test project: IEXSharpTest

Legacy

IEX has deprecated most of their legacy API. However, some functions are still active and you can access them via:

IEXLegacyClient iexLegacyClient = new IEXLegacyClient();

Contributing

We welcome pull requests! See CONTRIBUTING.md.

License

License: MIT

Disclaimers

Data provided for free by IEX via their IEX Cloud API
Per their guidelines:

  • Required: If you display any delayed price data, you must display “15 minute delayed price” as a disclaimer.
  • Required: If you display latestVolume you must display “Consolidated Volume in Real-time” as a disclaimer.
  • Note on pricing data: All CTA and UTP pricing data is delayed at least 15 minutes.

This project is not related to the similarly named IEX-Sharp

Acknowledgments

Release Notes

https://github.com/vslee/IEXSharp/releases

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.4.7 720 10/15/2020
2.4.6 52 10/15/2020
2.4.5 124 10/14/2020
2.4.4 55 10/14/2020
2.4.3 192 10/11/2020
2.4.2 138 10/10/2020
2.4.1 216 10/10/2020
2.4.0 122 10/10/2020
2.3.0 492 9/12/2020
2.2.0 275 7/21/2020
2.1.0 997 6/4/2020
2.0.0 311 5/10/2020
1.2.0 403 3/24/2020
1.1.0 1,459 11/24/2019