FinAI API

A simple, documented HTTP API over the same engine that powers this site: max-Sharpe portfolio optimisation, single-asset analysis, and live market-sentiment feeds. All responses are JSON.

Base URL: https://finai.solutions Methodology & validation (paper)

Data API — public, read-only, no auth

GET /api/top-performers

Long-only max-Sharpe portfolio over the top-20 crypto by market cap (stablecoins & gold-backed tokens excluded), weights > 1% only.

Query paramTypeDescription
periodstringOne of 5y, 3y, 1y (default), 6m, 1m, 24h.
curl https://finai.solutions/api/top-performers?period=1y
{
  "holdings": [["BTC", 0.41], ["ETH", 0.22], ...],
  "return": 0.83, "std": 0.56, "sharpe": 1.48
}
GET /api/top-performers/track-record

Equity curve of the daily-updated recommendation vs. a BTC buy-and-hold benchmark (walk-forward, no look-ahead). Values are growth multiples (1.0 = start).

{
  "dates": ["2026-01-06", ...], "equity": [1.0, 1.02, ...],
  "benchmark": [1.0, 0.99, ...],
  "strategy_return_pct": 18.4, "benchmark_return_pct": 9.1, "since": "2026-01-06"
}
GET /api/fear-greed · /api/fear-greed/history

Crypto Fear & Greed index with a contrarian buy/sell signal (fear → buy, greed → sell). The /history variant returns ~5 years of values.

{ "value": 34, "classification": "Fear", "signal": "buy", "action": "Buy", "reason": "..." }
GET /api/gold-fear-greed · /api/silver-fear-greed

A computed 0–100 sentiment gauge for gold / silver (RSI, trend, 52-week range, momentum), with a contrarian action and its component scores.

{ "value": 62, "classification": "Greed", "signal": "sell", "action": "Sell",
  "components": { "rsi": 68, "trend": 71, "range": 55, "momentum": 54 } }
GET /api/gold-silver-ratio · /api/gold-silver-ratio/history

Live gold/silver ratio with a buy suggestion (which metal looks better value). The /history variant returns a 5-year daily series.

{ "gold": 2380.5, "silver": 30.1, "ratio": 79.1, "signal": "silver", "recommendation": "Silver" }

Optimisation API

POST endpoints accept a JSON body. Dates use the format YYYY-MM-DD-HH-MM. granularity is in seconds (86400=1d, 3600=1h, …); return_period is in days (default 30). asset_type is auto, crypto, or stock.

POST /portfolio

Max-Sharpe optimisation over a supplied ticker list (or a market-cap universe if tickers is omitted). Returns weights, return, std.

FieldReqDescription
start_dateyesWindow start, YYYY-MM-DD-HH-MM.
tickersnoe.g. [BTC,ETH,SOL].
end_datenoDefaults to today.
granularity, return_period, market_cap, asset_typenoSee note above.
curl -X POST https://finai.solutions/portfolio \
  -H 'Content-Type: application/json' \
  -d '{"start_date":"2024-01-01-00-00","tickers":"[BTC,ETH,SOL]"}'
POST /ultimate

The full pipeline over the market-cap universe: equal-weight, global-minimum-variance and max-Sharpe portfolios. top_n restricts to the best-N holdings.

FieldReqDescription
start_dateyesWindow start.
top_nnoKeep only the N best holdings and re-optimise.
end_date, granularity, return_period, market_cap, asset_typenoSee note above.
curl -X POST https://finai.solutions/ultimate \
  -H 'Content-Type: application/json' \
  -d '{"start_date":"2024-01-01-00-00","asset_type":"crypto","top_n":10}'
POST /analyzer

Single-asset analysis: support/resistance, volatility, coefficient of variation, QCD, and bull/bear classification.

FieldReqDescription
tickeryese.g. BTC-USD.
start_dateyesWindow start.
end_date, granularity, return_period, market_cap, asset_typenoSee note above.
curl -X POST https://finai.solutions/analyzer \
  -H 'Content-Type: application/json' \
  -d '{"ticker":"BTC-USD","start_date":"2024-01-01-00-00"}'
POST /subscribe

Persist a portfolio (tickers + weights) under an email so it can be tracked and updated. Returns the new portfolio id.

FieldReqDescription
tickersyese.g. [BTC,ETH].
weightsyese.g. [0.6,0.4], same length as tickers.
emailyesOwner email.
start_dateyesWindow start.
POST /update

Apply buy/sell actions to a saved portfolio.

FieldReqDescription
portfolio_idyesId returned by /subscribe.
tickersyesTickers to act on.
actionsyesNumeric change per ticker, same length as tickers.

Not financial advice. Endpoints are provided as-is for research and educational use. For the underlying methodology and statistical validation, see the FinAI paper.