Friday 14 April 2017

Getting stock quote from Yahoo Finance API with ISIN

I'm building a Node.js app and I'm facing a little problem.

I want to get the price of a stock on realtime from Yahoo Finance based on the ISIN of the stock.

I'm already getting this price using the symbol of the stock (ex: AAPL for Apple Inc.)

This is my code:

var stock_url = "http://finance.yahoo.com/d/quotes.csv?s=AAPL&f=a";

request(stock_url, function (error, response, body) { 
    if (!error && response.statusCode == 200) {  
        var stock_data = body;
        console.log("Yahoo Finance API: ", stock_data);      
    };
});

Thanks!



via Everblack

No comments:

Post a Comment