Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any free APIs for retrieving the S&P 500's component symbols? [closed]

Some sort of free REST API would be ideal, but in general is there any free API or web service or CSV file (that's not behind a password prompt) or anything out there that one can query to get the current list of the S&P 500 index constituents?

I've looked on S&P's site itself (http://www.standardandpoors.com), through Yahoo Finance's API, and Markit on demand (http://dev.markitondemand.com/), but have not been able to find anything yet.

like image 703
user1886282 Avatar asked Dec 07 '12 18:12

user1886282


People also ask

Is there any free API?

Free Website APIsGoogle offers a wide range of open APIs that make it easier to work with Google's many products. From Blogger, to AMP, to AdSense, to Maps, many Google services can be integrated via a specialized API.

What are the 3 types of APIs?

There are also three common types of API architectures: REST, a collection of guidelines for lightweight, scalable web APIs. SOAP, a stricter protocol for more secure APIs. RPC, a protocol for invoking processes that can be written with XML (XML-RPC) or JSON (JSON-RPC).


1 Answers

Also had a similar need. You could use Wikipedia API or parse html to get the list of symbols in S&P 500 http://en.wikipedia.org/wiki/List_of_S%26P_500_companies

You can now install and use module by

pip install finsymbols

I currently obtain the list of symbols via Wikipedia. It is not rest but can be easily made into a rest API. It is written in python

>>import sys
>>sys.path.append('/home/skillachie/Desktop/')
>>import finsymbols

sp500 = finsymbols.get_sp500_symbols()

pprint.pprint(sp500)

{'company': u'Xcel Energy Inc',
  'headquaters': u'Minneapolis, Minnesota',
  'industry': u'Multi-Utilities & Unregulated Power',
  'sector': u'Utilities',
  'symbol': u'XEL'},
 {'company': u'Xerox Corp.',
  'headquaters': u'Norwalk, Connecticut',
  'industry': u'IT Consulting & Services',
  'sector': u'Information Technology',
  'symbol': u'XRX'},
 {'company': u'Xilinx Inc',
  'headquaters': u'San Jose, California',
  'industry': u'Semiconductors',
  'sector': u'Information Technology',
  'symbol': u'XLNX'},
 {'company': u'XL Capital',
  'headquaters': u'Hamilton, Bermuda',
  'industry': u'Property & Casualty Insurance',
  'sector': u'Financials',
  'symbol': u'XL'},

If interested you can get more information here http://skillachie.github.io/finsymbols/

like image 115
Skillachie Avatar answered Nov 15 '22 08:11

Skillachie