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
- tickeroptional- Stock ticker symbol (e.g. - AAPL).
- nameoptional- Company name (full or partial match). 
- sectoroptional- Company sector (e.g. - Information Technology).
- min_date_addedoptional- Earliest date company was added to the S&P 500 (format: - YYYY-MM-DD).
- max_date_addedoptional- Latest date company was added to the S&P 500 (format: - YYYY-MM-DD).
Headers
- X-Api-Keyrequired- API Key associated with your account. 
Response
- ticker- Stock ticker symbol. 
- company_name- Company name. 
- sector- Company sector. 
- date_added- Date the company was added to the S&P 500 (format: - YYYY-MM-DD).
- cik- Company CIK number. 
- sub_industry- Company sub-industry. 
- headquarters- Company 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.