Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use API key with Yahoo's YQL?

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.

like image 538
zen Avatar asked Apr 02 '12 21:04

zen


People also ask

Does Yahoo Finance have an open API?

Yahoo's finance API was a good choice. But unfortunately it is discontinued. So If you are looking for a Yahoo Finance API alternative, you are in the right place.

How do I get my Yahoo API key?

Yahoo API Steps:In the 1st field ("Yahoo API"), if you have a Yahoo account already, enter your account name, otherwise create a new account. 3. Where asked to select a radio button for "Authentication method", select "Generic, No user authentication required" and proceed futher - you'll manage to get your API key.

Does Yahoo Finance API have crypto?

Some of the offerings include market data on Cryptocurrencies, regular currencies, stocks and bonds, fundamental and options data, and market analysis and news.

What is Yahoo API?

The Yahoo Finance API is a RESTful API that provides access to financial data. This data includes stock quotes, historical prices, and company information. The API is free to use and does not require an API key. The Yahoo Finance API is available in both JSON and XML format.


1 Answers

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.

like image 177
Johnny Oshika Avatar answered Nov 03 '22 08:11

Johnny Oshika