Python pandas Google finance international stocks - looking for way to get international stocks price history with Google
Question: This works: domestic stocks

    
    
    gticker='NYSE:IBM'
    import pandas.io.data as web
    dfg = web.DataReader(gticker, 'google', '2013/1/1', '2014/3/1')
    

This does not: international stocks

    
    
    gticker='HKG:0700'
    import pandas.io.data as web
    dfg = web.DataReader(gticker, 'google', '2013/1/1', '2014/3/1')
    

even though for both, you can go to the "Historical prices" link and see
historical data.

Any suggestions?


Answer: The DataReader for google wants to download a csv file. So for 'goog' it
requests the following URL which fetches the csv file:

[http://www.google.com/finance/historical?q=GOOG&startdate=Jan+1%2C+2013&enddate=Mar+1%2C+2014&output=csv](http://www.google.com/finance/historical?q=GOOG&startdate=Jan+1%2C+2013&enddate=Mar+1%2C+2014&output=csv)

This is true for all the domestic stocks (like IBM). But for 'HKG:0700' it
requests:

[http://www.google.com/finance/historical?q=HKG%3A0700&startdate=Jan+01%2C+2014&enddate=Mar+01%2C+2014&output=csv](http://www.google.com/finance/historical?q=HKG%3A0700&startdate=Jan+01%2C+2014&enddate=Mar+01%2C+2014&output=csv)

and that produces a 'The requested URL was not found on this server.' error.
You can look at the historical data at:

[http://www.google.com/finance/historical?q=HKG%3A0700&startdate=Jan+01%2C+2014&enddate=Mar+01%2C+2014](http://www.google.com/finance/historical?q=HKG%3A0700&startdate=Jan+01%2C+2014&enddate=Mar+01%2C+2014)

But it doesn't look like you can get a csv file.

You see what it is doing pandas/io/data.py when it creates the URL:

    
    
    # www.google.com/finance/historical?q=GOOG&startdate=Jun+9%2C+2011&enddate=Jun+8%2C+2013&output=csv
    url = "%s%s" % (_HISTORICAL_GOOGLE_URL,
                    urlencode({"q": sym,
                               "startdate": start.strftime('%b %d, ' '%Y'),
                               "enddate": end.strftime('%b %d, %Y'),
                               "output": "csv"}))
    

