The ETF API provides detailed information about Exchange-Traded Funds including their holdings, expense ratios, assets under management, and other key metrics.
https://api.api-ninjas.com/v1/etf
Returns comprehensive information about any ETF by its ticker. For live pricing data, please use the Stock Price API with the same ticker.
ticker
requiredETF ticker symbol (e.g., SPY
, QQQ
, VTI
).
X-Api-Key
requiredAPI Key associated with your account.
etf_ticker
ETF ticker symbol.
holdings
Array of top holdings in the ETF, each with ticker, name, and percentage weight. Free users only get access to the first 3 holdings. premium users get access to all holdings.
https://api.api-ninjas.com/v1/etf?ticker=SPY
Headers
X-Api-Key
Log in or sign up to get your API Key
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
"etf_ticker": "SPY",
"holdings": [
{
"ticker": "AAPL",
"num_shares": 342567800,
"weight": 0.0723,
"value": 66216187320,
"last_updated": 1745406283
},
{
"ticker": "MSFT",
"num_shares": 169872300,
"weight": 0.0701,
"value": 60954995760,
"last_updated": 1745406283
},
{
"ticker": "AMZN",
"num_shares": 212456700,
"weight": 0.0432,
"value": 37479880200,
"last_updated": 1745406283
},
"..."
]
}
1
2
3
4
5
6
7
8
import requests
ticker = 'SPY'
api_url = 'https://api.api-ninjas.com/v1/etf?ticker={}'.format(ticker)
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
print(response.text)
else:
print("Error:", response.status_code, response.text)
If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.