title: Retrieve historical stock valuation data with python
body: <p>I am looking to retrieve historical data like P/E ratio, earnings, book value etc as well as stock price. I'd like to go through a whole bunch of stocks programmatically or to possibly select historical stocks based on valuation rules.</p>
  
  <p>I found a few python packages to download historical stock prices from Yahoo like <a href="https://pypi.python.org/pypi/yahoo-finance" rel="nofollow">yahoo-finance</a> and also this guide to downloading historical prices with <a href="https://greenido.wordpress.com/2009/12/22/yahoo-finance-hidden-api/" rel="nofollow">the browser</a>. But I could not find anything to download historical valuation data.</p>
  
  <p>I am aware of <a href="https://en.wikipedia.org/wiki/Survivorship_bias" rel="nofollow">Survivorship Bias</a> problem with the stocks that affects these free services but I can't afford a paid one right now.</p>