yahooyahoo-finance

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.


Solution

  • 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...