You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Official JavaScript/TypeScript SDK for the FlashAlpha options analytics API.
Get a live options screener (filter/rank symbols by GEX, VRP, IV, greeks, harvest scores, and custom formulas), gamma exposure (GEX), delta exposure (DEX), vanna exposure (VEX), charm exposure (CHEX), implied volatility, volatility surface, 0DTE analytics, BSM greeks, Kelly criterion position sizing, and more — all from a single npm package.
Live 0DTE snapshot (flow-adjusted) + flow-direction read. Requires Growth+
flowZeroDteSeries(symbol, opts?)
Intraday 0DTE flow series (levels, regime, hedge flow over time). Requires Growth+
flowZeroDteHedgeFlow(symbol, opts?)
Dealer hedge-flow series for the 0DTE expiry. Requires Growth+
flowZeroDteHeatmap(symbol, opts?)
Strike × time 0DTE heatmap (gex/dex/vex/chex/oi/signed_flow). Requires Alpha+
flowZeroDteStrikeFlow(symbol, opts?)
Per-strike signed 0DTE flow (delta/gamma dollars, contracts). Requires Alpha+
Strategy Signals
Each GETs /v1/strategies/{kind}/{symbol} and returns a shared
StrategyDecisionResponse (action, conviction, best matching multi-leg
structure with legs, risk flags, data quality).
Method
Description
strategyFlowAnomaly(symbol, opts?)
Directional options-flow imbalance + matching short vertical. Requires Growth+
Curated symbol directory (the queryable universe). Public
Reference Data
Method
Description
tickers()
All available stock tickers
options(ticker)
Option chain metadata (expirations and strikes)
symbols()
Currently queried symbols with live data
Max Pain
Method
Description
maxPain(symbol, options?)
Max pain analysis with dealer alignment, pain curve, OI breakdown, pin probability, multi-expiry calendar (Growth+)
Screener
Method
Description
screener(options)
Live options screener — filter/rank by GEX, VRP, IV, greeks, harvest scores, custom formulas (Growth+)
Account and System
Method
Description
screenerFields()
List the queryable screener fields and their types (any authenticated tier)
account()
Account info and quota
health()
Health check (public)
Method Options
gex / dex / vex / chex
awaitfa.gex('SPY',{expiration: '2024-12-20',// filter by expiration date (YYYY-MM-DD)minOi: 100,// minimum open interest filter (gex only)});
zeroDte
awaitfa.zeroDte('SPY',{strikeRange: 10,// number of strikes around ATM to include});
greeks
awaitfa.greeks({spot: 500,// underlying pricestrike: 500,// option strike pricedte: 30,// days to expirationsigma: 0.20,// implied volatility (annualized, e.g. 0.20 = 20%)type: 'call',// 'call' or 'put' (default: 'call')r: 0.05,// risk-free rate (optional)q: 0.01,// dividend yield (optional)});
iv
awaitfa.iv({spot: 500,strike: 500,dte: 30,price: 10.5,// market price of the optiontype: 'call',r: 0.05,// optionalq: 0.01,// optional});
kelly
awaitfa.kelly({spot: 500,strike: 500,dte: 30,sigma: 0.20,premium: 5.0,// option premium paidmu: 0.10,// expected drift of the underlying (annualized)type: 'call',r: 0.05,q: 0.01,});
Error Handling
All SDK methods throw typed errors. Catch them individually or catch the base FlashAlphaError.
import{FlashAlpha,AuthenticationError,TierRestrictedError,NotFoundError,RateLimitError,ServerError,FlashAlphaError,}from'flashalpha';constfa=newFlashAlpha('your-api-key');try{constdata=awaitfa.gex('SPY');}catch(err){if(errinstanceofAuthenticationError){console.error('Invalid API key — check your credentials.');}elseif(errinstanceofTierRestrictedError){console.error(`Upgrade required. Current: ${err.currentPlan}, Need: ${err.requiredPlan}`);}elseif(errinstanceofNotFoundError){console.error('Symbol not found or no data available.');}elseif(errinstanceofRateLimitError){constwait=err.retryAfter??60;console.error(`Rate limited. Retry after ${wait}s.`);}elseif(errinstanceofServerError){console.error(`Server error (${err.statusCode}): ${err.message}`);}elseif(errinstanceofFlashAlphaError){console.error(`API error (${err.statusCode}): ${err.message}`);}else{throwerr;// unexpected — rethrow}}
Configuration
constfa=newFlashAlpha('your-api-key',{baseUrl: 'https://lab.flashalpha.com',// default; override for testingtimeout: 30000,// milliseconds (default: 30000)});
TypeScript
The SDK is written in TypeScript and ships with full type declarations.