1

I'm using YQL to request data for a particular stock for displaying on my page (see my answer to a related YQL question).

Periodically, for no apparent reason, the call to get the stock data fails. If I simply refresh the page, then it'll (probably) work again. Overall, it seems like it succeeds 75% of the time and fails the other 25%.

When I test my call in the YQL console, I get the same thing: occasionally the results come back as null:

enter image description here

Clicking the Test button again (without making any changes) will then usually pull the results in correctly.

I know there's a limit to how often I can make requests, but there's no way I'm anywhere near 2,000 requests/hour/IP (and that wouldn't make sense anyway since even the console test is failing).

What else could the issue be? Is Yahoo's service just spotty?


UPDATE: With YQL's debug option enabled, I get the following message:

No definition found for Table yahoo.finance.quotes


UPDATE 2: The error above was due to not having the "show community tables" option enabled (as per @BrianC's answer). Even with that option enabled, however, I still occasionally get a null response from the query as shown in the screenshot.

Community
  • 1
  • 1
daGUY
  • 27,055
  • 29
  • 75
  • 119
  • Tick the "Debug" option, and run the query again. It should give you links to debug info about the external requests made by YQL, to see if it's a problem with the data provider or not. – salathe Feb 22 '14 at 00:04
  • Good idea, unfortunately I haven't been able to get it to fail yet with the debug option enabled...haha. – daGUY Feb 22 '14 at 00:58

1 Answers1

-1

By default the YQL console will only use the built-in tables. The table yahoo.finance.quotes is actually part of the community tables (ref: datatables.org).

The solution is to check (enable) the Show Community Tables option in the upper left corner. This will let the sample query like you've shown above work. Checking this option also adds an env parameter to the rest query shown at the bottom of the console. You'll need to add this as well when your app makes the API call to YQL.

Note: If you're wondering why the Yahoo Finance tables are part of the community tables and not built-in, it's because these are unofficial tables which scrape the relevant web pages. Unfortunately there is still no official Yahoo Finance API (or YQL tables).

BrianC
  • 10,591
  • 2
  • 30
  • 50
  • Hm...that sounds like it makes sense, but I was still able to get the call to fail once within the YQL console even with that option checked. And the query I'm using already has the `env` parameter... – daGUY Feb 28 '14 at 03:12