Question

I am trying to retrieve options data from Yahoo Finance using YQL. The very strange problem is that I can download the desired options data for other symbols such as AAPL (Apple) and MSFT (Microsoft), but not for GOOG (Google).

Here's my query and the result. Obviously I can retrieve data for AAPL and MSFT, but GOOG is missing. This happens not only with yahoo.finance.option_contracts, but also with all other option-related tables including yahoo.finance.options. I am pretty sure that this is not something related to the query limits, since the query shown below is expected to retrieve only less than 10 results for GOOG.

select * from yahoo.finance.option_contracts where symbol in ( 'GOOG', 'AAPL', 'MSFT')

{
 "query": {
  "count": 2,
  "created": "2014-03-03T15:00:45Z",
  "lang": "en-US",
  "diagnostics": {
   "url": [
    {
     "execution-start-time": "0",
     "execution-stop-time": "1",
     "execution-time": "1",
     "content": "http://www.datatables.org/yahoo/finance/yahoo.finance.option_contracts.xml"
    },
    {
     "execution-start-time": "4",
     "execution-stop-time": "1057",
     "execution-time": "1053",
     "content": "http://finance.yahoo.com/q/op?s=MSFT"
    },
    {
     "execution-start-time": "5",
     "execution-stop-time": "3571",
     "execution-time": "3566",
     "content": "http://finance.yahoo.com/q/op?s=AAPL"
    },
    {
     "error": "Connect Failure",
     "execution-start-time": "5",
     "execution-stop-time": "10017",
     "execution-time": "10012",
     "content": "http://finance.yahoo.com/q/op?s=GOOG"
    },
    {
     "error": "Connect Failure",
     "execution-start-time": "5",
     "execution-stop-time": "10017",
     "execution-time": "10012",
     "content": "http://finance.yahoo.com/q/op?s=GOOG"
    }
   ],
   "publiclyCallable": "true",
   "javascript": [
    {
     "execution-start-time": "3",
     "execution-stop-time": "1074",
     "execution-time": "1070",
     "instructions-used": "18571",
     "table-name": "yahoo.finance.option_contracts"
    },
    {
     "execution-start-time": "3",
     "execution-stop-time": "3616",
     "execution-time": "3612",
     "instructions-used": "31142",
     "table-name": "yahoo.finance.option_contracts"
    },
    "Exception: Read timed out, url: http://finance.yahoo.com/q/op?s=GOOG",
    {
     "execution-start-time": "3",
     "execution-stop-time": "10017",
     "execution-time": "10013",
     "instructions-used": "31142",
     "table-name": "yahoo.finance.option_contracts"
    }
   ],
   "user-time": "10018",
   "service-time": "19447",
   "build-version": "0.2.2157"
  },
  "results": {
   "option": [
    {
     "symbol": "AAPL",
     "contract": [
      "2014-03",
      "2014-04",
      "2014-05",
      "2014-06",
      "2014-07",
      "2014-10",
      "2015-01",
      "2016-01"
     ]
    },
    {
     "symbol": "MSFT",
     "contract": [
      "2014-03",
      "2014-04",
      "2014-05",
      "2014-06",
      "2014-07",
      "2014-10",
      "2015-01",
      "2016-01"
     ]
    }
   ]
  }
 }
}

In sum, every time I try to retrieve options data for GOOG, I only get null result with the error of 'Read Timed Out'. For other option symbols such as AAPL and MSFT, I get what I desire.

Anyone knows why this is so?

Was it helpful?

Solution

This must have to do with Google the company trading under TWO stickers (See http://finance.yahoo.com/news/google-trades-under-2-tickers-225300863.html): GOOG and GOOGL.

YQL doesn't recognize GOOG, but will accept the new ticker GOOGL. I suspect the YQL query errors out on getting unexpectedly two tickers instead of one when looking for just GOOG.

If you request a GOOG quote on Yahoo!Finance, it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top