Copydium Logo
Copydium

Developer Guide

Everything you need to build powerful copy trading applications with the Copydium API. From getting started to advanced integrations.

Quick Start Guide

Get up and running with the Copydium API in under 10 minutes.

01

Get API Key

Sign up for a Copydium account and generate your API key from the dashboard.

# Your API key will look like this:
X-API-Key: sk_live_abc123def456...
02

Make Your First Request

Test your API key by fetching your user profile.

curl https://api.copydium.com/api/v1/users/me \
  -H "X-API-Key: sk_live_abc123def456..." \
  -H "Content-Type: application/json"
03

Create Trading Account

Add your MetaTrader account to start copy trading.

curl https://api.copydium.com/api/v1/taccounts \
  -H "X-API-Key: sk_live_abc123def456..." \
  -H "Content-Type: application/json" \
  -d '{
    "serverId": "srv_123",
    "accountId": "12345678",
    "platform": "TRADE_PLATFORM_MT4",
    "accountType": "ACCOUNT_TYPE_DEMO"
  }'
04

Set Up Copy Trading

Create your first copy trading connection.

curl https://api.copydium.com/api/v1/connections \
  -H "X-API-Key: sk_live_abc123def456..." \
  -H "Content-Type: application/json" \
  -d '{
    "copyConnectionName": "My First Strategy",
    "masterAccount": {
      "accountId": "12345678",
      "tradePlatform": "TRADE_PLATFORM_MT4"
    },
    "followerAccount": {
      "accountId": "87654321", 
      "tradePlatform": "TRADE_PLATFORM_MT4"
    }
  }'

SDK Examples (API Calls)

No SDK required. Call our REST API directly using your language’s HTTP client with the X-API-Key header.

Node.js

// Requires Node 18+ for fetch()
const API_BASE_URL = process.env.API_BASE_URL || 'https://api.copydium.com';
const API_KEY = 'sk_live_abc123def456...';

// GET: User dashboard stats
const statsRes = await fetch(`${API_BASE_URL}/api/v1/reports/user/dashboard-stats`, {
  headers: { 'X-API-Key': API_KEY }
});
const stats = await statsRes.json();
console.log(stats);

// POST: Create trading account
const createRes = await fetch(`${API_BASE_URL}/api/v1/taccounts`, {
  method: 'POST',
  headers: {
    'X-API-Key': API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    serverId: 'srv_123',
    accountId: '12345678',
    tradePlatform: 'TRADE_PLATFORM_MT4',
    accountType: 'T_ACCOUNT_TYPE_FOLLOWER',
    password: 'your-password'
  })
});
const account = await createRes.json();
console.log(account);

Python

import os, requests

API_BASE_URL = os.getenv('API_BASE_URL', 'https://api.copydium.com')
API_KEY = 'sk_live_abc123def456...'
headers = { 'X-API-Key': API_KEY }

# GET: User dashboard stats
r = requests.get(f"{API_BASE_URL}/api/v1/reports/user/dashboard-stats", headers=headers)
print(r.json())

# POST: Create trading account
payload = {
  'serverId': 'srv_123',
  'accountId': '12345678',
  'tradePlatform': 'TRADE_PLATFORM_MT4',
  'accountType': 'T_ACCOUNT_TYPE_FOLLOWER',
  'password': 'your-password'
}
r = requests.post(f"{API_BASE_URL}/api/v1/taccounts", headers={**headers, 'Content-Type': 'application/json'}, json=payload)
print(r.json())

PHP

<?php
$API_BASE_URL = 'https://api.copydium.com';
$API_KEY = 'sk_live_abc123def456...';

// GET: User dashboard stats
$ch = curl_init("$API_BASE_URL/api/v1/reports/user/dashboard-stats");
curl_setopt_array($ch, [
  CURLOPT_HTTPHEADER => ["X-API-Key: $API_KEY"],
  CURLOPT_RETURNTRANSFER => true
]);
$stats = curl_exec($ch);
curl_close($ch);
print_r($stats);

// POST: Create trading account
$payload = json_encode([
  'serverId' => 'srv_123',
  'accountId' => '12345678',
  'tradePlatform' => 'TRADE_PLATFORM_MT4',
  'accountType' => 'T_ACCOUNT_TYPE_FOLLOWER',
  'password' => 'your-password'
]);

$ch = curl_init("$API_BASE_URL/api/v1/taccounts");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_HTTPHEADER => [
    "X-API-Key: $API_KEY",
    'Content-Type: application/json'
  ],
  CURLOPT_RETURNTRANSFER => true
]);
$resp = curl_exec($ch);
curl_close($ch);
print_r($resp);

Don't see your language? We also support Go, Ruby, Java, and C#.

Tutorials & Guides

Step-by-step tutorials to help you master the Copydium API.

Beginner10 min

Authentication & Security

Learn how to authenticate requests and implement security best practices.

Topics Covered:

  • API Key Management
  • Request Signing
  • Rate Limiting
  • Error Handling
Intermediate20 min

Trading Account Management

Connect and manage MT4/MT5 accounts programmatically.

Topics Covered:

  • Account Connection
  • Credential Validation
  • Platform Integration
  • Status Monitoring
Advanced45 min

Copy Trading Implementation

Build copy trading functionality with master-follower relationships.

Topics Covered:

  • Connection Setup
  • Risk Management
  • Trade Filtering
  • Performance Tracking

Additional Resources

Everything you need to succeed with the Copydium platform.

Documentation

Complete API reference and guides

Community

Join our developer community

Status Page

Monitor API uptime and status

Support

Get help from our team

Ready to Build Something Amazing?

Join thousands of developers who are building the future of copy trading with Copydium.