Python SDK for the FlashAlpha options analytics API — gamma exposure (GEX), delta, vanna, charm, greeks, and more.
Project description
FlashAlpha Python SDK
Real-time options exposure analytics for Python. Gamma exposure (GEX), delta (DEX), vanna (VEX), charm (CHEX), key levels, Black-Scholes greeks, implied volatility, Kelly sizing, and more — from the FlashAlpha API.
pip install flashalpha
Quick Start
from flashalpha import FlashAlpha
fa = FlashAlpha("YOUR_API_KEY")
# Get gamma exposure for SPY
gex = fa.gex("SPY")
print(f"Net GEX: ${gex['net_gex']:,.0f}")
print(f"Gamma flip: {gex['gamma_flip']}")
for strike in gex["strikes"][:5]:
print(f" {strike['strike']}: net ${strike['net_gex']:,.0f}")
What You Can Do
Exposure Analytics — see where dealers are positioned
# Gamma exposure by strike
gex = fa.gex("SPY")
gex = fa.gex("TSLA", expiration="2026-03-21", min_oi=100)
# Delta, vanna, charm exposure
dex = fa.dex("AAPL")
vex = fa.vex("QQQ")
chex = fa.chex("NVDA")
# Key levels (gamma flip, walls, max pain)
levels = fa.exposure_levels("SPY")
print(f"Call wall: {levels['levels']['call_wall']}")
print(f"Put wall: {levels['levels']['put_wall']}")
print(f"Gamma flip: {levels['levels']['gamma_flip']}")
# Full exposure summary with hedging estimates
summary = fa.exposure_summary("SPY") # Growth+
# AI narrative analysis
narrative = fa.narrative("SPY") # Growth+
print(narrative["narrative"]["regime"])
print(narrative["narrative"]["outlook"])
Market Data — live quotes and option chains
# Stock quote
quote = fa.stock_quote("AAPL")
print(f"AAPL: ${quote['mid']}")
# Option quote with greeks
opt = fa.option_quote("SPY", expiry="2026-03-21", strike=660, type="C") # Growth+
print(f"Delta: {opt['delta']}, IV: {opt['implied_vol']}")
# Comprehensive stock summary (price, vol, exposure, macro)
summary = fa.stock_summary("SPY")
# Vol surface (public — no API key needed)
surface = fa.surface("SPY")
Pricing — Black-Scholes greeks and implied vol
# Full BSM greeks (first, second, third order)
g = fa.greeks(spot=580, strike=580, dte=30, sigma=0.18, type="call")
print(f"Delta: {g['first_order']['delta']}")
print(f"Gamma: {g['first_order']['gamma']}")
print(f"Vanna: {g['second_order']['vanna']}")
# Implied volatility from market price
result = fa.iv(spot=580, strike=580, dte=30, price=12.69)
print(f"IV: {result['implied_volatility_pct']}%")
# Kelly criterion position sizing
kelly = fa.kelly( # Growth+
spot=580, strike=580, dte=30,
sigma=0.18, premium=12.69, mu=0.12,
)
print(kelly["recommendation"])
Volatility Analytics — skew, term structure, realized vol
vol = fa.volatility("TSLA") # Growth+
print(f"ATM IV: {vol['atm_iv']}%")
print(f"RV 20d: {vol['realized_vol']['rv_20d']}%")
print(f"VRP assessment: {vol['iv_rv_spreads']['assessment']}")
Historical Data — minute-by-minute from ClickHouse
# Historical stock quotes
hist = fa.historical_stock_quote("SPY", date="2026-03-05", time="10:30")
# Historical option quotes
hist_opt = fa.historical_option_quote(
"SPY", date="2026-03-05", expiry="2026-03-20", strike=580, type="C"
)
Reference & Account
# All available tickers
tickers = fa.tickers()
# Option chain metadata (expirations + strikes)
chain = fa.options("SPY")
# Symbols with live cached data
symbols = fa.symbols()
# Account info and quota
account = fa.account()
print(f"Plan: {account['plan']}, Remaining: {account['remaining']}")
Error Handling
from flashalpha import (
FlashAlpha,
AuthenticationError,
TierRestrictedError,
NotFoundError,
RateLimitError,
)
fa = FlashAlpha("YOUR_API_KEY")
try:
data = fa.exposure_summary("SPY")
except AuthenticationError:
print("Invalid API key")
except TierRestrictedError as e:
print(f"Need {e.required_plan} plan (you have {e.current_plan})")
except NotFoundError:
print("Symbol not found")
except RateLimitError as e:
print(f"Rate limited — retry after {e.retry_after}s")
Plans
| Plan | Daily Requests | Highlights |
|---|---|---|
| Free | 50 | Stock quotes, GEX/DEX/VEX/CHEX by strike, levels, greeks, IV, tickers |
| Basic | 250 | Everything in Free |
| Growth | 2,500 | + Option quotes, exposure summary, narrative, volatility, Kelly sizing |
| Pro | Unlimited | Full access |
Get your API key at flashalpha.com
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flashalpha-0.1.0.tar.gz.
File metadata
- Download URL: flashalpha-0.1.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19f69f523c30d174a85c8e38ec7960cdb99351c8454862b007c45e249e7ecc25
|
|
| MD5 |
6c1eca37cd78267963da1d269c761599
|
|
| BLAKE2b-256 |
261dad19c289cc5576a4dd2e2450d088385aa5d9caead505dc36db39abf11b66
|
File details
Details for the file flashalpha-0.1.0-py3-none-any.whl.
File metadata
- Download URL: flashalpha-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2647ebab025c75a2f668ce8118224167149de610d5b8ebdffc20e439cc20312
|
|
| MD5 |
c9780ff92af8cd11d67154df4c68e82c
|
|
| BLAKE2b-256 |
4c4208995e18dd54a1ad7e24c2adfcae0e45b2e561e14da0b17d627614c3fb55
|