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 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)
# 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