MetaTrader API
Metatrader 5 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"

Simple test without parameters

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
port?integer
Default443
Formatint32

Response Body

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

Simple test without parameters

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"
hostarray<string>
portarray<integer>

Response Body

curl -X GET "https://api.metatraderapi.dev/PingHostMany?id=demo-token-mt5&host=string&port=0"
[
  0
]
{
  "message": "string",
  "code": "DONE",
  "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": "DONE",
  "stackTrace": "string"
}

Extract servers from servers.dat

POST
/LoadServersDat
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"
file?string

Response Body

curl -X POST "https://api.metatraderapi.dev/LoadServersDat?id=demo-token-mt5"
[
  {
    "serverInfoEx": {
      "serverName": "string",
      "companyName": "string",
      "dst": 0,
      "timeZone": 0,
      "address": "string",
      "pingTime": 0,
      "companyLink": "string"
    },
    "serverInfo": {
      "serverName": "string",
      "companyName": "string",
      "dst": 0,
      "timeZone": 0,
      "address": "string",
      "pingTime": 0
    },
    "accesses": [
      {
        "accessRec": {
          "serverName": "string"
        },
        "addresses": [
          {
            "address": "string"
          }
        ]
      }
    ],
    "accessesEx": [
      {
        "accessRec": {},
        "addresses": [
          {}
        ]
      }
    ]
  }
]
{
  "message": "string",
  "code": "DONE",
  "stackTrace": "string"
}