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.
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.
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).
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With