Koveh API

Tinkoff Investments API

Portfolio management and real-time market data via Tinkoff Invest

The Tinkoff Investments API proxies Tinkoff Invest API for portfolio reads and public market data. Private routes require a Koveh API key with tinkoff-investments in allowed_models. Market routes use the server-side TINKOFF_INVEST_TOKEN (no Bearer key).

Base URL

https://api.koveh.com/tinkoff-investments/ (short alias: https://api.koveh.com/t/)

Authentication

Private endpoints (/accounts, /stocks, /portfolio/...) — Bearer token from API Access:

Authorization: Bearer YOUR_API_KEY

Your API user must include tinkoff-investments in allowed models.

Market endpoints (/market/...) — no Koveh API key; the service uses the host TINKOFF_INVEST_TOKEN. If market calls return UNAUTHENTICATED, rotate the invest token in the Tinkoff developer cabinet and update server env.


Endpoints

Health

GET /health

Returns service status, whether a Tinkoff token is configured (tinkoff_connected), and RabbitMQ connectivity.

List accounts

GET /accountsauth required

All brokerage accounts visible to the server invest token.

Stocks list

GET /stocks?limit=10auth required

Paginated share list with last prices (limit 1–100, default 10).

Portfolio

GET /portfolio/{account_id}auth required

Positions and total value for one account id from /accounts.

Models

GET /models

Lists the service model id: tinkoff-investments.

Market search (public)

GET /market/search/by-ticker?ticker=AAPL

Instrument lookup by ticker. OpenAPI-compatible payload.instruments[] shape.

Order book (public)

GET /market/orderbook?figi=BBG000B9XRY4&depth=20

Live bids/asks for a FIGI (depth 1–50, default 20).


Examples

# Health (no auth)
curl -s https://api.koveh.com/tinkoff-investments/health

# Accounts (Koveh API key)
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.koveh.com/tinkoff-investments/accounts

# Market search (server token; no Bearer)
curl -s "https://api.koveh.com/t/market/search/by-ticker?ticker=SBER"

Operations

Production runs as systemd tinkoff-investments-api on port 8030 (nginx → /tinkoff-investments/ and /t/). Env: /root/automation/.env (TINKOFF_INVEST_TOKEN). Python env: /root/automation/tink_env (vendored tinkoff-investments SDK — PyPI packages were removed).

Docker rebuild needs free disk space; image uses vendor/sdk/ copied from tink_env.

On this page