API
fugazi exposes a paid JSON API for programmatic access to the same valuations shown in the web UI. Access requires payment per request via the x402 protocol (docs) — an HTTP-native micro-payment standard built around the 402 Payment Required status code. No accounts, no API keys.
Endpoint
GET /api/stock/{ticker}
Returns intrinsic value, grades, and metrics for one ticker, computed from SEC filings with the same engine the web UI uses:
ticker,name,type,price,asOfletter— overall IV grade (price vs intrinsic value)qualityScore/qualityLetter,investmentScorevaluation— intrinsic value, margin of safety, OE yield, engine breakdownmetrics,flags— data-quality warnings (9 camelCase keys)
Payment (x402)
Requests without payment receive a 402 Payment Required response carrying a payment challenge (accepts Solana USDC; $0.01 per request by default). The standard x402 client flow:
GET /api/stock/AAPL→402with the challenge in the response body/headers- Build the payment payload with an x402 client and settle USDC through the facilitator
- Retry the request with the
Payment-Signatureheader →200with the JSON document
Error codes are returned before any payment is requested: 400 invalid_ticker (malformed), 404 unknown_ticker (not in the ledger). Only tickers already present in the global table are served; adding new tickers is a web-UI operation (first 10 per IP free, then $0.10 each via the same x402 gate).
Self-hosting? The paid API is opt-in: see .env.example (X402_* vars) and cmd/server/x402.go.