S&P 500 API
The S&P 500 API provides information about companies in the S&P 500 index, including ticker, name, sector, and the date the company was added to the index.
Checking API status...
/v1/sp500 GET
https://api.api-ninjas.com/v1/sp500
Returns a list of S&P 500 companies. All parameters are optional. If no parameters are provided, data for all companies will be returned (may be slow in poor network conditions).
Parameters
tickeroptionalStock ticker symbol (e.g.
AAPL).nameoptionalCompany name (full or partial match).
sectoroptionalCompany sector (e.g.
Information Technology).min_date_addedoptionalEarliest date company was added to the S&P 500 (format:
YYYY-MM-DD).max_date_addedoptionalLatest date company was added to the S&P 500 (format:
YYYY-MM-DD).
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
tickerStock ticker symbol.
company_nameCompany name.
sectorCompany sector.
date_addedDate the company was added to the S&P 500 (format:
YYYY-MM-DD).cikCompany CIK number.
sub_industryCompany sub-industry.
headquartersCompany headquarters location.
Sample Request Live Demo!
https://api.api-ninjas.com/v1/sp500Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[
{
"ticker": "NVDA",
"company_name": "Nvidia",
"sector": "Information Technology",
"date_added": "2001-11-30",
"cik": "0001045810",
"sub_industry": "Semiconductors",
"headquarters": "Santa Clara, California"
},
{
"ticker": "JNJ",
"company_name": "Johnson & Johnson",
"sector": "Health Care",
"date_added": "1973-06-30",
"cik": "0000200406",
"sub_industry": "Pharmaceuticals",
"headquarters": "New Brunswick, New Jersey"
},
...
]Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/sp500" \
-H "X-Api-Key: YOUR_API_KEY"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.