Page 1 of 1
yahoo finance quote
Posted: 11 Jan 2014 17:09
by srjohn
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,
Re: yahoo finance quote
Posted: 11 Jan 2014 17:35
by Martin
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
Re: yahoo finance quote
Posted: 12 Jan 2014 01:14
by srjohn
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
Re: yahoo finance quote
Posted: 12 Jan 2014 09:35
by srjohn
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!
Is there any way to handle "^" character ?
Thanks,
-srjohn
Re: yahoo finance quote
Posted: 12 Jan 2014 10:44
by Martin
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
Re: yahoo finance quote
Posted: 12 Jan 2014 12:51
by srjohn
Great! I can get the data now.
Thanks for your help and this handy link.
-srjohn