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.
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
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.