Official .NET / C# client for the FlashAlpha options analytics API.
Access gamma exposure (GEX), delta exposure (DEX), vanna exposure (VEX), charm exposure (CHEX), implied volatility, volatility surface, 0DTE analytics, Black-Scholes greeks, Kelly criterion position sizing, and more — for SPX, SPY, QQQ, AAPL, and all major US equities.
- API documentation: https://lab.flashalpha.com/docs
- Sign up for an API key: https://flashalpha.com
- Python SDK: https://github.com/FlashAlpha-lab/flashalpha-python
dotnet add package FlashAlpha
Target framework: .NET 8.0+. No external dependencies — uses System.Net.Http and System.Text.Json.
using FlashAlpha;
var client = new FlashAlphaClient("YOUR_API_KEY");
// Gamma exposure for SPY
var gex = await client.GexAsync("SPY");
Console.WriteLine(gex);
// Black-Scholes greeks
var greeks = await client.GreeksAsync(spot: 500, strike: 505, dte: 30, sigma: 0.20, type: "call");
Console.WriteLine(greeks);
// Health check (no API key required)
var health = await client.HealthAsync();var client = new FlashAlphaClient(
apiKey: "YOUR_API_KEY", // required
baseUrl: null, // optional: override API base URL
timeout: 30 // optional: request timeout in seconds
);The client implements IDisposable. Use using or call Dispose() when finished.
All methods return Task<JsonElement> and accept an optional CancellationToken.
| Method | Description | Plan |
|---|---|---|
StockQuoteAsync(ticker) |
Live stock quote (bid/ask/mid/last) | Free |
OptionQuoteAsync(ticker, expiry?, strike?, type?) |
Option quotes with greeks | Growth+ |
SurfaceAsync(symbol) |
Volatility surface grid | Free |
StockSummaryAsync(symbol) |
Comprehensive stock summary (price, vol, exposure, macro) | Free |
| Method | Description | Plan |
|---|---|---|
HistoricalStockQuoteAsync(ticker, date, time?) |
Historical stock quotes (minute resolution) | Growth+ |
HistoricalOptionQuoteAsync(ticker, date, time?, expiry?, strike?, type?) |
Historical option quotes (minute resolution) | Growth+ |
| Method | Description | Plan |
|---|---|---|
GexAsync(symbol, expiration?, minOi?) |
Gamma exposure by strike | Free |
DexAsync(symbol, expiration?) |
Delta exposure by strike | Free |
VexAsync(symbol, expiration?) |
Vanna exposure by strike | Free |
ChexAsync(symbol, expiration?) |
Charm exposure by strike | Free |
ExposureLevelsAsync(symbol) |
Key support/resistance levels from options exposure | Free |
ExposureSummaryAsync(symbol) |
Full GEX/DEX/VEX/CHEX summary + hedging pressure | Growth+ |
NarrativeAsync(symbol) |
AI-generated verbal narrative of exposure | Growth+ |
ZeroDteAsync(symbol, strikeRange?) |
0DTE regime, expected move, pin risk, hedging, decay | Growth+ |
ExposureHistoryAsync(symbol, days?) |
Daily exposure snapshots for trend analysis | Growth+ |
| Method | Description | Plan |
|---|---|---|
GreeksAsync(spot, strike, dte, sigma, type?, r?, q?) |
Full BSM greeks (first, second, third order) | Free |
IvAsync(spot, strike, dte, price, type?, r?, q?) |
Implied volatility from market price | Free |
KellyAsync(spot, strike, dte, sigma, premium, mu, type?, r?, q?) |
Kelly criterion optimal position size | Growth+ |
| Method | Description | Plan |
|---|---|---|
VolatilityAsync(symbol) |
Comprehensive volatility analysis | Growth+ |
AdvVolatilityAsync(symbol) |
SVI parameters, variance surface, arbitrage detection, variance swap | Alpha+ |
| Method | Description | Plan |
|---|---|---|
TickersAsync() |
All available stock tickers | Free |
OptionsAsync(ticker) |
Option chain metadata (expirations and strikes) | Free |
SymbolsAsync() |
Currently active symbols with live data | Free |
| Method | Description | Plan |
|---|---|---|
AccountAsync() |
Account info and quota usage | Any |
HealthAsync() |
API health check (no auth required) | Public |
using FlashAlpha;
try
{
var result = await client.GexAsync("SPY");
}
catch (AuthenticationException ex)
{
// HTTP 401: invalid or missing API key
Console.WriteLine($"Auth error: {ex.Message}");
}
catch (TierRestrictedException ex)
{
// HTTP 403: endpoint requires a higher plan
Console.WriteLine($"Upgrade required. Current: {ex.CurrentPlan}, Required: {ex.RequiredPlan}");
}
catch (NotFoundException ex)
{
// HTTP 404: symbol or resource not found
Console.WriteLine($"Not found: {ex.Message}");
}
catch (RateLimitException ex)
{
// HTTP 429: rate limit exceeded
Console.WriteLine($"Rate limited. Retry after {ex.RetryAfter}s");
}
catch (ServerException ex)
{
// HTTP 5xx: server-side error
Console.WriteLine($"Server error {ex.StatusCode}: {ex.Message}");
}
catch (FlashAlphaException ex)
{
// Any other API error
Console.WriteLine($"API error {ex.StatusCode}: {ex.Message}");
}All exceptions derive from FlashAlphaException, which exposes:
StatusCode(int): the HTTP status codeResponse(JsonElement?): the raw JSON body, if the server returned one
FlashAlphaClient accepts a pre-configured HttpClient, making it compatible with
IHttpClientFactory and easy to mock in unit tests:
// ASP.NET Core registration
builder.Services.AddHttpClient<FlashAlphaClient>(client =>
{
client.BaseAddress = new Uri("https://lab.flashalpha.com");
client.DefaultRequestHeaders.Add("X-Api-Key", builder.Configuration["FlashAlpha:ApiKey"]);
});Unit tests run without a key:
dotnet test
Integration tests require a live API key:
set FLASHALPHA_API_KEY=your_key_here
dotnet test
MIT. See LICENSE.
- FlashAlpha home: https://flashalpha.com
- API reference: https://lab.flashalpha.com/docs
- Python SDK: https://github.com/FlashAlpha-lab/flashalpha-python
- NuGet package: https://www.nuget.org/packages/FlashAlpha