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.
Base URL
Section titled “Base URL”https://api.quantly.tradeOpenAPI spec: quantly-api.yaml
Authentication
Section titled “Authentication”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).
Create an API key
Section titled “Create an API key”Open Settings → API Keys and click Create key.
Name the key and choose permissions. Optionally restrict it to specific broker accounts.
Copy the key immediately. It will not be shown again.
Scopes
Section titled “Scopes”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).
Account access
Section titled “Account access”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.
Example requests
Section titled “Example requests”List your strategies:
curl https://api.quantly.trade/api/v1/strategies \ -H "Authorization: Bearer qk_live_<your-key>"Backtest a strategy definition:
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"}'What API keys cannot do
Section titled “What API keys cannot do”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 vs MCP
Section titled “REST API vs MCP”| 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) |
Next steps
Section titled “Next steps”- MCP - connect AI assistants with OAuth
- API Keys - create and scope keys
- Strategies Overview - understand strategy structure for API payloads