MetaTrader API

Authentication

How to authenticate with the MetatraderApi.dev API

MetatraderApi.dev uses two different authentication methods depending on your plan.

🔑 Single Account Plan

When you register on the platform, you'll receive an API Key in the Settings tab of your dashboard. This key is used to authenticate requests to our base URL:

https://api.metatraderapi.dev

Connecting Trading Accounts

You can connect your trading accounts via the dashboard or via the API. For connecting accounts via the API, you can use the /RegisterAccount endpoint described Metatrader 4 Api / Metatrader 5 Api Documentation. To connect your trading accounts via the Dashboard, follow these steps:

  1. Log in to the dashboard at https://app.metatraderapi.dev.
  2. Navigate to the Accounts section and add your trading accounts (MT4/MT5).
  3. Once your accounts are connected successfully, you will receive a unique UUID for each account.
  4. Use your API Key in the x-api-key header to authenticate your User.
  5. Use the UUID in the accountId query parameter to authenticate your Account.
x-api-key: YOUR_API_KEY

Example request:

curl -X GET "https://api.metatraderapi.dev/AccountSummary?id=YOURACCOUNTUUID" \
  -H "x-api-key: YOUR_API_KEY"

🚀 Pro Plans

For Pro Plans, authentication works differently:

  • You will be provided with a dedicated base URL.
  • You will receive a username and password for authentication.
  • All requests are authenticated via Basic Auth.

Connecting Accounts

With Pro Plans, you can connect and manage trading accounts directly via the API without using the dashboard.

Authorization: Basic BASE64_ENCODED(USERNAME:PASSWORD)

📌 Summary

  • Single Account Plan: API Key + UUID (via dashboard setup).
  • Pro Plan: Basic Auth with a dedicated base URL (accounts managed via API).