Screening stocks using Yahoo Finance API (YQL)
Asked Answered
A

0

6

i am trying to roll my own stock screener using the Yahoo Finance API.

While it is easy to get a heap of data (via XML or JSON) by providing the ticker symbol:

SELECT * FROM yahoo.finance.quotes WHERE symbol="RBS.L"

(See the results here and click 'test').

I am struggling to find a way to find stocks which match a certain set of criteria. For instance, say I want to grab a list of stocks whose Bid price is greater than 20

SELECT symbol FROM yahoo.finance.quotes WHERE Bid > 20.00

The query fails, with the following message:

Cannot find required keys in where clause; got 'Bid', expecting required keys: (symbol)

as can be seen here.

Is what I am trying to do possible? Is there a way to write the query string to get what I am looking for? Or is there a much simpler service out there that can help me out.

Would appreciate any help you guys can give me.

Allodial answered 13/1, 2012 at 17:55 Comment(3)
Possible, yes. Though not with the yahoo.finance.quotes table nor any other existing YQL tables that I know of. If you find a data source which allows filtering in the manner you need, then it is easy to make that into a YQL table.Newark
Following on @Newark comment, the Y!Finance YQL tables are unofficial scrapes of CSV files that are used by the Yahoo Finance front-end. They provide a good set of data for a given stock symbol, but can't do range or value searches as you're looking for. You'll need to find a webservice (probably paid or subscription) that does.Macnamara
@Allodial did you ever find a solution to your issue with yahoo? Is there a table that allows you to screen stocks instead of searching by ticker?Sacculate

© 2022 - 2024 — McMap. All rights reserved.