The Volity crypto trading API gives developers programmatic access to market data, order management, and position handling. REST endpoints handle account state, order entry, and historical data. WebSocket streams deliver real-time prices and trade events. Sandbox environment, MQL Expert Advisor support, and VIP rate limits round out the offering.
What the crypto trading API gives you
Three integration patterns, depending on how custom your system is:
1. MQL Expert Advisors (EAs). The simplest path. Write or buy an EA in MQL4 or MQL5, drop it into Volity MT, and the EA executes on your behalf using the same execution engine as manual trading. EAs run on Volity’s infrastructure with the same 99.6% sub-1s fill rate.
2. REST API. Server-to-server integration. Query account balances, open positions, place orders, retrieve trade history. Standard HTTP/JSON. Authentication via API key issued in the account portal. Suits algorithmic strategies built in Python, Node.js, Go, or any language that handles HTTP.
3. WebSocket streams. Real-time market data and account events. Subscribe to price tick streams for any instrument, listen for order fills, position updates, balance changes. Low-latency push delivery. Combined with REST for full system coverage.
Endpoint categories
Account endpoints (REST): – GET /account, balance, equity, margin level, exposure – GET /positions, open positions with P&L, margin requirement – GET /orders, open and pending orders – GET /history, historical trades and orders
Market data endpoints (REST): – GET /instruments, full instrument list with specs – GET /quotes/{symbol}, current bid/ask – GET /candles/{symbol}, OHLCV history at any timeframe
Trading endpoints (REST): – POST /orders, place market, limit, stop, or OCO orders – PUT /orders/{id}, modify open order – DELETE /orders/{id}, cancel order – POST /positions/{id}/close, close a specific position
WebSocket channels: – quotes:{symbol}, real-time bid/ask streaming – trades:{symbol}, public trade ticks – account, your account state updates – positions, your position updates – orders, your order updates
Authentication
API keys are issued from the account portal under Settings → API Access. Each key has:
- Permissions: read-only, trading-enabled, or full access including withdrawals
- IP allowlist: restrict the key to specific source IPs
- Rate limit tier: Standard (60 req/min) or VIP (600 req/min)
- Sandbox toggle: test against demo capital before going live
Keys are revocable at any time. Best practice: separate keys per environment (one for backtesting, one for live, one for monitoring).
Code samples
Python REST: place a market order
“`python import requests import os
headers = { “Authorization”: f”Bearer {os.environ[‘VOLITY_API_KEY’]}”, “Content-Type”: “application/json” } order = { “symbol”: “BTCUSD”, “side”: “buy”, “type”: “market”, “size”: 0.01, “stop_loss”: 65000, “take_profit”: 75000 } r = requests.post(“https://api.volity.io/v1/orders”, json=order, headers=headers) print(r.json()) “`
Node.js WebSocket: subscribe to BTC ticks
“`javascript import WebSocket from ‘ws’;
const ws = new WebSocket(‘wss://stream.volity.io/v1?api_key=’ + process.env.VOLITY_API_KEY);
ws.on(‘open’, () => { ws.send(JSON.stringify({ subscribe: [‘quotes:BTCUSD’, ‘quotes:ETHUSD’] })); });
ws.on(‘message’, (data) => { const tick = JSON.parse(data); console.log(${tick.symbol}: bid ${tick.bid} ask ${tick.ask}); }); “`
Rate limits
| Tier | REST req/min | WebSocket connections | Concurrent orders |
|---|---|---|---|
| Standard | 60 | 5 | 50 |
| VIP | 600 | 25 | 500 |
VIP tier unlocks at $50,000 account balance. Rate-limit headroom is one of the practical reasons high-frequency strategies graduate to VIP early.
Sandbox environment
Every API key can toggle between sandbox (demo capital) and live (real capital). Sandbox is identical to live in every aspect except the funds; orders fill against virtual balance. Use it to:
- Test new strategies before deploying to live
- Validate error handling and reconnection logic
- Onboard new developers without exposing live keys
- Run automated test suites in CI/CD pipelines
Switching is a single API parameter or a separate base URL (sandbox.api.volity.io).
Common crypto trading API use cases
- Algorithmic trading. Custom strategies in Python or C++ that the MQL EA framework cannot express
- Portfolio dashboards. Aggregate positions across Volity plus other accounts into a single view
- Risk-monitoring overlays. Continuously check drawdown, exposure concentration, leverage utilisation; alert on threshold breach
- Backtesting infrastructure. Pull historical data, replay against your strategy with realistic spreads and slippage
- Reporting and compliance tooling. Export daily P&L, generate per-trade reports for tax or audit needs
- Copy-trading systems. Mirror trades from a master account to follower accounts (subject to regulatory requirements)
Latency and reliability
Volity’s API runs from European data centres with global edge presence. Typical median latencies:
- REST request from EU: 30-80 ms
- REST request from US East Coast: 90-130 ms
- WebSocket tick delivery: sub-50 ms from quote update to client
- Uptime SLA: 99.9% on Standard, 99.99% on VIP
For latency-sensitive strategies, VIP-tier accounts can request dedicated cross-connects to the trading core.
Security best practices
- Never commit API keys to git. Use environment variables or a secrets manager
- Restrict by IP on production keys
- Use read-only keys for dashboards and monitoring
- Rotate keys quarterly as part of standard hygiene
- Enable 2FA on the account itself, not just the key
- Log all key usage server-side to detect anomalous access
Sources
Frequently asked questions
What is a crypto trading API?
A crypto trading API is a programmatic interface for placing trades, querying market data, and managing positions automatically. The Volity crypto trading API exposes REST endpoints for account and order operations, plus WebSocket streams for real-time prices. Suits algorithmic traders, custom dashboards, and bot integrations.
Is Volity’s API free?
Yes. The API is included with your Volity account. Standard rate limits (60 req/min REST, 5 WebSocket connections) come with every account. VIP-tier accounts ($50,000 minimum) unlock higher rate limits.
How do I get an API key?
Open the Volity account portal, navigate to Settings → API Access, click “Generate Key”. You set permissions (read-only, trading, or full), IP allowlist, and sandbox/live toggle at creation time. Keys are revocable at any time.
Can I run high-frequency trading on Volity?
Yes. VIP-tier accounts unlock 600 req/min REST and 25 WebSocket connections, with 99.99% uptime SLA and optional dedicated cross-connects. The execution layer holds 99.6% sub-1s fills for manual orders; programmatic orders fill at the same speed.
Does the API support backtesting?
The API itself does not run backtests, but it exposes historical OHLCV data via GET /candles that you can pull into a backtester of your choice (Backtrader, vectorbt, custom). VIP-tier accounts get extended history depth.
What languages can I use with the Volity API?
Any language that handles HTTP REST and WebSocket. Common choices: Python, Node.js, Go, Rust, C#, Java. MQL4 and MQL5 EAs run inside Volity MT, not via the REST API.
Can I use the API to copy trades?
Yes, subject to regulatory requirements in your jurisdiction. Volity also offers a hosted copy-trading product via /tools/crypto-copy-trading/ for users who do not want to build the infrastructure themselves.





