API Documentation
Integrate with AlgoStudio using our REST APIs. Set up webhooks for live EA tracking, upload backtest results, and interact with the template marketplace.
Webhook Setup
Configure webhooks to receive real-time events from your live Expert Advisors. Set your webhook URL in Account Settings, and your EAs will send events automatically.
Webhook URL Format
POST https://your-server.com/webhook/algostudioAuthentication
Each EA instance has a unique API key. Include it in the X-EA-Api-Key header.
X-EA-Api-Key: ea_live_abc123def456Payload Formats
Heartbeat Event
{
"balance": 10250.5,
"equity": 10180.25,
"openTrades": 2,
"totalTrades": 47,
"totalProfit": 250.5,
"drawdown": 0.68,
"spread": 12
}Trade Event
{
"ticket": "12345678",
"symbol": "EURUSD",
"type": "BUY",
"openPrice": 1.0852,
"closePrice": 1.0878,
"lots": 0.1,
"profit": 26,
"openTime": "2026-01-15T10:30:00Z",
"closeTime": "2026-01-15T14:45:00Z"
}Error Event
{
"errorCode": 4756,
"message": "OrderSend failed: not enough money",
"context": "OnTick"
}| Code | Description |
|---|---|
| 401 | Missing or invalid API key |
| 429 | Rate limit exceeded (20 requests/minute) |
| 500 | Internal server error |
curl -X POST https://algo-studio.com/api/telemetry/heartbeat \
-H "Content-Type: application/json" \
-H "X-EA-Api-Key: ea_live_abc123def456" \
-d '{"balance":10250.50,"equity":10180.25,"openTrades":2,"totalTrades":47,"totalProfit":250.50,"drawdown":0.68,"spread":12}'Backtest API
/api/backtest/uploadUpload a backtest result file for a specific project. Accepts MT5 Strategy Tester HTML reports.
curl -X POST https://algo-studio.com/api/backtest/upload \
-H "Cookie: next-auth.session-token=YOUR_SESSION" \
-F "file=@backtest-report.htm" \
-F "projectId=clx1abc123"{
"id": "clx2def456",
"projectId": "clx1abc123",
"fileName": "backtest-report.htm",
"results": {
"totalTrades": 342,
"winRate": 58.2,
"profitFactor": 1.85,
"maxDrawdown": 12.4,
"netProfit": 4250
},
"createdAt": "2026-01-20T08:00:00Z"
}| Code | Description |
|---|---|
| 400 | Missing file or projectId |
| 401 | Not authenticated |
| 404 | Project not found |
| 413 | File too large (max 5MB) |
/api/backtest?projectId=clx1abc123Retrieve backtest results for a project.
{
"data": [
{
"id": "clx2def456",
"fileName": "backtest-report.htm",
"results": {
"totalTrades": 342,
"winRate": 58.2,
"profitFactor": 1.85
},
"createdAt": "2026-01-20T08:00:00Z"
}
]
}| Code | Description |
|---|---|
| 401 | Not authenticated |
| 404 | Project not found |
Marketplace API
/api/marketplace/search?q=ema&category=trend-following&sort=popular&page=1&limit=20Search public strategy templates. Supports filtering by query, category, and tag.
{
"data": [
{
"id": "tmpl_abc123",
"name": "EMA Crossover Pro",
"description": "Trend-following with dual EMA filters",
"authorEmail": "joh***@gmail.com",
"downloads": 142,
"avgRating": 4.5,
"ratingCount": 12,
"category": "trend-following",
"tags": [
"ema",
"trend"
],
"createdAt": "2026-01-10T12:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1
}
}| Code | Description |
|---|---|
| 500 | Internal server error |
/api/marketplace/publishPublish a project as a public marketplace template.
{
"projectId": "clx1abc123",
"name": "My EMA Strategy",
"description": "A simple EMA crossover strategy",
"category": "trend-following",
"tags": [
"ema",
"simple"
]
}| Code | Description |
|---|---|
| 400 | Validation failed |
| 401 | Not authenticated |
| 404 | Project not found |
/api/marketplace/rateRate a marketplace template (1-5 stars). Updates existing rating if already rated.
{
"templateId": "tmpl_abc123",
"rating": 5,
"review": "Excellent strategy, works great on EURUSD"
}| Code | Description |
|---|---|
| 400 | Invalid rating (must be 1-5) |
| 401 | Not authenticated |
| 404 | Template not found |
Live EA API
/api/live/statusGet the status of all your live EA instances, including trade history and equity heartbeats.
{
"data": [
{
"id": "ea_inst_001",
"eaName": "EMA Cross v3",
"symbol": "EURUSD",
"timeframe": "H1",
"broker": "IC Markets",
"status": "ONLINE",
"lastHeartbeat": "2026-01-20T14:30:00Z",
"balance": 10500.25,
"equity": 10480,
"openTrades": 1,
"totalTrades": 89,
"totalProfit": 500.25,
"trades": [
{
"profit": 32.5,
"closeTime": "2026-01-20T12:15:00Z"
}
],
"heartbeats": [
{
"equity": 10480,
"createdAt": "2026-01-20T14:30:00Z"
}
]
}
]
}| Code | Description |
|---|---|
| 401 | Not authenticated |
| 500 | Internal server error |
curl https://algo-studio.com/api/live/status \
-H "Cookie: next-auth.session-token=YOUR_SESSION"