GET Account
- NT8
- Tradovate
Get a specific account by name NT8
Returns current details and balance information for one named NinjaTrader account.
Endpoint
GET /v1/api/accounts/{account}
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account | string | Required | Name of account in NT8 |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/accounts/Sim101"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
try:
response = requests.get(url, headers=headers)
print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
print(f"An error occurred: {e}")
const token = 'my-secret-token';
const url = "https://app.crosstrade.io/v1/api/accounts/Sim101";
fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
}
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
TOKEN="my-secret-token"
curl -X GET "https://app.crosstrade.io/v1/api/accounts/Sim101" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
Response
- 200
- 400
- 401
- 403
- 408
- 429
- 500
{
"id": 2,
"name": "Sim101",
"type": "NinjaTrader.Cbi.Account",
"displayName": "Sim101",
"primaryUser": null,
"provider": "Simulator",
"denomination": "UsDollar",
"commissionTemplate": null,
"status": "Enabled",
"isAccountFlat": false,
"dailyLossLimit": 0.0,
"minCashValue": 0.0,
"maxOrderSize": 0,
"maxPositionSize": 0,
"connection": "NinjaTrader.Cbi.Connection",
"connectionStatus": "Connected",
"connectionName": "Simulation",
"item": {
"buyingPower": 0.0,
"cashValue": 100565.00000000285,
"commission": 0.0,
"dailyLossLimit": 0.0,
"dailyProfitTrigger": 0.0,
"excessInitialMargin": 103502.50000000285,
"excessIntradayMargin": 103502.50000000285,
"excessMaintenanceMargin": 100000.0,
"excessPositionMargin": 100000.0,
"fee": 0.0,
"grossRealizedProfitLoss": 0.0,
"initialMargin": 0.0,
"intradayMargin": 0.0,
"longOptionValue": 0.0,
"longStockValue": 0.0,
"lookAheadMaintenanceMargin": 0.0,
"maintenanceMargin": 0.0,
"netLiquidation": 103502.50000000285,
"netLiquidationByCurrency": 0.0,
"positionMargin": 0.0,
"realizedProfitLoss": 0.0,
"shortOptionValue": 0.0,
"shortStockValue": 0.0,
"sodCashValue": 0.0,
"sodLiquidatingValue": 0.0,
"totalCashBalance": 0.0,
"trailingMaxDrawdown": 0.0,
"unrealizedProfitLoss": 2937.5,
"weeklyLossLimit": 0.0,
"weeklyProfitLoss": 0.0,
"weeklyProfitTrigger": 0.0
},
"success": true
}
{
"error": "The request timed out, please check connection to NT8 Add-On."
}
{
"error": "Invalid bearer token"
}
{
"error": "Endpoint not available"
}
{
"error": "Client not ready to receive requests, disconnected."
}
// retryAfter is integer seconds; also sent as Retry-After.
{
"error": "Rate limit exceeded",
"retryAfter": 1
}
{
"success": false,
"error": "internal_error"
}
Success field types
Float fields accept whole or fractional JSON numbers. Account-item values can be null when NT8 cannot read them.
| Field | Type | Description |
|---|---|---|
success | boolean | true on success. |
id | integer | NT8 account ID. |
name, displayName, type, provider, denomination, status | string | Account identity, provider, currency and status. |
primaryUser | null in captures | No populated primary-user value captured. |
commissionTemplate, connection, connectionName | string or null | Commission template and connection metadata. |
connectionStatus | string | Broker connection status. |
isAccountFlat | boolean | Whether the account is flat. |
dailyLossLimit, minCashValue | float | Account limits. |
maxOrderSize, maxPositionSize | integer | Quantity limits. |
item | object | Account values below, each float or null. |
item.buyingPower, item.cashValue, item.commission, item.fee | float or null | Available funds and costs. |
item.dailyLossLimit, item.dailyProfitTrigger, item.trailingMaxDrawdown | float or null | Daily risk limits. |
item.excessInitialMargin, item.excessIntradayMargin, item.excessMaintenanceMargin, item.excessPositionMargin | float or null | Excess margin values. |
item.initialMargin, item.intradayMargin, item.lookAheadMaintenanceMargin, item.maintenanceMargin, item.positionMargin | float or null | Margin requirements. |
item.grossRealizedProfitLoss, item.realizedProfitLoss, item.unrealizedProfitLoss | float or null | P/L in currency units. |
item.longOptionValue, item.longStockValue, item.shortOptionValue, item.shortStockValue | float or null | Holdings valuations. |
item.netLiquidation, item.netLiquidationByCurrency, item.totalCashBalance | float or null | Account valuations. |
item.sodCashValue, item.sodLiquidatingValue | float or null | Start-of-day valuations. |
item.weeklyLossLimit, item.weeklyProfitLoss, item.weeklyProfitTrigger | float or null | Weekly P/L and limits. |
Platform nuances
NT8 account fields are returned at the top level. Current balance and margin values are nested
under item.
WebSocket API
This request can also be made over the WebSocket API. The account path parameter is passed inside args.
{
"action": "rpc",
"id": "my-request-id",
"api": "GetAccount",
"args": {
"account": "Sim101"
}
}
Get a specific account by name Tradovate
Returns the linked account record and current cash-balance snapshot for one named Tradovate account. The request executes server-side against the Tradovate Web API and works while NinjaTrader is closed.
Endpoint
GET /v1/api/tv/accounts/{account}
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account | string | Required | Tradovate account name, for example DEMO12345678 |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678"
headers = {
"Authorization": f"Bearer {token}"
}
try:
response = requests.get(url, headers=headers)
print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
print(f"An error occurred: {e}")
const token = 'my-secret-token';
const url = "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678";
fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`
}
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
TOKEN="my-secret-token"
curl -X GET "https://app.crosstrade.io/v1/api/tv/accounts/DEMO12345678" \
-H "Authorization: Bearer $TOKEN"
Response
- 200
- 400
- 401
- 403
- 429
- 500
- 502
- 503
{
"success": true,
"data": {
"accountId": "12345678",
"environment": "demo",
"userId": "12345",
"name": "DEMO12345678",
"balance": {
"totalCashValue": 50000,
"totalPnL": 125,
"initialMargin": 500,
"maintenanceMargin": 450,
"netLiq": 50125,
"openPnL": 125,
"realizedPnL": 0,
"weekRealizedPnL": 250,
"currencyCashAvailWithdrawalUSD": 50000,
"netLiqSOD": 50000,
"totalCashValueSOD": 50000,
"cashUSD": 50000,
"cashSODUSD": 50000,
"fullInitialMargin": 500,
"fullInitialMarginSOD": 0,
"autoLiqLevel": -2000,
"fundsInTransitUSD": 0,
"fundsInTransitAppliedToCashUSD": 0
}
}
}
{
"success": false,
"error": "unknown_account"
}
{
"success": false,
"error": "inactive_subscription"
}
{
"success": false,
"error": "tradovate_not_linked"
}
// retryAfter is integer seconds; also sent as Retry-After.
{
"success": false,
"error": "snapshot_refresh_pending",
"detail": "An account balance refresh is already in progress. Retry after 1s.",
"retryAfter": 1
}
{
"success": false,
"error": "internal_error"
}
{
"success": false,
"error": "tradovate_unavailable",
"detail": "Tradovate is temporarily unavailable. Please try again shortly."
}
{
"success": false,
"error": "temporarily_disabled"
}
Success field types
Broker balance fields can vary by account. Float fields accept whole or fractional JSON numbers.
| Field | Type | Description |
|---|---|---|
success | boolean | true on success. |
data | object | Linked account and balance. |
data.accountId, data.userId, data.name, data.environment | string | IDs, account name and demo/live environment. |
data.balance | object | Broker cash-balance snapshot. |
data.balance.totalCashValue, data.balance.totalPnL, data.balance.netLiq | float | Cash, total P/L and net liquidation. |
data.balance.openPnL, data.balance.realizedPnL, data.balance.weekRealizedPnL | float | Open, realized and weekly P/L. |
data.balance.initialMargin, data.balance.maintenanceMargin, data.balance.fullInitialMargin, data.balance.fullInitialMarginSOD | float | Margin figures. |
data.balance.currencyCashAvailWithdrawalUSD, data.balance.cashUSD, data.balance.cashSODUSD | float | USD balances. |
data.balance.netLiqSOD, data.balance.totalCashValueSOD | float | Start-of-day valuations. |
data.balance.autoLiqLevel, data.balance.fundsInTransitUSD, data.balance.fundsInTransitAppliedToCashUSD | float | Liquidation level and funds in transit. |
data.balance.withdrawalRejectReason | string | Optional withdrawal restriction text. |
Platform nuances
{account}identifies a Tradovate account rather than an NT8 account.- The response is wrapped in
data; the NT8 endpoint returns account fields at the top level. balanceis Tradovate's cash-balance snapshot (net liquidation, total cash value, open and realized P&L, initial and maintenance margin), cached server-side for about four seconds per account. Polling faster than that returns the same snapshot.- If another balance refresh is still in progress after a brief wait, the read returns HTTP 429 with
error: "snapshot_refresh_pending",retryAfter: 1, and the headerRetry-After: 1. Retry after that delay. This is refresh contention, not a broker outage,broker_rate_limited, or CrossTrade's inboundrate_limitedbudget. - The endpoint works while NinjaTrader is closed.
See the Tradovate API overview for the full field grammar, mutation safety guarantees, and error table.