4

I have been searching for this for last few days. I have achieved fetching the basic things through YQL, like their stocks, prices and all.

Like this :

Select Name,Symbol,LastTradePriceOnly,LastTradeDate, LastTradeTime, Change, ChangeInPercentage, PreviousClose, Open, Bid, Ask, DaysRange, YearRange, Volume , Average, MarketCapitalization, PERatio, EPSEstimateCurrentYear, TralingAnnualDividendYield from yahoo.finance.quotes where symbol = 'aapl'

But i do not know how to get stock quotes country wise. First of all i did not get a YQL to get the countries related to stocks.

For example : Select Name,Symbol from yahoo.finance.quotes where Country = "India".

Thanks for your time.

Akash Saikia
  • 452
  • 6
  • 19

4 Answers4

2

Using YQL in this manner is basically looking up the results for a given stock symbol which you provide. (Behind the scenes, this YQL table is querying a data source that Yahoo Finance uses.) It's not a general purpose database where you could do queries such as getting a list of symbols or markets for a given country.

YQL does work for some international market stocks, but again you need to already know the symbol. For example:

select * from yahoo.finance.quotes where symbol="arm.l"

select * from yahoo.finance.quotes where symbol="kfa.bo"

BrianC
  • 10,591
  • 2
  • 30
  • 50
  • Still wondering if yahoo can provide this, or if there is any way to get markets and some more details. – Akash Saikia Jun 20 '12 at 05:57
  • No I don't think you'll be able to get this data through Yahoo Finance. Yahoo itself pays for this data to power its websites. The data you can fetch with YQL using a community-provided table that in essence is screen-scraping Yahoo Finance, so it's not an official API. I would search for other stock market quote feed or API providers that might be able to give you what you're looking for. – BrianC Jun 20 '12 at 17:20
  • Hi, how do you figure all those column name? Where can we find those meanings? – Sam YC Nov 07 '12 at 06:06
1

I'm looking for the same sort of thing, I would have thought you would need to use market name instead of the country name. i.e NASDAQ, FTSE or the BSE.

Dean MacGregor
  • 11,847
  • 9
  • 34
  • 72
Nathan
  • 2,461
  • 4
  • 37
  • 48
  • is it possible to get stocks related to only the Markets ? (sorry i have not tried this yet and this question may seem as rant) If possible , it wont solve my problem, as to find what markets are related to what countries will also become a difficult task. – Akash Saikia Jun 13 '12 at 13:54
1

Yahoo APIs don't appear to work for int'l bourses. Try this:

select * from yahoo.finance.quotes where symbol="ril.bo"

The query works and returns no data. This is a sample what I got:

"Name": "RIL.BO",
"Notes": null,
"Open": null,
"PreviousClose": null,
"PricePaid": null,
"ChangeinPercent": null,
"PriceSales": null,
"PriceBook": null,
"ExDividendDate": null,
"PERatio": null,
"DividendPayDate": null,
"PERatioRealtime": null,
"PEGRatio": null,
"PriceEPSEstimateCurrentYear": null,
"PriceEPSEstimateNextYear": null,
"Symbol": "RIL.BO",

YQL gives a clue that it is not set up for int'l exchanges. Buried in JSON is the message:

"ErrorIndicationreturnedforsymbolchangedinvalid": "No such ticker symbol. <a href=/l>Try Symbol Lookup</a> (Look up: <a href=/l?s=RIL.BO>RIL.BO</a>)",

Note that the symbols I have used are valid and from Yahoo!'s own lookup.

Everything works just fine for US bourses. Try substituting GOOG or YHOO for RIL.BO. Works like a charm.

Sun Bee
  • 1,595
  • 15
  • 22
0

There is a list of important Stock Exchange codes for World wise region- http://finance.yahoo.com/intlindices?e=asia and I have explained the URL and Query logic here- http://prasanta-paul.blogspot.kr/2013/01/accessing-yahoo-finance-api.html

Hope it helps!

user542954
  • 512
  • 4
  • 2