Yahoo finance webservice API

后端 未结 4 832
囚心锁ツ
囚心锁ツ 2020-12-07 14:57

I am trying to get realtime stock data from BSE and NSE using yahoo finance web-services. I was able to get some data using following URL

http://finance.yaho         


        
4条回答
  •  孤街浪徒
    2020-12-07 15:33

    I don't know where the definitive documentation might be but for your particular example try appending &view=detail to your URL.

    http://finance.yahoo.com/webservice/v1/symbols/COALINDIA.NS/quote?format=json&view=detail

    This will at least give you the year_high and year_low that you asked after.

    Now, even though the following won't work for your COALINDIA.NS symbol (I suspect the exchange is not supported), it might be worth exploring the following two examples:

    Example 1: As before, but for Apple and Yahoo symbols, with &view=detail appended:

    http://finance.yahoo.com/webservice/v1/symbols/YHOO,AAPL/quote?format=json&view=detail

    Example 2: And now using a completely different url, resulting in much more response data. One key caveat is this data is delayed by 15 minutes:

    http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20IN%20(%22YHOO%22,%22AAPL%22)&format=json&env=http://datatables.org/alltables.env

    If you discover the major differences between those two options and what impact they might have then please do let us all know; I'd be interested in finding out more.

提交回复
热议问题