Python (SDK)
from finance_dev import FinanceDev, models
import os
with FinanceDev(
security=models.Security(
client_id=os.getenv("FINANCEDEV_CLIENT_ID", ""),
client_secret=os.getenv("FINANCEDEV_CLIENT_SECRET", ""),
),
) as fd_client:
res = fd_client.watchlist.create_update_watchlist_by_account_id(account_id="<id>", request_body=[
{
"name": "Tech Stocks",
"symbols": [
"AAPL",
"GOOGL",
"MSFT",
"TSLA",
"NVDA",
],
},
{
"name": "Energy",
"symbols": [
"XOM",
"CVX",
"COP",
],
},
])
# Handle response
print(res)package hello.world;
import java.lang.Exception;
import java.util.List;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.components.WatchlistAccountRequest;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.CreateUpdateWatchlistByAccountIdResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CreateUpdateWatchlistByAccountIdResponse res = sdk.watchlist().createOrUpdate()
.accountId("<id>")
.body(List.of(
WatchlistAccountRequest.builder()
.name("Tech Stocks")
.symbols(List.of(
"AAPL",
"GOOGL",
"MSFT",
"TSLA",
"NVDA"))
.build(),
WatchlistAccountRequest.builder()
.name("Energy")
.symbols(List.of(
"XOM",
"CVX",
"COP"))
.build()))
.call();
if (res.watchlistAccountResponse().isPresent()) {
// handle response
}
}
}curl --request PUT \
--url https://api.tradearies.dev/v1/accounts/{account_id}/watchlist \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"name": "Tech Stocks",
"symbols": [
"AAPL",
"GOOGL",
"MSFT",
"TSLA",
"NVDA"
]
},
{
"name": "Energy",
"symbols": [
"XOM",
"CVX",
"COP"
]
}
]
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{name: 'Tech Stocks', symbols: ['AAPL', 'GOOGL', 'MSFT', 'TSLA', 'NVDA']},
{name: 'Energy', symbols: ['XOM', 'CVX', 'COP']}
])
};
fetch('https://api.tradearies.dev/v1/accounts/{account_id}/watchlist', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tradearies.dev/v1/accounts/{account_id}/watchlist",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'name' => 'Tech Stocks',
'symbols' => [
'AAPL',
'GOOGL',
'MSFT',
'TSLA',
'NVDA'
]
],
[
'name' => 'Energy',
'symbols' => [
'XOM',
'CVX',
'COP'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tradearies.dev/v1/accounts/{account_id}/watchlist"
payload := strings.NewReader("[\n {\n \"name\": \"Tech Stocks\",\n \"symbols\": [\n \"AAPL\",\n \"GOOGL\",\n \"MSFT\",\n \"TSLA\",\n \"NVDA\"\n ]\n },\n {\n \"name\": \"Energy\",\n \"symbols\": [\n \"XOM\",\n \"CVX\",\n \"COP\"\n ]\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/accounts/{account_id}/watchlist")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"name\": \"Tech Stocks\",\n \"symbols\": [\n \"AAPL\",\n \"GOOGL\",\n \"MSFT\",\n \"TSLA\",\n \"NVDA\"\n ]\n },\n {\n \"name\": \"Energy\",\n \"symbols\": [\n \"XOM\",\n \"CVX\",\n \"COP\"\n ]\n }\n]"
response = http.request(request)
puts response.read_body{
"account_id": "ACC123456",
"watchlist": [
{
"id": 1,
"name": "Tech Stocks",
"symbols": [
"AAPL",
"GOOGL",
"MSFT",
"TSLA",
"NVDA"
]
},
{
"id": 3,
"name": "Energy",
"symbols": [
"XOM",
"CVX",
"COP"
]
}
]
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}Watchlist
Create or Update Watchlist
Creates new watchlists or updates existing watchlists for a specific trading account. Allows users to organize stocks into named groups for monitoring. Each watchlist must have a unique name within the account and contains an array of stock symbols. If a watchlist with the same name already exists, it will be updated with the new symbol list.
PUT
/
v1
/
accounts
/
{account_id}
/
watchlist
Python (SDK)
from finance_dev import FinanceDev, models
import os
with FinanceDev(
security=models.Security(
client_id=os.getenv("FINANCEDEV_CLIENT_ID", ""),
client_secret=os.getenv("FINANCEDEV_CLIENT_SECRET", ""),
),
) as fd_client:
res = fd_client.watchlist.create_update_watchlist_by_account_id(account_id="<id>", request_body=[
{
"name": "Tech Stocks",
"symbols": [
"AAPL",
"GOOGL",
"MSFT",
"TSLA",
"NVDA",
],
},
{
"name": "Energy",
"symbols": [
"XOM",
"CVX",
"COP",
],
},
])
# Handle response
print(res)package hello.world;
import java.lang.Exception;
import java.util.List;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.components.WatchlistAccountRequest;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.CreateUpdateWatchlistByAccountIdResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
CreateUpdateWatchlistByAccountIdResponse res = sdk.watchlist().createOrUpdate()
.accountId("<id>")
.body(List.of(
WatchlistAccountRequest.builder()
.name("Tech Stocks")
.symbols(List.of(
"AAPL",
"GOOGL",
"MSFT",
"TSLA",
"NVDA"))
.build(),
WatchlistAccountRequest.builder()
.name("Energy")
.symbols(List.of(
"XOM",
"CVX",
"COP"))
.build()))
.call();
if (res.watchlistAccountResponse().isPresent()) {
// handle response
}
}
}curl --request PUT \
--url https://api.tradearies.dev/v1/accounts/{account_id}/watchlist \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"name": "Tech Stocks",
"symbols": [
"AAPL",
"GOOGL",
"MSFT",
"TSLA",
"NVDA"
]
},
{
"name": "Energy",
"symbols": [
"XOM",
"CVX",
"COP"
]
}
]
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{name: 'Tech Stocks', symbols: ['AAPL', 'GOOGL', 'MSFT', 'TSLA', 'NVDA']},
{name: 'Energy', symbols: ['XOM', 'CVX', 'COP']}
])
};
fetch('https://api.tradearies.dev/v1/accounts/{account_id}/watchlist', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tradearies.dev/v1/accounts/{account_id}/watchlist",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'name' => 'Tech Stocks',
'symbols' => [
'AAPL',
'GOOGL',
'MSFT',
'TSLA',
'NVDA'
]
],
[
'name' => 'Energy',
'symbols' => [
'XOM',
'CVX',
'COP'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tradearies.dev/v1/accounts/{account_id}/watchlist"
payload := strings.NewReader("[\n {\n \"name\": \"Tech Stocks\",\n \"symbols\": [\n \"AAPL\",\n \"GOOGL\",\n \"MSFT\",\n \"TSLA\",\n \"NVDA\"\n ]\n },\n {\n \"name\": \"Energy\",\n \"symbols\": [\n \"XOM\",\n \"CVX\",\n \"COP\"\n ]\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/accounts/{account_id}/watchlist")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"name\": \"Tech Stocks\",\n \"symbols\": [\n \"AAPL\",\n \"GOOGL\",\n \"MSFT\",\n \"TSLA\",\n \"NVDA\"\n ]\n },\n {\n \"name\": \"Energy\",\n \"symbols\": [\n \"XOM\",\n \"CVX\",\n \"COP\"\n ]\n }\n]"
response = http.request(request)
puts response.read_body{
"account_id": "ACC123456",
"watchlist": [
{
"id": 1,
"name": "Tech Stocks",
"symbols": [
"AAPL",
"GOOGL",
"MSFT",
"TSLA",
"NVDA"
]
},
{
"id": 3,
"name": "Energy",
"symbols": [
"XOM",
"CVX",
"COP"
]
}
]
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the trading account (must be a valid account owned by the authenticated user)
Body
application/json
Array of watchlist objects to create or update. Each watchlist must have a unique name and a list of stock symbols.
Was this page helpful?
⌘I