VSLee.IEXSharp
                             
                            
                                2.4.5
                            
                        
                    See the version list below for details.
dotnet add package VSLee.IEXSharp --version 2.4.5
NuGet\Install-Package VSLee.IEXSharp -Version 2.4.5
<PackageReference Include="VSLee.IEXSharp" Version="2.4.5" />
<PackageVersion Include="VSLee.IEXSharp" Version="2.4.5" />
<PackageReference Include="VSLee.IEXSharp" />
paket add VSLee.IEXSharp --version 2.4.5
#r "nuget: VSLee.IEXSharp, 2.4.5"
#:package VSLee.IEXSharp@2.4.5
#addin nuget:?package=VSLee.IEXSharp&version=2.4.5
#tool nuget:?package=VSLee.IEXSharp&version=2.4.5
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.
 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
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
- Thanks to Zhirong Huang (ZHCode) for his great foundational work on this library
| Product | Versions Compatible and additional computed target framework versions. | 
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. | 
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. | 
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. | 
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. | 
| MonoAndroid | monoandroid was computed. | 
| MonoMac | monomac was computed. | 
| MonoTouch | monotouch was computed. | 
| Tizen | tizen40 was computed. tizen60 was computed. | 
| Xamarin.iOS | xamarinios was computed. | 
| Xamarin.Mac | xamarinmac was computed. | 
| Xamarin.TVOS | xamarintvos was computed. | 
| Xamarin.WatchOS | xamarinwatchos was computed. | 
- 
                                                    .NETStandard 2.0- LaunchDarkly.EventSource (>= 3.3.2)
- Polly (>= 7.2.1)
- System.Text.Json (>= 4.7.2)
 
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | 
|---|---|---|
| 2.9.4 | 11,521 | 8/14/2022 | 
| 2.9.3 | 1,644 | 5/25/2022 | 
| 2.9.2 | 1,531 | 4/23/2022 | 
| 2.9.1 | 658 | 4/14/2022 | 
| 2.9.0 | 4,101 | 5/20/2021 | 
| 2.8.0 | 1,092 | 4/14/2021 | 
| 2.7.0 | 2,403 | 3/4/2021 | 
| 2.6.0 | 801 | 2/1/2021 | 
| 2.5.0 | 3,786 | 12/28/2020 | 
| 2.4.8 | 881 | 12/3/2020 | 
| 2.4.7 | 3,308 | 10/15/2020 | 
| 2.4.6 | 621 | 10/15/2020 | 
| 2.4.5 | 699 | 10/14/2020 | 
| 2.4.4 | 601 | 10/14/2020 | 
| 2.4.3 | 753 | 10/11/2020 | 
| 2.4.2 | 729 | 10/10/2020 | 
| 2.4.1 | 805 | 10/10/2020 | 
| 2.4.0 | 716 | 10/10/2020 | 
| 2.3.0 | 1,163 | 9/12/2020 | 
| 2.2.0 | 1,055 | 7/21/2020 | 
| 2.1.0 | 1,836 | 6/4/2020 | 
| 2.0.0 | 949 | 5/10/2020 | 
| 1.2.0 | 1,002 | 3/24/2020 | 
| 1.1.0 | 3,914 | 11/24/2019 |