Exploring the MarketStack data source
MarketStack offers an extensive database of real-time, intra-day, and historical market data across major global stock exchanges. It offers free access for up to 1,000 monthly API requests.
While there is no official MarketStack Python library, the REST JSON API provides comfortable access to all its data in Python.
Let's download the adjusted close data for Apple:
import requests params = { 'access_key': 'XXXXX' } api_result = \ requests.get('http://api.marketstack.com/v1/tickers/aapl/eod', params) api_response = api_result.json() print(f"Symbol = {api_response['data']['symbol']}") for eod in api_response['data']['eod']: print(f"{eod['date']}: {eod['adj_close']}") Symbol = AAPL 2020-12-28T00:00:00+0000: 136.69 2020-12-24T00:00:00+0000: 131.97 2020-12-23T00:00:00+0000: 130.96 2020-12-22T00...