Benchmarks

Retrieves a list of available benchmarks which can be utilized for performance comparison purposes.


Endpoint

GET/data/v1/benchmarks

Parameters

api_key string required
Your authentication key needed to make requests.


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/benchmarks?api_key=API_KEY"
Python
import requests

url = "https://sensaai.com/data/v1/benchmarks/"
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/benchmarks/";
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 available performance benchmarks.

[
  {
    "id": "1",
    "ticker": "^SP500TR",
    "name": "S&P 500 TR",
    "country": "US",
    "description": "Total return of the S&P 500 index."
  },
  {
    "id": "2",
    "ticker": "^RUTTR",
    "name": "Russell 2000 TR",
    "country": "US",
    "description": "Total return of the Rusell 2000 Index."
  },
    ...more benchmarks
]