icm63
icm63

Reputation: 57

YQL getting stock quotes with new pm.finance table

This old URL worked perfectly

http://query.yahooapis.com/v1/public/yql?q=select%20Symbol%2C%20LastTradeDate%2C%20Open%2C%20DaysHigh%2C%20DaysLow%2C%20LastTradePriceOnly%2C%20Volume%20from%20yahoo.finance.quotes%20where%20symbol%20in%20('MSFT','AAPL')&diagnostics=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys

The SQL is

select Symbol,LastTradeDate,Open,DaysHigh,DaysLow,LastTradePriceOnly,Volume from yahoo.finance.quotes where symbol in ('MSFT','AAPL')

So now yahoo.finance.quotes table has died, I replace it with the new pm.finance table, on the console i type select * from pm.finance where symbol="AAPL" and I get the new table field format

        <Name>Apple Inc.</Name>
        <Symbol>AAPL</Symbol>
        <Open>174.000000</Open>
        <DaysHigh>174.240005</DaysHigh>
        <DaysLow>171.119995</DaysLow>
        <MarketCapitalization>896.093B</MarketCapitalization>
        <YearHigh>174.240005</YearHigh>
        <YearLow>104.080000</YearLow>
        <Volume>44234059</Volume>
        <AverageDailyVolume>-</AverageDailyVolume>
        <PERatio>19.696367</PERatio>
        <LastTradePriceOnly>173.485596</LastTradePriceOnly>
        <Change>5.375595</Change>
        <realtime_price>173.485596</realtime_price>
        <realtime_change>5.375595</realtime_change>
        <realtime_chg_percent>3.197665</realtime_chg_percent>
        <eps_curr_year>8.808000</eps_curr_year>
        <realtime_ts>11 03 2017 17:36:24 GMT</realtime_ts>
        <ts>11 03 2017 17:36:24 GMT</ts>

So I change the above SQL to .. AND IT WORKS ON THE CONSOLE YIPPEE

select Symbol,ts,Open,DaysHigh,DaysLow,LastTradePriceOnly,Volume from pm.finance where symbol in ('MSFT','AAPL')

Now the trick to convert it to the URL ??

I tried

https://query.yahooapis.com/v1/public/yql?q=select%20Symbol%2C%20ts%2C%20Open%2C%20DaysHigh%2C%20DaysLow%2C%20LastTradePriceOnly%2C%20Volume%20from%20pm.finance%20where%20symbol%20in%20(%27MSFT%27,%27AAPL%27)&diagnostics=false

and I get

Authentication Error. The table pm.finance requires a higher security level than is provided, you provided ANY but at least APP is expected

Question, do I need an App ID key, or something, I cant find any exmaples of how to add 'Authentication'..

Please advise

MORE INFORMATION I am using Vb.net and this was the code used for the URL at top of the screen

Dim doc As New Xml.XmlDocument

doc.Load(URL)

etc

Now it seems we need to use OATH 2 authentication like Google APIs, but they have dll for that in .Net like here https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth

Does yahoo YQL have this ??

Upvotes: 3

Views: 255

Answers (0)

Related Questions