VSLee.IEXSharp
2.9.4
dotnet add package VSLee.IEXSharp --version 2.9.4
NuGet\Install-Package VSLee.IEXSharp -Version 2.9.4
<PackageReference Include="VSLee.IEXSharp" Version="2.9.4" />
paket add VSLee.IEXSharp --version 2.9.4
#r "nuget: VSLee.IEXSharp, 2.9.4"
// Install VSLee.IEXSharp as a Cake Addin #addin nuget:?package=VSLee.IEXSharp&version=2.9.4 // Install VSLee.IEXSharp as a Cake Tool #tool nuget:?package=VSLee.IEXSharp&version=2.9.4
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.
- Required: If you use cash flow, income statement, balance sheet, financials, or fundamentals endpoints, use must display “Data provided by New Constructs, LLC © All rights reserved.”
- 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. |
.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 (>= 4.2.0)
- Polly (>= 7.2.3)
- System.Text.Json (>= 6.0.4)
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 | 4,168 | 8/14/2022 |
2.9.3 | 1,344 | 5/25/2022 |
2.9.2 | 1,388 | 4/23/2022 |
2.9.1 | 537 | 4/14/2022 |
2.9.0 | 3,961 | 5/20/2021 |
2.8.0 | 950 | 4/14/2021 |
2.7.0 | 2,242 | 3/4/2021 |
2.6.0 | 654 | 2/1/2021 |
2.5.0 | 3,298 | 12/28/2020 |
2.4.8 | 722 | 12/3/2020 |
2.4.7 | 3,142 | 10/15/2020 |
2.4.6 | 470 | 10/15/2020 |
2.4.5 | 560 | 10/14/2020 |
2.4.4 | 448 | 10/14/2020 |
2.4.3 | 601 | 10/11/2020 |
2.4.2 | 571 | 10/10/2020 |
2.4.1 | 659 | 10/10/2020 |
2.4.0 | 553 | 10/10/2020 |
2.3.0 | 1,000 | 9/12/2020 |
2.2.0 | 909 | 7/21/2020 |
2.1.0 | 1,684 | 6/4/2020 |
2.0.0 | 796 | 5/10/2020 |
1.2.0 | 845 | 3/24/2020 |
1.1.0 | 3,747 | 11/24/2019 |