Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Quickstart

Four requests take you from an API key to live account data, including first-time exact-server discovery.
  1. Get an API key
    API keys are created in the FiveSocket control surface and are shown once at creation. A key looks like this:
    mt5_live_012345abcdef_4f6a...
    Store it in a secret manager and send it as a bearer token on every request:
    export FIVESOCKET_KEY="mt5_live_..."
  2. Verify the exact server
    Submit the exact server name shown by MT5. FiveSocket reserves a free portable, asks MT5 to resolve it without credentials, and returns resolved or not_found with measured latency. Results completed within two seconds are JSON. Slower checks emit a newline-delimited pending event and keep the same response open until the terminal result or error arrives. The curl command handles both forms without polling. Verification is recommended but not required before account linking.
    curl -X POST https://api.fivesocket.com/v1/server-verifications \ -H "Authorization: Bearer $FIVESOCKET_KEY" \ -H "Content-Type: application/json" \ -d '{"server":"YourBroker-Demo"}'
    A not_found result means the exact directory search completed without that name; check the spelling before retrying. A service error means the search did not complete and is safe to retry.
  3. Link an MT5 account
    Linking performs a real read-only login against your broker before the account becomes active. Credentials are encrypted at rest and are never returned by any endpoint.
    curl -X POST https://api.fivesocket.com/v1/accounts \ -H "Authorization: Bearer $FIVESOCKET_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: link-demo-1" \ -d '{ "login": "12345678", "password": "your-investor-password", "server": "YourBroker-Demo" }'
    The response returns an opaque account ID you use for all reads:
    { "id": "acc_...", "login": "•5678", "server": "YourBroker-Demo", "status": "active", "createdAt": "2026-07-14T10:00:00.000Z" }
    server must be the exact MT5 server name as your broker publishes it. A login that succeeds in your desktop terminal uses the same string.
  4. Read live data
    The first read may perform a cold login; later reads reuse the account's pinned live session until it is evicted or expires.
    curl https://api.fivesocket.com/v1/accounts/acc_.../balance \ -H "Authorization: Bearer $FIVESOCKET_KEY"
    { "accountId": "acc_...", "login": "•5678", "server": "YourBroker-Demo", "observedAt": "2026-07-14T10:00:05.412Z", "latencyMs": 5210, "balance": "10000.00", "equity": "10012.50", "currency": "USD" }
    When you need balance, positions, and recent trades together, call snapshot instead of three separate endpoints. It amortizes the login over one exclusive session.

Next

  • MCP setup connects an OAuth-capable assistant without an API key.
  • Authentication covers scopes and key handling.
  • Errors and limits covers the error envelope, retries, pagination, and idempotency.
  • The API Reference tab documents every request and response shape.