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
Java client library for the FlashAlpha options analytics API.
Provides a live options screener (filter/rank symbols by GEX, VRP, IV, greeks, harvest
scores, and custom formulas), real-time gamma exposure (GEX), delta exposure (DEX), vanna
exposure (VEX), charm exposure (CHEX), 0DTE analytics, volatility surface, implied
volatility, Black-Scholes greeks, Kelly criterion position sizing, stock quotes, and option
chain data — all from a single, dependency-light Java 11+ package.
All endpoints (except /health and /v1/surface/{symbol}) require an API key, which
is passed in the X-Api-Key HTTP request header. Obtain your key at
flashalpha.com.
Set it as an environment variable and read it at runtime — never hard-code secrets in
source files.
Error handling
All errors extend FlashAlphaException (a RuntimeException). Catch the specific
subclass you care about:
importcom.flashalpha.*;
try {
JsonObjectgex = client.gex("SPY");
} catch (AuthenticationExceptione) {
// HTTP 401 — invalid or missing API keySystem.err.println("Bad key: " + e.getMessage());
} catch (TierRestrictedExceptione) {
// HTTP 403 — endpoint requires a higher planSystem.err.printf("Need %s, have %s%n", e.getRequiredPlan(), e.getCurrentPlan());
} catch (NotFoundExceptione) {
// HTTP 404 — symbol or resource not found
} catch (RateLimitExceptione) {
// HTTP 429 — slow down; retry after e.getRetryAfter() secondsThread.sleep(e.getRetryAfter() * 1000L);
} catch (ServerExceptione) {
// HTTP 5xx — server-side error
} catch (FlashAlphaExceptione) {
// Catch-all for any other API errorSystem.err.println("Status " + e.getStatusCode() + ": " + e.getMessage());
}
API methods
All methods return com.google.gson.JsonObject.
Market data
Method
Description
Plan
stockQuote(ticker)
Live stock quote (bid/ask/mid/last)
Any
optionQuote(ticker)
Option quotes with greeks for all contracts
Growth+
optionQuote(ticker, expiry, strike, type)
Filtered option quotes
Growth+
surface(symbol)
Volatility surface grid
Public
stockSummary(symbol)
Comprehensive stock summary
Any
Historical data
Method
Description
Plan
historicalStockQuote(ticker, date, time)
Minute-by-minute historical stock quotes
Any
historicalOptionQuote(ticker, date, time, expiry, strike, type)
Historical option quotes
Growth+
Exposure analytics
Method
Description
Plan
gex(symbol)
Gamma exposure by strike
Any
gex(symbol, expiration, minOi)
Gamma exposure with filters
Any
dex(symbol)
Delta exposure by strike
Any
dex(symbol, expiration)
Delta exposure filtered by expiration
Any
vex(symbol)
Vanna exposure by strike
Any
vex(symbol, expiration)
Vanna exposure filtered by expiration
Any
chex(symbol)
Charm exposure by strike
Any
chex(symbol, expiration)
Charm exposure filtered by expiration
Any
exposureLevels(symbol)
Key support/resistance levels
Any
exposureSummary(symbol)
Full GEX/DEX/VEX/CHEX + hedging summary
Growth+
narrative(symbol)
Verbal narrative analysis of exposure
Growth+
zeroDte(symbol)
Real-time 0DTE analytics
Growth+
zeroDte(symbol, strikeRange)
0DTE analytics with custom strike range
Growth+
maxPain(symbol)
Max pain analysis with dealer alignment, pain curve, pin probability
# Unit tests only (no API key required)
mvn test -Dtest=ClientTest
# Integration tests (requires live API key)export FLASHALPHA_API_KEY=your_key_here
mvn test -Dtest=IntegrationTest
# All tests
mvn test
Building from source
git clone https://github.com/FlashAlpha-lab/flashalpha-java.git
cd flashalpha-java
mvn package