> ## Documentation Index
> Fetch the complete documentation index at: https://finance.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Connect your app to Aries and make your first API call in a few simple steps.

## Prerequisites

Before you begin, make sure you have:

* An active Aries account
* A terminal and your preferred language runtime (Node.js 18+, Python 3.8+, or any HTTP client for cURL)

If you are new to APIs, you can still follow this page. The steps appear in the order you need to complete them. First, you create an API app in Aries. Next, you send the user to Aries so they can sign in and approve access. Then you receive a code, exchange it for tokens, and use the access token to call Aries endpoints.

***

## Step 1: Register your app

Before your app can talk to Aries, you need to register it. This lets Aries know which app is making the request and what permissions that app will ask for.

When you complete this step, Aries gives you two credentials:

* **Client ID** - A public identifier for your app
* **Client Secret** - A private secret that proves the request is coming from your app

You will use both of these values in later steps.

1. Log in to Aries and open [Client Center / Manage Account](https://app.aries.com/client-center/api). Then go to the **API** tab.
2. Click **Generate Key**.
3. Fill in the fields:
   * **Client Name** - A descriptive name for your app, such as `My Trading App`
   * **Redirect URIs** - The URL Aries sends the user back to after they approve access, such as `https://yourapp.com/oauth/callback`
   * **Scopes** - The permissions your app needs, such as account access, market data access, and order permissions
4. Click **Generate API key**.

What each field means:

* **Client Name** helps you recognize the app later in Aries.
* **Redirect URIs** tells Aries where to return the user after sign-in and approval. The value must exactly match the redirect URI you register in Client Center / Manage Account.
* **Scopes** tell Aries what data or actions your app wants permission to access.

For the examples on this page, use these accepted scopes:

* `user:information` - View user profile and personal details
* `account:information` - View account balances, positions, and account history
* `order:execution` - Place, modify, and cancel orders
* `order:information` - View order history and order status
* `position:information` - View current positions and holdings
* `market:information` - Access live and historical market data
* `calendar:information` - Access earnings, economic, and market schedule data
* `options:information` - Access options chains, Greeks, and expiration data
* `analytics:information` - View ratings, analytics, and market insights
* `market:supplemental` - Access news, company profiles, financials, filings, ETF data, and technical analysis

If your app does not need all of these permissions, request only the scopes you actually use. You can also review the full scope explanations in the [OAuth2 guide](/api-reference/oauth2/guide#available-scopes).

Once the API key is generated, you will see your **Client ID** and **Client Secret**.

<Warning>
  The `client_secret` is shown **only once**. Copy it immediately and store it in an environment variable or secrets manager. If you lose it, you'll need to regenerate it.
</Warning>

***

## Step 2: Request access for your app

Redirect users from your application to the Aries authorization page, where they sign in and grant your application permission to access the requested user scopes. Once authorization is complete, Aries redirects the user back to your application with an authorization code, which you will exchange for an access token in the next step.

The authorization URL looks like this:

```text theme={null}
https://app.aries.com/oauth2/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=user:information account:information order:execution order:information position:information market:information calendar:information options:information analytics:information market:supplemental&state=RANDOM_STRING
```

Replace `YOUR_CLIENT_ID`, `YOUR_REDIRECT_URI`, and `scope` in the URL above with your real values from Step 1.

What these values mean:

* `YOUR_CLIENT_ID` - The client ID Aries gave you when you created the app
* `YOUR_REDIRECT_URI` - The same callback URL you registered in Aries
* `scope` - The permissions your app is requesting
* `state` - A random value your app generates to help protect the sign-in flow

In most apps, you build this URL in code and then redirect the user to it automatically. If you want more detail about this step, see the [OAuth2 guide](/api-reference/oauth2/guide) or the [Authorization Code flow guide](/api-reference/oauth2/auth-code-flow).

<CodeGroup>
  ```javascript Node.js theme={null}
  const crypto = require('crypto');

  const state = crypto.randomBytes(32).toString('hex');

  const params = new URLSearchParams({
    response_type: 'code',
    client_id: 'YOUR_CLIENT_ID',
    redirect_uri: 'YOUR_REDIRECT_URI',
    scope: 'user:information account:information order:execution order:information position:information market:information calendar:information options:information analytics:information market:supplemental',
    state: state,
  });

  const authUrl = `https://app.aries.com/oauth2/authorize?${params}`;

  // res.redirect(authUrl);
  console.log('Authorization URL:', authUrl);
  ```

  ```python Python theme={null}
  import secrets
  from urllib.parse import urlencode

  state = secrets.token_hex(32)

  params = urlencode({
      'response_type': 'code',
      'client_id': 'YOUR_CLIENT_ID',
      'redirect_uri': 'YOUR_REDIRECT_URI',
      'scope': 'user:information account:information order:execution order:information position:information market:information calendar:information options:information analytics:information market:supplemental',
      'state': state,
  })

  auth_url = f'https://app.aries.com/oauth2/authorize?{params}'

  # return redirect(auth_url)
  print('Authorization URL:', auth_url)
  ```
</CodeGroup>

After the user approves, Aries redirects them back to your app with a `code` in the URL:

```text theme={null}
https://yourapp.com/oauth/callback?code=AUTHORIZATION_CODE&state=RANDOM_STRING
```

What this means:

* `code` - A short-lived authorization code that you exchange for tokens in Step 3
* `state` - The same random value you sent earlier; your app should verify that it matches

If the `state` value does not match, do not continue. Stop the sign-in flow and start again.

***

## Step 3: Get your access token

Now exchange the authorization code from Step 2 for tokens.

The most important token is the **access token**. You send this token with every protected API request. Aries uses it to confirm that your app is allowed to act on behalf of the signed-in user.

You also receive a **refresh token**. When the access token expires, the refresh token lets you request a new access token without asking the user to sign in again.

In simple terms:

* Step 2 gives you a temporary code
* Step 3 turns that code into usable tokens

<CodeGroup>
  ```javascript Node.js theme={null}
  async function exchangeCodeForToken(authCode) {
    const response = await fetch('https://api.aries.com/v1/oauth2/token', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        client_id: 'YOUR_CLIENT_ID',
        client_secret: 'YOUR_CLIENT_SECRET',
        grant_type: 'code',
        code: authCode,
        redirect_uri: 'YOUR_REDIRECT_URI',
      }),
    });

    if (!response.ok) throw new Error(`Token exchange failed: ${response.status}`);

    return await response.json();
  }

  const tokens = await exchangeCodeForToken('AUTHORIZATION_CODE');
  console.log(tokens);
  ```

  ```python Python theme={null}
  import requests

  def exchange_code_for_token(auth_code):
      response = requests.post(
          'https://api.aries.com/v1/oauth2/token',
          json={
              'client_id': 'YOUR_CLIENT_ID',
              'client_secret': 'YOUR_CLIENT_SECRET',
              'grant_type': 'code',
              'code': auth_code,
              'redirect_uri': 'YOUR_REDIRECT_URI',
          }
      )
      response.raise_for_status()
      return response.json()

  tokens = exchange_code_for_token('AUTHORIZATION_CODE')
  print(tokens)
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.aries.com/v1/oauth2/token \
    -H "Content-Type: application/json" \
    -d '{
      "client_id": "YOUR_CLIENT_ID",
      "client_secret": "YOUR_CLIENT_SECRET",
      "grant_type": "code",
      "code": "AUTHORIZATION_CODE",
      "redirect_uri": "YOUR_REDIRECT_URI"
    }'
  ```
</CodeGroup>

The response contains your tokens:

```json theme={null}
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...", // Use this for API requests
  "token_type": "Bearer",
  "expires_in": 3600,                                          // Seconds until expiry (1 hour)
  "refresh_token": "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0...", // Use to get a new access_token
  "scope": "user:information account:information order:execution order:information position:information market:information calendar:information options:information analytics:information market:supplemental" // Granted scopes
}
```

What each field means:

* `access_token` - Send this token with your API requests
* `token_type` - Usually `Bearer`
* `expires_in` - How long the access token remains valid
* `refresh_token` - Use this later to get a new access token
* `scope` - The permissions that were granted

Store the `access_token`, `refresh_token`, and expiry time in a secure place. You will need the access token for the next steps.

[-> Full reference: OAuth2 Token](/api-reference/oauth2/token)

***

## Step 4: Fetch the user's accounts

Now that you have an access token, you can make your first authenticated API call.

This step fetches the user's linked brokerage accounts. If your app will place trades, this step is important because you need the `trading_account_id` from the response.

You can think of this step as: "Show me which accounts this signed-in user can use."

<CodeGroup>
  ```javascript Node.js theme={null}
  async function getMyAccounts(accessToken) {
    const response = await fetch('https://api.aries.com/v2/users/me/accounts', {
      headers: { 'Authorization': `Bearer ${accessToken}` },
    });

    if (!response.ok) throw new Error(`Request failed: ${response.status}`);

    return await response.json();
  }

  const accounts = await getMyAccounts(tokens.access_token);
  console.log(accounts);
  ```

  ```python Python theme={null}
  import requests

  def get_my_accounts(access_token):
      response = requests.get(
          'https://api.aries.com/v2/users/me/accounts',
          headers={'Authorization': f'Bearer {access_token}'}
      )
      response.raise_for_status()
      return response.json()

  accounts = get_my_accounts(tokens['access_token'])
  print(accounts)
  ```

  ```bash cURL theme={null}
  curl https://api.aries.com/v2/users/me/accounts \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```
</CodeGroup>

Sample response:

```json theme={null}
{
  "accounts": [
    {
      "trading_account_id": "SIM6B86XEYOC",
      "broker_account_id": "",
      "status": "OPEN",
      "is_sim": true,
      "account_type": "",
      "account_class": ""
    },
    {
      "trading_account_id": "3AF05000",
      "broker_account_id": "3AF05000",
      "status": "OPEN",
      "is_sim": false,
      "account_type": "INDIVIDUAL",
      "account_class": "MARGIN"
    }
  ]
}
```

In the response, look for:

* `trading_account_id` - The account ID you use in trading requests
* `status` - Whether the account is open
* `is_sim` - Whether the account is simulated or real

If you want to place an order later, save the correct `trading_account_id` from this response.

[-> Full reference: User Accounts](/api-reference/accounts/user-accounts)

***

## Step 5: Search for a stock

Before you can request market data or place an order, you need the correct symbol for the stock or asset you want to use.

This step lets you search by company name or ticker symbol. In the example below, the search uses `AAPL`.

You will use the returned symbol in the next two steps.

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.aries.com/v1/marketdata/search?query=AAPL&limit=5', {
    headers: { 'Authorization': `Bearer ${tokens.access_token}` },
  });

  const results = await response.json();
  console.log(results);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.aries.com/v1/marketdata/search',
      params={'query': 'AAPL', 'limit': 5},
      headers={'Authorization': f'Bearer {tokens["access_token"]}'}
  )
  print(response.json())
  ```

  ```bash cURL theme={null}
  curl "https://api.aries.com/v1/marketdata/search?query=AAPL&limit=5" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```
</CodeGroup>

Sample response:

```json theme={null}
[
  {
    "symbol": "AAPL",
    "description": "Apple Inc.",
    "tag": "XNAS",
    "type": "stock"
  }
]
```

In the response, check:

* `symbol` - The ticker you will use in later requests
* `description` - The company or asset name
* `type` - The asset category, such as stock

Use the `symbol` value from the response in the quote and order steps that follow.

[-> Full reference: Search Symbols](/api-reference/marketdata/search)

***

## Step 6: Get a live quote

Now use the symbol to fetch current market data.

This step helps you see the latest available price information before placing an order. For example, you may want to review the last traded price, the current bid and ask, or the price change before deciding what order price to send.

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.aries.com/v1/chart/quotes?symbols=AAPL', {
    headers: { 'Authorization': `Bearer ${tokens.access_token}` },
  });

  const quotes = await response.json();
  console.log(quotes);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.aries.com/v1/chart/quotes',
      params={'symbols': 'AAPL'},
      headers={'Authorization': f'Bearer {tokens["access_token"]}'}
  )
  print(response.json())
  ```

  ```bash cURL theme={null}
  curl "https://api.aries.com/v1/chart/quotes?symbols=AAPL" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```
</CodeGroup>

Sample response:

```json theme={null}
{
  "d": [
    {
      "n": "Apple INC",
      "s": "AAPL",
      "v": {
        "ask": 130.92,
        "bid": 130.88,
        "ch": 2.15,
        "chp": 1.67,
        "description": "Apple Inc. Common Stock",
        "exchange": "NASDAQ",
        "high_price": 131.25,
        "low_price": 129.3,
        "lp": 130.89,
        "open_price": 129.5,
        "prev_close_price": 128.74,
        "short_name": "Apple Inc.",
        "volume": 45678900
      }
    }
  ],
  "s": "ok"
}
```

Useful fields in the response:

* `d` - The list of quote results
* `s` - The overall response status
* `n` - The instrument name
* `s` inside each quote item - The symbol
* `v.lp` - The latest traded price
* `v.bid` - The highest current buy price
* `v.ask` - The lowest current sell price
* `v.ch` and `v.chp` - The price change and percent change
* `v.volume` - The current trading volume

This information helps you decide whether to place an order and what price to use.

[-> Full reference: Quotes](/api-reference/chart/get-quotes)

***

## Step 7: Place an order

You now have everything needed to place an order:

* A valid access token from Step 3
* A `trading_account_id` from Step 4
* A symbol from Step 5

In this example, the request places a **limit buy** order for 1 share of `AAPL`.

What the main fields mean:

* `side: BUY` - You want to buy the stock
* `qty: "1"` - You want to buy 1 share
* `type: LIMIT` - You only want to buy at your limit price or a better price
* `price: "189.00"` - The highest price you are willing to pay
* `timeInForce: DAY` - The order stays active for the trading day unless it fills or is canceled

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.aries.com/v1/orders', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${tokens.access_token}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      tradingAccountId: '3AF05000',
      symbol: 'AAPL',
      side: 'BUY',
      type: 'LIMIT',
      qty: '1',
      price: '189.00',
      timeInForce: 'DAY',
    }),
  });

  const order = await response.json();
  console.log(order);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.aries.com/v1/orders',
      json={
          'tradingAccountId': '3AF05000',
          'symbol': 'AAPL',
          'side': 'BUY',
          'type': 'LIMIT',
          'qty': '1',
          'price': '189.00',
          'timeInForce': 'DAY',
      },
      headers={
          'Authorization': f'Bearer {tokens["access_token"]}',
          'Content-Type': 'application/json',
      }
  )
  print(response.json())
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.aries.com/v1/orders \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "tradingAccountId": "3AF05000",
      "symbol": "AAPL",
      "side": "BUY",
      "type": "LIMIT",
      "qty": "1",
      "price": "189.00",
      "timeInForce": "DAY"
    }'
  ```
</CodeGroup>

Sample response:

```json theme={null}
{
  "success": true,
  "clOrdId": "ORDER-20260115-001",
  "status": "NEW",
  "symbol": "AAPL",
  "side": "BUY",
  "qty": "1",
  "cumQty": "0",
  "leavesQty": "1",
  "avgPrice": "0",
  "text": "Order accepted",
  "ordRejReason": "",
  "transactTime": "2026-01-15T14:30:05Z"
}
```

After the request is accepted, Aries returns the order details. In this response:

* `success` shows whether Aries accepted the order request
* `clOrdId` is the client order ID
* `status` shows the current order state
* `qty` is the original order quantity
* `cumQty` is the quantity already filled
* `leavesQty` is the quantity still open
* `avgPrice` is the average filled price so far
* `text` contains a short status message

[-> Full reference: Place Order](/api-reference/orders/place-order)

***

## Next steps

<CardGroup cols={2}>
  <Card title="OAuth2 Guide" icon="shield-halved" href="/api-reference/oauth2/guide">
    Authorization Code and PKCE flows, scopes, security, and troubleshooting.
  </Card>

  <Card title="Accounts & Balances" icon="wallet" href="/api-reference/accounts/balance">
    Fetch account balances, positions, and order history.
  </Card>

  <Card title="Orders" icon="arrow-right-arrow-left" href="/api-reference/orders/place-order">
    Place, preview, update, and cancel orders.
  </Card>

  <Card title="Market Data" icon="chart-line" href="/api-reference/marketdata/search">
    Search symbols, get quotes, and stream real-time market data.
  </Card>
</CardGroup>
