yahoo finance quote

Post your questions and help other users.

Moderator: Martin

Post Reply
srjohn
Posts: 17
Joined: 11 Jan 2014 15:53

yahoo finance quote

Post by srjohn » 11 Jan 2014 17:09

I am new here and thanks for this great APP!
I have a question about stock market query.
In Yahoo Finance web site, search for 2330.TW.
How can I store the volume as a varialbe?
Thanks,

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: yahoo finance quote

Post by Martin » 11 Jan 2014 17:35

Hi,

You can use the flow Stock Check Facebook available in the catalog as a base (see menu->Catalog, in category scripting).

Change symbol FB in the URL to 2330.TW like this:
http://query.yahooapis.com/v1/public/yq ... eswithkeys

then use an action Script with following expressions to extract the information into variables:

Code: Select all

price=evaluateXPathAsString(response,"/query/results/quote/LastTradePriceOnly");
volume=evaluateXPathAsString(response,"/query/results/quote/Volume");
The service seems not to be very reliable at the moment. Sometimes the service returns an empty result.

Regards,
Martin

srjohn
Posts: 17
Joined: 11 Jan 2014 15:53

Re: yahoo finance quote

Post by srjohn » 12 Jan 2014 01:14

Amazing! Great thanks!
My smart phone is now a SUPER smart phone now!
One more question, how is this browse string generated, "http://query.yahooapis.com/v1/public/yq ... eswithkeys"
I mean how do we know we browse this URL, then we can get the XML as the response?

-srjohn

srjohn
Posts: 17
Joined: 11 Jan 2014 15:53

Re: yahoo finance quote

Post by srjohn » 12 Jan 2014 09:35

For ppl who want to use Yahoo finance to quote, you can refer to the following link, it shows how to query the data to a CSV formated data.
http://www.gummy-stuff.org/Yahoo-data.htm

But I face a new problem now, Automagic seems failed to handle "^" character.
Because I tried "http://finance.yahoo.com/d/quotes.csv?s=^TWII&f=l1vp2", it works fine on web browser.
But in Automagic, it shows an ERROR!
End executing action 'HTTP Request for Y! Finance [queryID + queryTag]' and exception Illegal character in query at index 40: http://finance.yahoo.com/d/quotes.csv?s=^TWII&f=l1vp2
Is there any way to handle "^" character ?

Thanks,
-srjohn

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: yahoo finance quote

Post by Martin » 12 Jan 2014 10:44

The character ^ should be escaped %5E in an URL:
http://finance.yahoo.com/d/quotes.csv?s=%5ETWII&f=l1vp2

Yahoo has a developer page to build queries for a lot of stuff (stock quotes, itunes music, youtube and even search for bible texts):
YQL console

Regards,
Martin

srjohn
Posts: 17
Joined: 11 Jan 2014 15:53

Re: yahoo finance quote

Post by srjohn » 12 Jan 2014 12:51

Martin wrote:The character ^ should be escaped %5E in an URL:
http://finance.yahoo.com/d/quotes.csv?s=%5ETWII&f=l1vp2

Yahoo has a developer page to build queries for a lot of stuff (stock quotes, itunes music, youtube and even search for bible texts):
YQL console

Regards,
Martin
Great! I can get the data now.
Thanks for your help and this handy link.
-srjohn

Post Reply