Getting Started
This guide walks you through authenticating with the Trade API and making your first request. By the end, you’ll have a working access token and a confirmed connection to the API.
What You Need
- A NinjaTrader account with a username and password.
- API credentials: a client ID (
cid) and secret (sec) issued by NinjaTrader. Keep yoursecout of public repositories and client-side code. - A device identifier: a string of up to 64 characters that permanently identifies the device making requests. You can generate one with a package like DeviceId for C# or device-uuid for JavaScript.
All examples on this page use the Demo environment (demo.tradovateapi.com). Swap in live.tradovateapi.com when you’re ready for Live trading.
Get an access token
Exchange your credentials for an access token by calling accessTokenRequest:
A successful response includes your access token and its expiration time:
Save your accessToken for REST requests and WebSocket connections to the trading API. If you plan to use the Market Data API, save the mdAccessToken as well.
Tokens last about 90 minutes. To keep a long-running application connected, call renewAccessToken before the token expires rather than requesting a new one. See Authentication & Access for the full token lifecycle, session limits, and two-factor authentication details.
Make your first call
Confirm your token works by listing your accounts. Send it as a Bearer value in the Authorization header:
A successful response returns an array of your accounts with their IDs, names, and account details. If you get an HTTP 401 response, your token may be expired or incorrectly formatted.
Explore the API
With a working token, you’re ready to build. A few common starting points:
- Place an order. Call
order/placeorderto submit a trade. - Check your positions. Call
position/listto see your open positions. - Stream real-time updates. Open a WebSocket connection to receive order and position events in real time without polling.
Browse the REST API Endpoints for the full list of available operations, or read API Conventions for query and submission patterns.
Next Steps
- Review Authentication & Access for session limits, token renewal, and two-factor authentication.
- If your application authenticates other users, see OAuth Integration to delegate authentication to NinjaTrader.
- Read API Conventions to understand how the API structures queries and submissions.
- Connect to the WebSocket for real-time order and position updates.
- Use the Market Data API for real-time quotes, depth of market, and charts.

