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 before linking an account. A server already present in the accepted generation returns verified. A new server returns pending while one isolated discovery builder creates a replacement generation.
    curl -X POST https://api.fivesocket.com/v1/server-verifications \ -H "Authorization: Bearer $FIVESOCKET_KEY" \ -H "Content-Type: application/json" \ -d '{"server":"YourBroker-Demo"}'
    Repeat the same request until the status is verified. A not_found result is terminal for that exact name; check the spelling before retrying.
  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
    Every read is a fresh MT5 login, so expect seconds rather than milliseconds on a cold pool.
    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

  • 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.