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.

Leave a Comment