> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# Authentication & Access

Market data uses the same account and credentials as the Trade API — there's no separate signup. If you don't have access yet, start with [Getting Started](/market-data/getting-started); for the full token flow, see the Trade API [Authentication & Access](/api/authentication) guide.

## The Market Data Access Token

When you request an access token, the response includes two tokens:

* `accessToken` — for REST requests and the trading WebSocket.
* `mdAccessToken` — for the **market-data** WebSocket.

Use `mdAccessToken` to authorize the market-data connection.

## Market Data Servers

Market data is served from a dedicated host, separate from the trading API:

| Environment | WebSocket URL                                 |
| ----------- | --------------------------------------------- |
| Live        | `wss://md.tradovateapi.com/v1/websocket`      |
| Demo        | `wss://md-demo.tradovateapi.com/v1/websocket` |

## Authorizing the Connection

A WebSocket connection is authorized once per session. After opening the socket, send an `authorize` request with your `mdAccessToken`:

```text
authorize
1

<your mdAccessToken>
```

A successful response looks like `a[{"s":200,"i":1}]`. For the connection and frame-decoding details, see [Real-Time Data via WebSocket](/market-data/websockets); for the underlying protocol, see the Trade API [WebSocket guide](/api/websockets).