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)
Step 1: Register your app
Before your app can talk to Aries, you need to register it. This gives you the credentials your app will use to identify itself.
Log into Aries and go to Client Center > API tab.
Click Create New Client (or Add OAuth2 Client ).
Fill in the fields:
Client Name — a descriptive name for your app (e.g., “My Trading App”)
Redirect URIs — the URL Aries will send the user back to after authorization (e.g., https://yourapp.com/oauth/callback)
Scopes — select the permissions your app needs (e.g., user:information, account:information)
Click Generate API key .
Once api key generated, you’ll see your Client ID and Client Secret .
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.
Step 2: Request access for your app
Send users to Aries to sign in and approve. Aries then redirects them back to your app with a code you’ll use in the next step.
The authorization URL looks like this:
https://app.aries.com/oauth2/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=user:information account:information&state=RANDOM_STRING
Replace YOUR_CLIENT_ID, YOUR_REDIRECT_URI, and scope in the URL above with your actual values from Step 1.
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' ,
state: state ,
});
const authUrl = `https://app.aries.com/oauth2/authorize? ${ params } ` ;
// res.redirect(authUrl);
console . log ( 'Authorization URL:' , authUrl );
After the user approves, they’re sent back to your app with a code in the URL:
https://yourapp.com/oauth/callback?code=AUTHORIZATION_CODE&state=RANDOM_STRING
Step 3: Get your access token
Use the code from the previous step to get an access token. The access token is what you’ll include with every API request to prove your app is authorized. You’ll also get a refresh token, which lets you get a new access token later without asking the user to log in again.
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 );
The response contains your tokens:
{
"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" // Granted scopes
}
→ Full reference: OAuth2 Token
Step 4: Fetch the user’s profile
Include the access token in your request header to identify who’s calling the API. This example fetches the logged-in user’s profile:
async function getMyProfile ( accessToken ) {
const response = await fetch ( 'https://api.aries.com/v1/users/me' , {
headers: { 'Authorization' : `Bearer ${ accessToken } ` },
});
if ( ! response . ok ) throw new Error ( `Request failed: ${ response . status } ` );
return await response . json ();
}
const profile = await getMyProfile ( tokens . access_token );
console . log ( profile );
Sample response:
{
"id" : "usr_01abc123" ,
"email" : "jane@example.com" ,
"firstName" : "Jane" ,
"lastName" : "Doe" ,
"createdAt" : "2024-01-15T10:30:00Z"
}
Step 5: Fetch the user’s accounts
Now pull the user’s linked brokerage accounts:
async function getMyAccounts ( accessToken ) {
const response = await fetch ( 'https://api.aries.com/v1/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 );
Sample response:
[
{
"id" : "acc_01xyz789" ,
"accountNumber" : "12345678" ,
"type" : "INDIVIDUAL" ,
"status" : "ACTIVE"
}
]
→ Full reference: User Accounts
Step 6: Search for a stock
Search for a symbol by name or ticker. You’ll use the symbol returned here in the next two steps.
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 );
Sample response:
[
{
"symbol" : "AAPL" ,
"description" : "Apple Inc." ,
"tag" : "technology" ,
"type" : "stock"
}
]
→ Full reference: Search Symbols
Step 7: Get a live quote
Fetch the current price and market data for a symbol.
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 );
Sample response:
{
"AAPL" : {
"symbol" : "AAPL" ,
"last" : 189.25 ,
"bid" : 189.20 ,
"ask" : 189.30 ,
"volume" : 54321000 ,
"change" : 1.75 ,
"changePercent" : 0.93
}
}
→ Full reference: Quotes
Step 8: Place an order
Submit a buy or sell order using the account ID from Step 5 and the symbol from Step 6.
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 ({
accountId: 'acc_01xyz789' ,
symbol: 'AAPL' ,
side: 'BUY' ,
quantity: 1 ,
orderType: 'LIMIT' ,
limitPrice: 189.00 ,
timeInForce: 'DAY' ,
}),
});
const order = await response . json ();
console . log ( order );
Sample response:
{
"id" : "ord_01abc456" ,
"symbol" : "AAPL" ,
"side" : "BUY" ,
"quantity" : 1 ,
"orderType" : "LIMIT" ,
"limitPrice" : 189.00 ,
"status" : "PENDING" ,
"createdAt" : "2024-01-15T14:30:00Z"
}
→ Full reference: Place Order
Next steps
OAuth2 Guide Authorization Code and PKCE flows, scopes, security, and troubleshooting.
Accounts & Balances Fetch account balances, positions, and order history.
Orders Place, preview, update, and cancel orders.
Market Data Search symbols, get quotes, and stream real-time market data.