7

I'm using this YQL command to access stock quote information in an XML format. The problem is it keeps timing out and rejecting after a bunch of hits. I think I need to plug in my API key so it doesn't think it's bots.

I'm using SharePoint to process the XML.

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22AAPL%22)&env=store://datatables.org/alltableswithkeys

This is what it says for limits.

Per application limit (identified by your Access Key): 100,000 calls per day.
Per IP limits: /v1/public/: 1,000 calls per hour; /v1/yql/: 10,000 calls per hour.

I'm trying to get that per application limit of 100,000 calls per day. Or I guess that 10,000 calls per hour is also good. Any suggestions? Thanks for any help.

zen
  • 1,115
  • 3
  • 28
  • 54
  • YQL uses OAuth, you will need to create an access key (http://developer.yahoo.com/dashboard/createKey.html). – salathe Apr 10 '12 at 10:44
  • 2
    I have the access key just don't know what to do with it or where to put it. thanks. – zen Apr 11 '12 at 17:21
  • Hi - I know this is an old post but wondering if a solutions was found using javascript / jquery ? I've also hit yahoo's data limit, but cant find how to use the consumer key. – Orange Juice Jones Feb 29 '16 at 09:29

2 Answers2

3

You need to use OAuth and go through the complicated procedure of exchanging tokens. Once you have an access_token and a token_secret, you can use them to make authenticated requests until they expire.

The full workflow is summarized here.

You'll need to go through the step-by-step procedure outlined in the link above, but essentially what you'll be doing is:

  1. Get a request_token from here.
  2. Redirect user to a Yahoo authorization page.
  3. Retrieve the oauth_verifier that comes in the query string when the user is redirected back to your page.
  4. Exchange the request_token and oauth_verifier for an access_token and token_secret.
  5. You can then use the access_token and token_secret to make authenticated requests.

Since you're using .Net, you can make your life easier by using this sample code posted here.

Community
  • 1
  • 1
Johnny Oshika
  • 54,741
  • 40
  • 181
  • 275
0

hope you have used Yahoo.inc to get your access token so just use

    $session = YahooSession::requireSession(CONSUMER_KEY,CONSUMER_SECRET, APP_ID);
    $mails=$session->query('your query  limit 10');

after feting access

Swarna Sekhar Dhar
  • 550
  • 1
  • 8
  • 25