The S&P 500 stock market index API


OVERVIEW
It returns all S&P 500 constituents. It's one of the most important US stock exchanges, where companies like Adobe and Apple are listed.

On this endpoint page, you can also find endpoint covering Nasdaq 100 companies.

Query String Parameters
datatype : csv

The S&P 500 stock market index API


OVERVIEW
It returns all S&P 500 constituents. It's one of the most important US stock exchanges, where companies like Adobe and Apple are listed.

On this endpoint page, you can also find endpoint covering Nasdaq 100 companies.

Query String Parameters
datatype : csv

The S&P 500 stock market index

https://financialmodelingprep.com/api/v3/sp500_constituent?apikey=YOUR_API_KEY

curl https://financialmodelingprep.com/api/v3/sp500_constituent?apikey=YOUR_API_KEY
[ 
    {
      "symbol" : "MMM",
      "name" : "3M Company",
      "sector" : "Industrials",
      "subSector" : "Industrial Conglomerates",
      "headQuarter" : "St. Paul, Minnesota",
      "dateFirstAdded" : "1976-08-09",
      "cik" : "0000066740",
      "founded" : "1902"
    }, 
    {
      "symbol" : "ABT",
      "name" : "Abbott Laboratories",
      "sector" : "Health Care",
      "subSector" : "Health Care Equipment",
      "headQuarter" : "North Chicago, Illinois",
      "dateFirstAdded" : "1964-03-31",
      "cik" : "0000001800",
      "founded" : "1888"
    }, 
    {
      "symbol" : "ABBV",
      "name" : "AbbVie Inc.",
      "sector" : "Health Care",
      "subSector" : "Pharmaceuticals",
      "headQuarter" : "North Chicago, Illinois",
      "dateFirstAdded" : "2012-12-31",
      "cik" : "0001551152",
      "founded" : "2013 (1888)"
    }, ...
]

THE_S&P_500_STOCK_MARKET_INDEX_WITH JAVA


URL url = new URL("https://financialmodelingprep.com/api/v3/sp500_constituent?apikey=YOUR_API_KEY");

try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"))) {
    for (String line; (line = reader.readLine()) != null;) {
    System.out.println(line);
  }
}
Resource List :