The front door to every other endpoint.
The Connection API turns a MetaTrader login into an addressable account you can trade and stream. You POST the login, password and broker server to /ConnectEx; a dedicated terminal boots, logs in, and syncs — and you get back an account id plus a scoped trading key. From then on, every other endpoint targets that account with ?id=. If the broker ever drops the session, /Reconnect rebuilds it, and /ConnectState tells you exactly where a connection stands at any moment.
Connect, watch, reconnect, disconnect.
Connect
/ConnectEx with login, password and server. Add wait=1 to block until it's live, or use /ConnectStream to watch it come up.
Watch
/ConnectState reports one account or all of them; /OnConnectState streams every status change over WebSocket.
Recover
/Reconnect rebuilds a dropped session; /Disconnect tears it down cleanly when you're finished.
curl "https://hrx.info/ConnectEx?user=1072…&password=…&server=Ava-Demo%201-MT5&wait=1" \ -H "x-api-key: sk_live_…" { "id": "acc_5f3c…", "status": "ACTIVE", "tradingKey": "sk_live_…" } # use that id everywhere else curl "https://hrx.info/AccountSummary?id=acc_5f3c…" -H "x-api-key: sk_live_…"
Frequently asked
How do I connect an MT4 or MT5 account via API?+
/ConnectEx. A terminal boots and logs in, and you receive an account id and trading key. Add wait=1 to block until the account is ACTIVE.What do I do with the account id?+
?id=. The id is how the API knows which connected terminal to talk to.What happens if the broker drops the connection?+
/Reconnect to rebuild the session, or watch /ConnectState / stream /OnConnectState to detect drops as they happen and react automatically.Do I pass a server name or a host and port?+
/GetBrokerServersByBrokerName looks up a broker's servers and access points by name.Does disconnecting stop my billing period?+
/Disconnect removes the live connection but the paid period keeps running; reconnect any time within it without re-provisioning from scratch.One POST, and your account is on the API.
Connect an MT4 or MT5 login and get an id you can trade and stream against in seconds.