Following is my query using YQL, data is fetched using Yahoo finance, I am using the symbols for the stocks traded on the Indian NSE, BSE
http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.quotes where
symbol in ("AIAENG.NS","ATULAUTO.NS")&env=http://datatables.org/alltables.env&format=json
Strange thing is this query always return null data (Invalid data) for all the fields, even when the symbol that I am using is correct and can be used on the Yahoo finance for querying the details. In fact same is for another Indian exchange BSE, with respective symbols AIAENG.BO, ATULAUTO.BO
However if I replace the with US Nasdaq symbols like "YHOO","AAPL","GOOG","MSFT", it works without an issue.
If yahoo finance is not your compulsion, then you can use this project.
http://nsetools.readthedocs.org/en/latest/
This is well documented and uses NSE as a data source which is most reliable.