<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Google &#8211; The Financial Hacker</title>
	<atom:link href="https://financial-hacker.com/tag/google/feed/" rel="self" type="application/rss+xml" />
	<link>https://financial-hacker.com</link>
	<description>A new view on algorithmic trading</description>
	<lastBuildDate>Thu, 04 Jan 2018 12:24:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://financial-hacker.com/wp-content/uploads/2017/07/cropped-mask-32x32.jpg</url>
	<title>Google &#8211; The Financial Hacker</title>
	<link>https://financial-hacker.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Bye Yahoo, and thanks for all the fish</title>
		<link>https://financial-hacker.com/bye-yahoo-and-thank-you-for-the-fish/</link>
					<comments>https://financial-hacker.com/bye-yahoo-and-thank-you-for-the-fish/#comments</comments>
		
		<dc:creator><![CDATA[jcl]]></dc:creator>
		<pubDate>Fri, 19 May 2017 09:13:35 +0000</pubDate>
				<category><![CDATA[No Math]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Yahoo]]></category>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=2443</guid>

					<description><![CDATA[Just a quick post in the light of a very recent event. Users of financial functions of R, MatLab, Python, or Zorro got a bad surprise in the last days. Scripts and programs based on historical price data suddenly didn&#8217;t work anymore. And our favorite free historical price data provider, Yahoo, now responds on any &#8230; <a href="https://financial-hacker.com/bye-yahoo-and-thank-you-for-the-fish/" class="more-link">Continue reading<span class="screen-reader-text"> "Bye Yahoo, and thanks for all the fish"</span></a>]]></description>
										<content:encoded><![CDATA[<p>Just a quick post in the light of a very recent event. Users of financial functions of R, MatLab, Python, or Zorro got a bad surprise in the last days. Scripts and programs based on historical price data suddenly didn&#8217;t work anymore. And our favorite free historical price data provider, <a href="https://finance.yahoo.com" target="_blank" rel="noopener noreferrer">Yahoo</a>, now responds on any access to their API in this way:</p>
<p><span id="more-2443"></span></p>
<p><a href="http://www.financial-hacker.com/wp-content/uploads/2017/05/yahoo.png"><img fetchpriority="high" decoding="async" class="wp-image-2444 size-full aligncenter" src="http://www.financial-hacker.com/wp-content/uploads/2017/05/yahoo.png" alt="" width="441" height="353" srcset="https://financial-hacker.com/wp-content/uploads/2017/05/yahoo.png 441w, https://financial-hacker.com/wp-content/uploads/2017/05/yahoo-300x240.png 300w" sizes="(max-width: 441px) 85vw, 441px" /></a></p>
<p>No, they won&#8217;t be right back. Their engineers went fishing and, from what I hear, won&#8217;t be working on the issue anytime soon. The Yahoo Finance API is dead. Without prior announcement, Yahoo has abandoned their only remaining service that was clearly ahead of the competition.</p>
<p>Many scripts that I&#8217;ve posted on this blog use Yahoo for downloading price data. So here&#8217;s a quick workaround. Before running the Yahoo based script, run this one:</p>
<pre class="prettyprint">void main()
{
	string MyAsset;
	while(MyAsset = loop("SPY","TNT","XIV","GLD","AAPL","YHOO")) // ... enter your assets here 
	{
		string URL = strf("https://finance.google.com/finance/historical?q=%s&amp;startdate=01-Jan-2000&amp;output=csv",MyAsset);
		string Content = http_transfer(URL,0);
		if(!Content) continue;
		file_write("History\\history.csv",Content,0);
		dataNew(1,0,7);
		if(!dataParse(1,"%d-%b-%y,f3,f1,f2,f4,f6","History\\history.csv"))
			continue;
		printf(" %s",MyAsset);
		dataSave(1,strf("History\\%s.t6",MyAsset));
	}
}</pre>
<p>This script downloads the data with the Google API. When you afterwards start the script with the Yahoo download, it will detect that the data is already there, and not access the Yahoo API.</p>
<p>Why haven&#8217;t I used the Google API already in the first place? Their data quality is not as good (many gaps and outliers), and it&#8217;s not dividend adjusted. So the results will be a bit different than results with Yahoo data. And then there&#8217;s also this ominous message:</p>
<p><a href="http://www.financial-hacker.com/wp-content/uploads/2017/05/google.png"><img decoding="async" class="wp-image-2445 size-full aligncenter" src="http://www.financial-hacker.com/wp-content/uploads/2017/05/google.png" alt="" width="623" height="167" srcset="https://financial-hacker.com/wp-content/uploads/2017/05/google.png 623w, https://financial-hacker.com/wp-content/uploads/2017/05/google-300x80.png 300w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px" /></a></p>
<p>Like the Yahoo message, this one is also wrong, but in a more positive sense. The Google Finance API is still available and was so for years, but nobody knows how long it will remain. For the moment, the above script will do, but it&#8217;s only a temporary solution. Free stock data can alternatively be downloaded from Quandl with a similar script, but for ETFs they want 50 bucks per month (I hope they didn&#8217;t bribe Yahoo and Google into abandoning their APIs!).</p>
<p>I&#8217;ve added the above script to the 2017 repository, in order to make all the Yahoo accessing scripts work again, although with slightly different results. You&#8217;ll need the current Zorro version 1.58 or above. And if you know a free and reliable API for ETF EOD history, please post a comment!</p>
<hr />
<p><strong>Addendum (June 2017):</strong> Readers mentioned AlphaVantage (<a href="http://www.alphavantage.co/" target="_blank" rel="noopener">www.alphavantage.co</a>) and Stooq (<a href="https://stooq.com/" target="_blank" rel="noopener">www.stooq.com</a>) as free alternatives to Yahoo. And indeed, they provide also dividend and split adjusted data. From what I&#8217;ve seen, their data has better quality than Google&#8217;s. AlphaVantage also includes the unadjusted prices. Only problem that I&#8217;ve found is that some price histories don&#8217;t go further back than 5 years. Downloading price data from AlphaVantage, Stooq, and some other sources was implemented in the current Zorro version. A list of finance API access points for EOD data:</p>
<table>
<tbody>
<tr>
<td style="width: 18%;"><strong>Google Finance</strong></td>
<td><code>https://finance.google.com/finance/historical?q=AAPL&amp;<br />
startdate=01-Jan-2010&amp;output=csv</code></td>
</tr>
<tr>
<td><strong>Quandl</strong></td>
<td><code>https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?<br />
start_date=2010-01-01&amp;api_key=...</code></td>
</tr>
<tr>
<td><strong>Stooq</strong></td>
<td><code>https://stooq.com/q/d/l/?s=AAPL.US&amp;i=d</code></td>
</tr>
<tr>
<td><strong>Alpha Vantage</strong></td>
<td>
<code>https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED<br />
</code><code>&amp;symbol=AAPL&amp;outputsize=full&amp;apikey=...&amp;datatype=csv</code>
</td>
</tr>
<tr>
<td><strong>BarChart</strong></td>
<td><code>https://marketdata.websol.barchart.com/getHistory.csv?apikey=...&amp;symbol=AAPL&amp;<br />
startDate=20100101&amp;splits=true&amp;dividends=true&amp;volume=sum&amp;nearby=1&amp;jerq=true</code></td>
</tr>
<tr>
<td><strong>IEX</strong></td>
<td><code>https://api.iextrading.com/1.0/stock/aapl/chart/5y?format=csv</code></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://financial-hacker.com/bye-yahoo-and-thank-you-for-the-fish/feed/</wfw:commentRss>
			<slash:comments>136</slash:comments>
		
		
			</item>
	</channel>
</rss>
