Watchlist Items

Retrieves list of stocks in a watchlist.


Endpoint

GET/data/v1/watchlist_items/:id

Parameters

api_key string required
Your authentication key needed to make requests.


search string
Limit to stocks where ticker or name contain search string.


order_by string:badgedefault: ticker
Defines what rating is used to rank stocks in response. - in front denotes ranking in descending order (e.g. -total_rating returns stock with highest total_rating first). Other options are ticker or name. Default is ticker.


limit int default: 50 max: 200
A limit on the number of objects to be returned. Limit can range between 1 and 200, and the default is 50.


offset int default: 0
Use in combination with limit. If e.g. offset set to 50 with limit set to 100 object 51 to 150 will be returned. If offset set without limit it will default to limit of 50 so setting e.g. offset to 50 will return object 51 to 100.


format string default: json
Defines return format of response. Options are json or csv. Default is json.

Example Request

cURL
curl -X GET "https://sensaai.com/data/v1/watchlist_items/70?api_key=API_KEY"
Python
import requests

url = "https://sensaai.com/data/v1/watchlist_items/70"
params = {
 "api_key": "API_KEY"  # Replace 'API_KEY' with your actual API key
}

response = requests.get(url, params=params)

if response.status_code == 200:
 data = response.json()
 print(data)
else:
 print(f"Request failed with status code {response.status_code}")
JavaScript
const https = require('https');

const url = "https://sensaai.com/data/v1/watchlist_items/70/";
const params = {
api_key: "API_KEY', // Replace 'API_KEY' with your actual API key
};

const requestUrl = new URL(url);
requestUrl.search = new URLSearchParams(params);

https.get(requestUrl, (response) => {
let data = '';

response.on('data', (chunk) => {
  data += chunk;
});

response.on('end', () => {
  if (response.statusCode === 200) {
    console.log(data);
  } else {
    console.error(`Request failed with status code ${response.statusCode}`);
  }
});
});

Response

Returns a list of portfolio holdings if a valid portfolio ID was provided. Returns an error otherwise.

[
  {
    "date": "2020-10-02",
    "stock": {
      "id": "1878",
      "ticker": "MMM",
      "name": "3M CO",
      "marketCap": "48222534000",
      "sector": "Industrials",
      "industry": "Industrial Products"
    },
    "totalRating": "6.6113",
    "returnRating": "5.9848",
    "growthRating": "7.6127",
    "riskRating": "5.9279",
    "valuationRating": "6.2553",
    "technicalRating": "6.5306",
    "macroRating": "5.0024"
  },
  {
    "date": "2020-10-02",
    "stock": {
      "id": "1923",
      "ticker": "MSFT",
      "name": "MICROSOFT CORP",
      "marketCap": "2463032880000",
      "sector": "Technology",
      "industry": "Application Software"
    },
    "totalRating": "9.7152",
    "returnRating": "9.7485",
    "growthRating": "9.8007",
    "riskRating": "8.6901",
    "valuationRating": "8.4480",
    "technicalRating": "9.7769",
    "macroRating": "5.0024"
  },
    ...more watchlist items
]