API

Read your book from anywhere

A versioned REST API on personal tokens, with the same account rules as the web app.

Authentication

Create a token in Settings, Tokens and data, and pick its scopes. Tokens start with sg_live_, are shown once, are stored only as a SHA-256 hash, expire after 30, 90 or 365 days, and can be revoked at any time. You can hold up to 10 tokens.

curl -H "Authorization: Bearer $TOKEN" \
  https://stockgaines.com/api/v1/portfolio

Endpoints

MethodPathScopeReturns
GET/api/v1/meread:profileYou: tenant, plan and connected sources
GET/api/v1/portfolioread:portfolioAccounts, positions and the book's KPIs
GET/api/v1/riskread:portfolioThe risk cockpit, book protection and the risk regime
GET/api/v1/market/todayread:marketMarket overview, gauge, regime quad and macro
GET/api/v1/ideas/top10read:marketThis week's top 10 with factor scores
GET/api/v1/briefs/{date}read:portfolioYour daily brief for a date
POST/api/v1/askaskAsk the Terminal one question, billed to your own AI key

Every figure carries its source and as-of date, as on the page. Research only, not personal investment advice.

Limits

60 read requests and 10 Ask requests a minute per token. Over the limit you get HTTP 429. An unknown, revoked or expired token gets 401, and a token without the endpoint's scope gets 403.

Machine-readable spec

OpenAPI 3.1.0 at https://stockgaines.com/api/v1/openapi.json.