Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting stock graphs from yahoo finance

I am using yahoo finance to get stock quotes. Now i want to get the graph of a particular company. Is it possible to do this using yahoo. If not could someone please provide some other api through which one could achieve this. ( the 20 minute delay is not an issue at all). I am looking for stocks listed in bse and nse.

like image 735
user1092042 Avatar asked Mar 21 '12 15:03

user1092042


People also ask

Does Yahoo Finance have charts?

FREE,STOCK,CHARTS | Stock Prices | Quote Comparison - Yahoo Finance.


1 Answers

Yahoo Finance API lets you retrieve graphs of stocks.

The main url is https://chart.finance.yahoo.com/z?s=AAPL&t=6m&q=l&l=on&z=s&p=m50,m200

For options to use, please refer to this page.

The result is a picture, so you just have to write (for eg in HTML):

<img src="https://chart.finance.yahoo.com/z?s=AAPL&t=6m&q=l&l=on&z=s&p=m50,m200"/>

to display:

Please note that I'm not sure if Yahoo Finance supports stocks for India, http://in.finance.yahoo.com/q?s=%5EBSESN and http://in.finance.yahoo.com/q/cp?s=%5ENSEI don't seem to display list of components...

like image 123
Romain Avatar answered Oct 13 '22 23:10

Romain