Setting Up Your Environment
Create an API key
Create an API key in the dashboard here, which you'll use to authenticate all requests to the API.
Store the key as a managed secret and pass it via an environment variable or your app's config.
AXION_API_KEY=<your_api_key_here>Install the SDK
Install the official SDK for your language. We'll also use it to load your API key from an environment variable.
pip install axionquant-sdk python-dotenvAuthenticate fetch requests
All API requests require your API key. Include it in one of the following ways - we recommend using the x-api-key header.
Never expose your API key in client-side code. Always make requests from a backend server or use environment variables.
// HTTP Header (Recommended)
const response = await fetch('https://api.axionquant.com/stocks/AAPL', {
headers: {
'x-api-key': process.env.AXION_API_KEY
}
});
// Authorization Bearer
const response = await fetch('https://api.axionquant.com/stocks/AAPL', {
headers: {
'Authorization': `Bearer ${process.env.AXION_API_KEY}`
}
});Make your first SDK request
Retrieve real-time price data for any stock ticker. This endpoint is available on all plans.
const { Axion } = require('@axionquant/sdk');
const client = new Axion(process.env.AXION_API_KEY);
const ticker = await client.stocks.ticker('AAPL');
console.log(ticker);Run the code
node example.jsYou should see a response like this:
{
"symbol": "AAPL",
"price": 175.34,
"change": 1.25,
"changePercent": 0.72,
"volume": 45678900,
"marketCap": 2750000000000,
"timestamp": "2024-01-15T14:30:00Z"
}Next steps
Market Data
Real-time and historical prices, quotes, equities, ETFs, indices, and market metrics.
Alternative Data
ESG metrics, sentiment signals, supply chain intelligence, and other non-traditional datasets.
Fundamentals
Financial statements, earnings, revenue, balance sheets, cash flow, and company metrics.
Macros & Signals
Economic indicators, macroeconomic data, quantitative signals, and market regime analytics.
ETFs API
The ETFs API provides comprehensive data on Exchange-Traded Funds including fund information, sector weights, geographic exposure, holdings, and fund-of-funds exposure analysis. This data is essential for ETF research, portfolio construction, and investment analysis.
/etfs/:ticker/holdingsRetrieves the current top holdings of an ETF with detailed position information including shares held, market value, and percentage weights. Critical for analyzing concentration risk and understanding the ETF's underlying exposures.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticker | string | Required | ETF ticker symbol (e.g., "SPY", "QQQ", "VTI") |
Examples:
https://api.axionquant.com/etfs/QQQ/holdingshttps://api.axionquant.com/etfs/SPY/holdingsResponse Fields
ticker string
Holding company ticker
name string
Holding company name
weight string
Formatted weight percentage
shares number
Number of shares held
marketValue number
Total market value in USD
rawWeight number
Raw weight as decimal (0.0-1.0)
Top Holdings
Request
1from axion import Axion
2client = Axion(api_key='axn_123')
3
4holdings = client.etfs.holdings('SPY')
5print(holdings)Response
[
{
"ticker": "NVDA",
"name": "NVIDIA Corporation",
"weight": "7.17%",
"shares": 305156465,
"marketValue": 44519276678.85,
"rawWeight": 0.0716544211188534
},
{
"ticker": "AAPL",
"name": "Apple Inc.",
"weight": "6.95%",
"shares": 188603226,
"marketValue": 43190138754,
"rawWeight": 0.0695151543630329
},
{
"ticker": "MSFT",
"name": "Microsoft Corporation",
"weight": "6.17%",
"shares": 92204348,
"marketValue": 38309984550.52,
"rawWeight": 0.0616604754349895
}
]/etfs/:ticker/holdings/allRetrieves the complete list of all holdings for an ETF with weight percentages and the last updated date. Unlike the top holdings endpoint, this provides the full portfolio composition including smaller positions.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticker | string | Required | ETF ticker symbol (e.g., "SPY", "QQQ", "VTI") |
Examples:
https://api.axionquant.com/etfs/QQQ/holdings/allhttps://api.axionquant.com/etfs/SPY/holdings/allResponse Fields
name string
Holding company name
ticker string
Holding company ticker
weight string
Formatted weight percentage
rawWeight number
Raw weight as decimal (0.0-1.0)
since string
Date the holding data was last updated
All Holdings
Request
1from axion import Axion
2client = Axion(api_key='axn_123')
3
4holdings = client.etfs.holdings_all('SPY')
5print(holdings)Response
[
{
"name": "NVIDIA Corporation",
"ticker": "NVDA",
"weight": "7.17%",
"rawWeight": 0.0716544211188534,
"since": "2024-03-15"
},
{
"name": "Apple Inc.",
"ticker": "AAPL",
"weight": "6.95%",
"rawWeight": 0.0695151543630329,
"since": "2024-03-15"
},
{
"name": "Microsoft Corporation",
"ticker": "MSFT",
"weight": "6.17%",
"rawWeight": 0.0616604754349895,
"since": "2024-03-15"
}
]/etfs/:ticker/weightsRetrieves the detailed sector breakdown and geographic exposure of an ETF. Provides both formatted percentages and raw decimal weights for precise analysis. Essential for understanding concentration risk and geographic diversification.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticker | string | Required | ETF ticker symbol (e.g., "SPY", "QQQ", "VTI") |
Examples:
https://api.axionquant.com/etfs/VTI/weightshttps://api.axionquant.com/etfs/QQQ/weightsResponse Fields
sector array
Array of sector allocations
name string
Sector name (e.g., "Technology Services")
weight string
Formatted weight percentage (e.g., "21.08%")
rawWeight number
Raw weight as decimal (0.0-1.0)
regions array
Array of geographic exposures
name string
Country or region name
weight string
Formatted weight percentage or "--" for negligible
benchmarkWeight string
Benchmark weight percentage
rawWeight number|string
Raw weight as decimal or "--"
Sector & Region Weights
Request
1from axion import Axion
2client = Axion(api_key='axn_123')
3
4weights = client.etfs.weights('SPY')
5print(weights)Response
{
"sector": [
{
"name": "Technology Services",
"weight": "21.08%",
"rawWeight": 0.21079285342758
},
{
"name": "Commercial Services",
"weight": "2.90%",
"rawWeight": 0.0289666913939312
}
],
"regions": [
{
"name": "United States",
"weight": "100.00%",
"benchmarkWeight": "99.89%",
"rawWeight": 1
},
{
"name": "Canada",
"weight": "--",
"benchmarkWeight": "0.11%",
"rawWeight": "--"
}
]
}