CopyPro provides a RESTful API used to manage accounts and copy trades between them via MetaTrader (MT4/MT5). This document describes each endpoint in detail for frontend and integration developers.
All endpoints are hosted under:
Most endpoints require a userKey, which can be obtained via the SignUp or SignIn endpoints.
GET /SignUp
Registers a new user.
Params:
email: stringpasswordHash: string (client-side hashed)GET /SignIn
Authenticates user and returns userKey.
Params:
email: stringpasswordHash: string (client-side hashed)GET /AddAccount
Connects a MetaTrader account to the platform.
Params:
name: Display nameuserKey: From SignIntype: MT4 or MT5user: Account numberpassword: Account passwordserver: Broker server nameGET /RemoveAccount
Removes a connected account.
Params:
apiId: API token of the accountuserKey: Auth tokenGET /Accounts
Returns all connected accounts and their connection status.
Params:
userKey: stringGET /Start
Connects master/slave accounts.
Required Params:
userKeymasterType, masterUser, masterPassword, masterServer, masterNameslaveType, slaveUser, slavePassword, slaveServer, slaveNameriskType, riskValuemasterApiId, slaveApiIdOptional:
copySL, copyTPfixedSlPips, fixedTpPipscopyPendingOrdersriskMultiply, fixedMasterBalanceGET /Remove
Stops a copier by id.
Params:
id: CopierId returned from StartGET /UserCopiers
Lists all active copiers for a user.
Params:
userKey: stringGET /GetCopier
Returns copier configuration by id.
Params:
id: CopierIdGET /OpenOrders
Params:
accountId: stringGET /OpenOrdersAll
Params:
userKey: stringGET /ClosedOrders
Params:
accountId: stringfrom: DateTimeto: DateTimeGET /ClosedOrdersAll
Params:
userKey: stringfrom: DateTimeto: DateTimeGET /TradeStatsByAccountId
Params:
accountId: stringfrom: DateTime (optional)excludeSameBars: bool (default: true)GET /TradeStatsByApiId
Params:
apiId: stringtype: ApiType (MT4 or MT5)from: DateTime (optional)excludeSameBars: boolGET /Logs
Params:
id: CopierIdlimit: number (default: 1000)logLevel: LogLevelGET /TradeLogs
Params:
copierId: stringlimit: number (default: 100)GET /TradeLogsAll
Params:
userKey: stringlimit: number (default: 100)GET /MappedSymbols
Params:
copierId: stringGET /AddSymbolMapping
Params:
copierId: stringmasterSymbol: stringslaveSymbol: string (use __ to include fixed lots, e.g., EURUSDmini__0.2)slavelots: decimalGET /DeleteSymbolMapping
Params:
copierId: stringmasterSymbol: stringGET /ServerNames
Params:
mt5: bool (true = MT5, false = MT4)GET /Headers
Returns incoming request headers.
GET /ReadMe
Returns readme.md as HTML.
For questions or integration issues, contact support via the users.mtapi.io portal.
Full functional trial version for 14 days. More details and full version available at:
docker login reg.mtapi.io:5050
docker run -d --restart always -p 5014:80 --name lid4 reg.mtapi.io:5050/root/loginid-mt4-bin
docker run -p 5004:80 --add-host=host.docker.internal:host-gateway \
-e LoginIdUrl='http://host.docker.internal:5014' -d --restart always \
--name mt4 reg.mtapi.io:5050/root/mt4rest-full/mt4rest
docker run -d --restart always -p 5015:80 --name lid5 reg.mtapi.io:5050/root/loginid-mt5-bin
docker run -p 5005:80 --add-host=host.docker.internal:host-gateway \
-e LoginIdUrl='http://host.docker.internal:5015' -d --restart always \
--name mt5 reg.mtapi.io:5050/root/mt5rest-full/mt5rest
After that MT4 API available at port 5004, MT5 API at port 5005. 2. Start DB
docker run --name=mongo \
-e=MONGO_INITDB_ROOT_USERNAME=main_admin \
-e=MONGOINITDBROOTPASSWORD=some_password \
--volume=/root/MongoData:/data/db \
-p 27017:27017 --restart=always --runtime=runc --detach=true mongo
After that MongoDB available at port 27017. 3. Start copy backend
docker run -d --restart always -p 5020:80 --add-host=host.docker.internal:host-gateway --name copyback \
-e ApiMT4='http://host.docker.internal:5004' \
-e ApiMT5='http://host.docker.internal:5005' \
-e MongoDB='mongodb://main_admin:some_password@host.docker.internal:27017' \
reg.mtapi.io:5050/root/tradecopy
After that copier backend available at port 5020. 4. Start copy frontend
docker run -d --restart always -p 5030:8080 --add-host=host.docker.internal:host-gateway --name copyfront \
-e CopyBackend='http://host.docker.internal:5020' \
reg.mtapi.io:5050/root/copyfront
After that copier frontend at port 5030.
git clone https://git.mtapi.io/root/tradecopy
cd tradecopy
docker build -t tradecopy ./tradecopy
docker run -d --restart always --name tc -p 5009:80 tradecopy
After that service available at port 5009.