Has Yahoo finance web service disappeared? API changed? Down temporarily?

I was facing a similar issue from last 2-3 days. The url works on the smartphone, where on the desktop it gives "Not a valid parameter" error and HTTP Code 406.

This can be resolved by adding user agent as "Mozilla/5.0 (Linux; Android 6.0.1; MotoG3 Build/MPI24.107-55) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537.36" while invoking the get request.

For example, if you are downloading from curl in php use as follows:

curl_setopt($session,CURLOPT_USERAGENT,"Mozilla/5.0 (Linux; Android 6.0.1; MotoG3 Build/MPI24.107-55) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537.36");

I hope this will resolve the issue.


Yes, it does seem like Yahoo! has discontinued the (private, mostly-undocumented) Yahoo Finance API that many have been relying on for years for currency data. We received some notifications about it over the past 24 hours. (edit: All responses seem to be returning "Not a valid parameter". I suppose there's a chance they may switch it back on, but they don't officially support that API anywhere as far as I can tell.)

I created Open Exchange Rates about five years ago, and our exchange rate API now supports a community of tens of thousands of developers - and their tens of millions of users - with accurate, up-to-date information.

Please feel welcome to check out our Forever Free service at https://openexchangerates.org.

Our API is in a simple, original JSON format, which has actually caught on as a standard method for displaying rates because it's so simple to work with (unlike the Yahoo API, which required you to parse the obscure nested objects to pull out the basic info you needed...)

If you need assistance porting from the deprecated Yahoo! API, we'll be happy to assist via email.

(I am the founder of Open Exchange Rates.)


I had the same issue. Here is the API URL to pull stock from YAHOO. Hope this helps.

https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22YHOO%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=

Since the service is down, I use the following URL to query Yahoo data (for ACA.PA):

Link

The JSON result is different but I found the informations that interests me.

For more information , visit the page https://developer.yahoo.com/yql/


Check out this excellent API Wrapper, available on NuGet: https://github.com/salmonthinlion/YahooFinanceApi

Get stock quotes

var quotes = await Yahoo.Symbol("AAPL", "GOOG").Tag(Tag.LastTradePriceOnly, Tag,ChangeAndPercentChange, Tag.DaysLow, Tag.DaysHigh).GetAsync();
var aapl = quotes["AAPL"];
var price = aapl[Tag.LastTradePriceOnly];

Get historical data for a stock

// You should be able to query data from various markets including US, HK, TW
var history = await Yahoo.GetHistoricalAsync("AAPL", new DateTime(2016, 1, 1), new DateTime(2016, 7, 1), Period.Daily);
foreach (var candle in history)
{
    Console.WriteLine($"DateTime: {candle.DateTime}, Open: {candle.Open}, High: {candle.High}, Low: {candle.Low}, Close: {candle.Close}, Volume: {candle.Volume}, AdjustedClose: {candle.AdjustedClose}");
}

Get dividend history for a stock

// You should be able to query data from various markets including US, HK, TW
var dividendHistory = await Yahoo.GetHistoricalDividendsAsync("AAPL", new DateTime(2016, 1, 1), new DateTime(2016, 7, 1));
foreach (var candle in dividendHistory)
{
    Console.WriteLine($"DateTime: {candle.DateTime}, Dividend: {candle.Dividend}");
}