Skip to content

REST API

The Quantly REST API is for developers and power users who want programmatic access from scripts, cron jobs, or custom tools. It uses API keys, not OAuth.

For AI assistants like Cursor, use MCP instead - MCP has its own OAuth flow.

https://api.quantly.trade

OpenAPI spec: quantly-api.yaml

Send your API key in the Authorization header:

Authorization: Bearer qk_live_<your-key>

Keys use the qk_live_ prefix. Quantly shows the full key once at creation - store it securely.

Create and manage keys in Settings → API Keys. You must be signed in to the web app to create keys (keys cannot create other keys).

1

Open Settings → API Keys and click Create key.

2

Name the key and choose permissions. Optionally restrict it to specific broker accounts.

3

Copy the key immediately. It will not be shown again.

Each key can hold one or more action scopes:

Scope Access
read:strategies List and view strategies, folders, watchlist
write:strategies Create, update, and delete strategies and folders
read:portfolio View portfolio, positions, quotes
write:portfolio Update portfolio settings
trade:execute Trade now, liquidate, deposit, withdraw, skip today
read:accounts List connected accounts
write:accounts Connect new broker accounts
read:assets Browse assets and market data
read:notifications Read notifications

Leave scopes empty for full access (not recommended for production scripts).

By default, a key can access all of your connected broker accounts. You can restrict a key to specific accounts (for example paper only) when creating it.

List your strategies:

Terminal window
curl https://api.quantly.trade/api/v1/strategies \
-H "Authorization: Bearer qk_live_<your-key>"

Backtest a strategy definition:

Terminal window
curl -X POST https://api.quantly.trade/api/v1/strategies/backtest \
-H "Authorization: Bearer qk_live_<your-key>" \
-H "Content-Type: application/json" \
-d '{"definition": { ... }, "start_date": "2020-01-01", "end_date": "2024-01-01"}'

Regardless of scopes, API keys are blocked from:

  • Deleting your account or resetting trading data
  • Creating or revoking other API keys
  • Billing and subscription changes
  • Admin operations
REST API MCP
Best for Scripts, automation, custom integrations AI assistants (Cursor, Claude Desktop, etc.)
Auth API keys (qk_live_...) OAuth (browser sign-in)
Protocol HTTP REST (/api/v1/...) Model Context Protocol (/mcp)