CopyPro API Usage Manual

Overview

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:

https://copy.mtapi.io/

Authentication

Most endpoints require a userKey, which can be obtained via the SignUp or SignIn endpoints.

User Management

Sign Up

GET /SignUp

Registers a new user.

Params:

Sign In

GET /SignIn

Authenticates user and returns userKey.

Params:

Accounts

Add Account

GET /AddAccount

Connects a MetaTrader account to the platform.

Params:

Remove Account

GET /RemoveAccount

Removes a connected account.

Params:

List Accounts

GET /Accounts

Returns all connected accounts and their connection status.

Params:

Copying Trades

Start Copying

GET /Start

Connects master/slave accounts.

Required Params:

Optional:

Stop Copying

GET /Remove

Stops a copier by id.

Params:

List Active Copiers

GET /UserCopiers

Lists all active copiers for a user.

Params:

Copier Details

GET /GetCopier

Returns copier configuration by id.

Params:

Orders

Open Orders (Single Account)

GET /OpenOrders

Params:

Open Orders (All Accounts)

GET /OpenOrdersAll

Params:

Closed Orders (Single Account)

GET /ClosedOrders

Params:

Closed Orders (All Accounts)

GET /ClosedOrdersAll

Params:

Statistics

Trade Statistics by Account ID

GET /TradeStatsByAccountId

Params:

Trade Statistics by API ID

GET /TradeStatsByApiId

Params:

Logs

Copier Logs

GET /Logs

Params:

Trade Logs

GET /TradeLogs

Params:

All Trade Logs for User

GET /TradeLogsAll

Params:

Symbol Mapping

Get Mapped Symbols

GET /MappedSymbols

Params:

Add Symbol Mapping

GET /AddSymbolMapping

Params:

Delete Symbol Mapping

GET /DeleteSymbolMapping

Params:

Brokers

Get Server Names

GET /ServerNames

Params:

Utilities

Headers Debug

GET /Headers

Returns incoming request headers.

Markdown ReadMe

GET /ReadMe

Returns readme.md as HTML.

Support

For questions or integration issues, contact support via the users.mtapi.io portal.

Trade Copier for MetaTrader 4 and MetaTrader 5

Full functional trial version for 14 days. More details and full version available at:

YouTube Backend first steps to copy trades between MetaTrader 4 and MetaTrader 5

First steps

YouTube How to get acccount information from MT4 and MT5 using RESTful API

Acccount information

How to deploy with docker

  1. Start client APIs
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.

Building from sources

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.