GET Accounts
- NT8
- Tradovate
Get list of all accounts NT8
Lists the NinjaTrader accounts available to the authenticated CrossTrade user.
Endpoint
GET /v1/api/accounts
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/accounts"
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";
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" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
Response
- 200
- 400
{
"accounts": [
{
"id": 0,
"name": "Backtest",
"status": "Enabled"
},
{
"id": 1,
"name": "Playback101",
"status": "Enabled"
},
{
"id": 2,
"name": "Sim101",
"status": "Enabled"
},
{
"id": 3,
"name": "DemoAccount",
"status": "Enabled"
},
{
"id": 4,
"name": "LiveAccount1",
"status": "Enabled"
},
{
"id": 5,
"name": "LiveAccount2",
"status": "Enabled"
}
],
"success": true
}
{
"error": "Invalid request"
}
Platform nuances
The response returns the account list in accounts. Each documented NT8 account record contains
id, name, and status.
WebSocket API
This request can also be made over the WebSocket API.
{
"action": "rpc",
"id": "my-request-id",
"api": "ListAccounts",
"args": {}
}
Get list of all accounts Tradovate
Lists every cached Tradovate account linked to the authenticated CrossTrade user. The request executes server-side against the Tradovate Web API and does not require the NinjaTrader add-on to be connected.
Endpoint
GET /v1/api/tv/accounts
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Code examples
- Python
- JavaScript
- cURL
import requests
token = 'my-secret-token'
url = "https://app.crosstrade.io/v1/api/tv/accounts"
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";
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" \
-H "Authorization: Bearer $TOKEN"
Response
Successful reads return {"success": true, "data": ...}. For this endpoint, data is the
list of cached linked Tradovate accounts. Each account contains name, account_id,
environment (demo or live), and user_id.
Platform nuances
- The response uses a
datawrapper, unlike the NT8accountsfield. - Account records identify the Tradovate environment and identity that owns each account.
- The endpoint works while NinjaTrader is closed.
See the Tradovate API overview for the full field grammar, mutation safety guarantees, and error table.