MetaTrader API
Metatrader 4 api

Service

Service functions not related to account

Simple test

GET
/Ping
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"demo-token-mt5"

Response Body

curl -X GET "https://api.metatraderapi.dev/Ping?id=demo-token-mt5"
"string"

Estimate time to connect to speciffied server and port in milliseconds

GET
/PingHost
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"demo-token-mt5"
hoststring

IP adresses or domain name

Default"mt4-demo.roboforex.com"
port?integer

Port

Default443
Formatint32

Response Body

curl -X GET "https://api.metatraderapi.dev/PingHost?id=demo-token-mt5&host=mt4-demo.roboforex.com&port=443"
0
{
  "message": "string",
  "code": "INTERNAL_ERROR",
  "stackTrace": "string"
}

Estimate time to connect to speciffied server and port in milliseconds

GET
/PingHostMany
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"demo-token-mt5"
hostsarray<string>

List IP adresses or domain names joined with port by ':' symbol

Response Body

curl -X GET "https://api.metatraderapi.dev/PingHostMany?id=demo-token-mt5&hosts=string"
[
  0
]
{
  "message": "string",
  "code": "INTERNAL_ERROR",
  "stackTrace": "string"
}

Broker search by company name

GET
/Search
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"demo-token-mt5"
companystring

Company name

Response Body

curl -X GET "https://api.metatraderapi.dev/Search?id=demo-token-mt5&company=string"
[
  {
    "companyName": "string",
    "results": [
      {
        "name": "string",
        "access": [
          "string"
        ]
      }
    ]
  }
]
{
  "message": "string",
  "code": "INTERNAL_ERROR",
  "stackTrace": "string"
}

Extract all IP address and DNS names

Returns an array of a Server objects

POST
/LoadSrv
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"demo-token-mt5"
filestring

Response Body

curl -X POST "https://api.metatraderapi.dev/LoadSrv?id=demo-token-mt5" \  -F file="string"
[
  {
    "server": "string",
    "ip": 0,
    "desc": "string",
    "is_proxy": 0,
    "priority": 0,
    "loading": 0,
    "ip_internal": 0,
    "ping": 0,
    "reserved": 0,
    "host": "string",
    "port": 0,
    "description": "string"
  }
]
{
  "message": "string",
  "code": "INTERNAL_ERROR",
  "stackTrace": "string"
}

Extract all IP address and DNS names from servers.ini

POST
/LoadServersIni
x-api-key<token>

Your API key

In: header

Query Parameters

idstring

Your Account UUID which you connected via the Dashboard

Default"demo-token-mt5"
filestring

Response Body

curl -X POST "https://api.metatraderapi.dev/LoadServersIni?id=demo-token-mt5" \  -F file="string"
{
  "property1": [
    {
      "server": "string",
      "ip": 0,
      "desc": "string",
      "is_proxy": 0,
      "priority": 0,
      "loading": 0,
      "ip_internal": 0,
      "ping": 0,
      "reserved": 0,
      "host": "string",
      "port": 0,
      "description": "string"
    }
  ],
  "property2": [
    {
      "server": "string",
      "ip": 0,
      "desc": "string",
      "is_proxy": 0,
      "priority": 0,
      "loading": 0,
      "ip_internal": 0,
      "ping": 0,
      "reserved": 0,
      "host": "string",
      "port": 0,
      "description": "string"
    }
  ]
}
{
  "message": "string",
  "code": "INTERNAL_ERROR",
  "stackTrace": "string"
}