0
votes

I'm calling yahoo.finance.quotes using two different techniques and getting two completely different results. Notice the LastTradeDate node shows '2016-05-19' for one and '2016-05-20' for the other. Maddening...

  1. From the developer.yahoo.com/yql/console (YQL Console) returns the following result:

enter image description here

  1. From PHP cURL

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

$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_TIMEOUT, 0);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_FRESH_CONNECT,1);
$data = curl_exec($curl_handle);
curl_close($curl_handle);

$data = json_decode($data);

dd($data);

enter image description here

1

1 Answers

0
votes

Sadly, there is no logical explanation for this behavior -- the problem must lie with the yahoo/datatables service and not in the technique I use to get to the data. Running this exact same code today provides the correct results.