VSLee.IEXSharp
2.1.0
See the version list below for details.
dotnet add package VSLee.IEXSharp --version 2.1.0
NuGet\Install-Package VSLee.IEXSharp -Version 2.1.0
<PackageReference Include="VSLee.IEXSharp" Version="2.1.0" />
paket add VSLee.IEXSharp --version 2.1.0
#r "nuget: VSLee.IEXSharp, 2.1.0"
// Install VSLee.IEXSharp as a Cake Addin #addin nuget:?package=VSLee.IEXSharp&version=2.1.0 // Install VSLee.IEXSharp as a Cake Tool #tool nuget:?package=VSLee.IEXSharp&version=2.1.0
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)
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. |
.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)
- Newtonsoft.Json (>= 12.0.3)
- Polly (>= 7.2.1)
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,522 | 8/14/2022 |
2.9.3 | 1,366 | 5/25/2022 |
2.9.2 | 1,394 | 4/23/2022 |
2.9.1 | 545 | 4/14/2022 |
2.9.0 | 3,967 | 5/20/2021 |
2.8.0 | 956 | 4/14/2021 |
2.7.0 | 2,248 | 3/4/2021 |
2.6.0 | 660 | 2/1/2021 |
2.5.0 | 3,335 | 12/28/2020 |
2.4.8 | 728 | 12/3/2020 |
2.4.7 | 3,150 | 10/15/2020 |
2.4.6 | 476 | 10/15/2020 |
2.4.5 | 566 | 10/14/2020 |
2.4.4 | 454 | 10/14/2020 |
2.4.3 | 607 | 10/11/2020 |
2.4.2 | 577 | 10/10/2020 |
2.4.1 | 665 | 10/10/2020 |
2.4.0 | 559 | 10/10/2020 |
2.3.0 | 1,008 | 9/12/2020 |
2.2.0 | 915 | 7/21/2020 |
2.1.0 | 1,690 | 6/4/2020 |
2.0.0 | 802 | 5/10/2020 |
1.2.0 | 851 | 3/24/2020 |
1.1.0 | 3,753 | 11/24/2019 |