Skip to main content

Getting Started with the OnlyTrade API

This page will help you get started with the OnlyTrade Public API. You'll be placing your first trade in a few minutes.

Overview

OnlyTrade is a white-label trading platform for brokers and prop firms. The API lets external applications create, modify and delete orders and positions, and read historical quotes, account balances, deals, reports, and more — the same data the trading terminal uses.

The API is a request/response model over HTTPS, plus a WebSocket channel for real-time market and account events.

Base URL https://api.onlytradeplatform.com
PrefixPurpose
/auth/v1/oauth2Login, token refresh, logout
/api/v1Authenticated REST resources (Bearer token)
/api/v1/publicUnauthenticated: signup, forgot password, broker
/ws/v1Real-time WebSocket stream
Try it live

Every endpoint in the API Reference has a Try It panel that sends a real request to production — just paste your token and run it.

Response envelope

Every REST response is wrapped in the same envelope, so you always parse the same shape:

{
"success": true,
"code": 200,
"data": { },
"error": "",
"message": ""
}
  • successtrue on 2xx, false otherwise.
  • code — the HTTP status, repeated for convenience.
  • data — the payload (object, array, or null).
  • error / message — human-readable error info on failures.

Authentication

OnlyTrade uses OAuth2 bearer tokens. Log in with HTTP Basic credentials (the numeric account ID + password), receive an access_token, and send it as a Bearer header on every request:

# 1. Log in → get tokens
curl -X POST "https://api.onlytradeplatform.com/auth/v1/oauth2/login?remember_me=true" \
-H "Authorization: Basic $(printf '26100003:MyPassword' | base64)"

# 2. Use the access token
curl https://api.onlytradeplatform.com/api/v1/accounts/me \
-H "Authorization: Bearer <access_token>"

See Authentication for the full login / refresh / logout flow.

Next steps