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
| Prefix | Purpose |
|---|---|
/auth/v1/oauth2 | Login, token refresh, logout |
/api/v1 | Authenticated REST resources (Bearer token) |
/api/v1/public | Unauthenticated: signup, forgot password, broker |
/ws/v1 | Real-time WebSocket stream |
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": ""
}
success—trueon 2xx,falseotherwise.code— the HTTP status, repeated for convenience.data— the payload (object, array, ornull).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
- Authentication — tokens, refresh, sessions.
- Accounts & IDs — account ID vs session ID, scopes.
- Recipes — open and close a position end to end.
- WebSocket — stream live prices and account events.
- API Reference — every endpoint with a live Try-It.