MetaTrader web API

A MetaTrader web API for MT4 and MT5

Tickwire is a MetaTrader web API: it runs a real MT4 or MT5 terminal in the cloud for each of your accounts and lets you call it over HTTPS with REST and WebSocket. You need no Windows PC, no VPS and no code inside the terminal.

Two kinds of "MetaTrader web API"

Searches for a MetaTrader 4 web API or server API mix up two products. Only one of them works with a trader's login.

Broker-side and trader-side MetaTrader APIs
Broker-side server APITrader-side cloud API
Who uses itBrokers that run their own MetaTrader serversTraders, developers, AI agents, tool builders
What it controlsA whole server: clients, groups, every accountOne trading account, with its own login
Login it needsA server manager loginThe account's own login, or the investor password to read only
Who can buy itBrokers, from the platform's makerAnyone with an MT4 or MT5 account
TickwireNot offeredYes, for MT4 and MT5

If you run a brokerage, you want the server-side interfaces from the platform's maker. If you trade, build a bot, a dashboard, a copier or an AI agent, you want a cloud API for your own accounts. That is what Tickwire does.

Plain HTTPS

What the calls look like

The same terminal answers on three surfaces. Use whichever fits your code, and mix them freely.

export TW=https://api.tickwire.io

# Account REST API, the same on MT4 and MT5
curl -s "$TW/users/current/accounts/acc_7Qx/account-information" -H "auth-token: $TW_KEY"

# Terminal routes, named like the terminal's own calls
curl -s "$TW/mt4/acc_7Qx/AccountSummary" -H "X-API-Key: $TW_KEY"
curl -s "$TW/mt5/acc_7Qx/OpenedOrders" -H "X-API-Key: $TW_KEY"
  • Account REST API at /users/current/accounts/{id}/…: account information, positions, orders, trading, quotes, candles and history, with camelCase fields.
  • Terminal routes at /mt4/{id}/… and /mt5/{id}/…: AccountSummary, OrderSend, OrderClose, PriceHistory and more.
  • MCP server for Claude, ChatGPT and agent frameworks, at the address below.

Streams and webhooks

Open one WebSocket per account for prices, positions, orders and health. Register webhooks to hear about disconnects, failed logins, margin calls and stop-outs without keeping a socket open.

websocat -H "auth-token: $TW_KEY" "wss://api.tickwire.io/users/current/accounts/acc_7Qx/ws"
{"type":"subscribe","marketData":[{"symbol":"EURUSD","subscriptions":[{"type":"quotes"}]}]}

What a web API should get right

  • Orders that can't run twice. Every order takes an Idempotency-Key. A repeat returns the first answer.
  • Honest outcomes. When a result can't be confirmed, the answer is unknown, not a guess.
  • Real health. Connected means the terminal is logged in and the account was read.
  • Broker time, labelled. Broker-local times are never passed off as UTC.
  • A log of every change, with who asked and why.

MT4 or MT5: pick your page

One API covers both platforms. These pages go deeper on each one.

MT4 web API

MetaTrader 4 has no API of its own. See what works on MT4, and the few calls that answer not_supported_on_mt4.

The MT4 API
What works on each platform

MT5 web API

Every MT5 feature, including market depth, tick history and 21 timeframes, over REST and WebSocket.

The MT5 API
Quickstart: your first call

For AI apps

Add this address to Claude or ChatGPT as a custom connector and sign in. See the MetaTrader MCP server.

https://api.tickwire.io/mcp

Questions

What is the MetaTrader web API?

The phrase covers two things. Brokers can buy server-side web and manager interfaces to run their own MetaTrader servers. Traders and developers who want to call one account over the web use a cloud API instead. Tickwire is a cloud API: it runs a real MT4 or MT5 terminal for each account and exposes it over HTTPS with REST and WebSocket.

Is there an MT4 web API?

MetaTrader 4 has no built-in web API for traders. Tickwire gives each MT4 account a REST API, terminal routes under /mt4/{id}/ and a WebSocket stream, the same as MT5. Features MT4 lacks answer not_supported_on_mt4.

Can I use the MetaTrader server or manager API with my trading login?

No. Those interfaces are for brokers that run the server, and they need a manager login. With a normal trading login you use a trader-side API such as Tickwire, which logs in the same way the desktop terminal does.

Does a MetaTrader cloud API work with any broker?

Tickwire works with any broker that offers MT4 or MT5 accounts. You give the server name from the terminal's login dialog, your login and your password. On MT4, also give the broker's public server address (host:port), or upload its .srv file. The password is write-only and never returned or logged.

Do I need Windows or a VPS?

No. The terminal runs in Tickwire's cloud. Your code calls it over HTTPS from a Mac, Linux, a server or a browser.

How much does it cost?

From $12 per account a month, the same for MT4 and MT5, after a 7-day free trial. The sandbox is free.

MT4 and MT5 API documentation
API reference
What the API costs per account

Make your first call

Free sandbox, then a 7-day free trial. From $12 per account a month. See pricing.