The Yahoo Finance API interface found online can basically retrieve stock, index, and foreign exchange data from various markets around the world. However, it seems that there is no data available for Japan domestically. However, after investigation, it was found that there are other ways to obtain the data, and the methods will be included in a subsequent blog post.
-
Obtaining real-time data
http://finance.yahoo.com/d/quotes.csv?s=stock+name&f=data+column+options
s - represents the stock name, multiple stocks are separated by a plus sign, such as "XOM+BBDb.TO+JNJ+MSFT", which lists the stocks of four companies: XOM, BBDb.TO, JNJ, MSFT.
f - represents the returned data columns, such as "snd1l1yr". -
Historical data request
http://ichart.yahoo.com/table.csv?s=string&a=int&b=int&c=int&d=int&e=int&f=int&g=d&ignore=.csv
s - stock name
a - start time, month
b - start time, day
c - start time, year
d - end time, month
e - end time, day
f - end time, year
g - time period.
The parameter g can take the values: d-> 'day', w-> 'week', m-> 'month', v-> 'dividends only'
The month starts from 0, so for September data, it is written as 08.
Reference URLs:
http://blog.sina.com.cn/s/blog\_71302a17010100on.html
http://www.gummy-stuff.org/Yahoo-data.htm
http://hi.baidu.com/arjsyy/blog/item/3057167ab50157d50ad1878a.html