Thrive API
Trading
The virtual practice portfolio and virtual trades.
Get the virtual portfolio
The key owner's VIRTUAL practice portfolio — simulated cash and positions. No real money is involved.
Authentication: API key · Required scope: portfolio:read
curl "https://jointhrive.org/api/public/v1/portfolio" \
-H "Authorization: Bearer $THRIVE_API_KEY"{
"object": "portfolio",
"virtual": true,
"cash": 91234.5,
"positions": [ { "symbol": "AAPL", "quantity": 20, "avg_cost": 331.2, "current_price": 341.07, "market_value": 6821.4 } ],
"total_value": 98055.9
}Errors: invalid_api_key, missing_scope
Sign in to test this endpoint with one of your keys.
List virtual trades
Recent virtual transactions, newest first.
Authentication: API key · Required scope: trading:read
Parameters · List virtual trades
1–200, default 50.
curl "https://jointhrive.org/api/public/v1/trades" \
-H "Authorization: Bearer $THRIVE_API_KEY"{
"object": "list",
"virtual": true,
"data": [ { "symbol": "AAPL", "side": "buy", "quantity": 20, "price": 331.2 } ]
}Errors: missing_scope, parameter_invalid
Sign in to test this endpoint with one of your keys.
Place a virtual trade
Buys or sells in the key owner's VIRTUAL practice portfolio at the live price. The server checks cash and holdings and updates positions itself — callers can never set cash, quantity or cost basis. Send an Idempotency-Key so a retry never trades twice.
Authentication: API key · Required scope: trading:write · Supports Idempotency-Key
Parameters · Place a virtual trade
Ticker.
stock (default), etf, bond, crypto, commodity, index.
buy or sell.
Shares. Provide this or dollar_amount.
Dollars to trade. Provide this or quantity.
curl -X POST "https://jointhrive.org/api/public/v1/trades" \
-H "Authorization: Bearer $THRIVE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"symbol":"AAPL","side":"buy","quantity":2}'{
"object": "trade",
"virtual": true,
"symbol": "AAPL",
"side": "buy",
"price": 341.07,
"quantity": 2,
"newCash": 90552.36
}Errors: missing_scope, parameter_invalid, trade_rejected, idempotency_conflict, rate_limited