I may be able to help with a list of ticker symbols for (U.S. and non-U.S.) stocks and for ETFs.
Yahoo provides an Earnings Calendar that lists all the stocks that announce
earnings for a given day. This includes non-US stocks.
For example, here is today's: http://biz.yahoo.com/research/earncal/20120710.html
the last part of the URL is the date (in YYYYMMDD format) for which you want the
Earnings Calendar. You can loop through several days and scrape the Symbols
of all stocks that reported earnings on those days.
There is no guarantee that yahoo has data for all stocks that report earnings,
especially since some stocks no longer exist (bankruptcy, acquisition, etc.),
but this is probably a decent starting point.
If you are familiar with R
, you can use the
qmao package to do this.
(See this post)
if you have trouble installing it.
ec <- getEarningsCalendar(from="2011-01-01", to="2012-07-01") #this may take a while
s <- unique(ec$Symbol)
length(s)
#[1] 12223
head(s, 20) #look at the first 20 Symbols
# [1] "CVGW" "ANGO" "CAMP" "LNDC" "MOS" "NEOG" "SONC"
# [8] "TISI" "SHLM" "FDO" "FC" "JPST.PK" "RECN" "RELL"
#[15] "RT" "UNF" "WOR" "WSCI" "ZEP" "AEHR"
This will not include any ETFs, futures, options, bonds, forex or mutual funds.
You can get a list of ETFs from yahoo here: http://finance.yahoo.com/etf/browser/mkt
That only shows the first 20. You need the URL of the "Show All" link at the
bottom of that page. You can scrape the page to find out how many
ETFs there are, then construct a URL.
L <- readLines("http://finance.yahoo.com/etf/browser/mkt")
# Sorry for the ugly regex
n <- gsub("^(\\w+)\\s?(.*)$", "\\1",
gsub("(.*)(Showing 1 - 20 of )(.*)", "\\3",
L[grep("Showing 1 - 20", L)]))
URL <- paste0("http://finance.yahoo.com/etf/browser/mkt?c=0&k=5&f=0&o=d&cs=1&ce=", n)
#http://finance.yahoo.com/etf/browser/mkt?c=0&k=5&f=0&o=d&cs=1&ce=1442
Now, you can extract the Tickers from the table on that page
library(XML)
tbl <- readHTMLTable(URL, stringsAsFactors=FALSE)
dat <- tbl[[tail(grep("Ticker", tbl), 1)]][-1, ]
colnames(dat) <- dat[1, ]
dat <- dat[-1, ]
etfs <- dat$Ticker # All ETF tickers from yahoo
length(etfs)
#[1] 1442
head(etfs)
#[1] "DGAZ" "TAGS" "GASX" "KOLD" "DWTI" "RTSA"
That's about all the help I can offer, but you could do something similar to
get some of the futures they offer by scraping these pages
(These are only U.S. futures)
http://finance.yahoo.com/indices?e=futures,
http://finance.yahoo.com/futures?t=energy,
http://finance.yahoo.com/futures?t=metals,
http://finance.yahoo.com/futures?t=grains,
http://finance.yahoo.com/futures?t=livestock,
http://finance.yahoo.com/futures?t=softs,
http://finance.yahoo.com/futures?t=indices,
And, for U.S. and non-U.S. indices, you could scrape these pages
http://finance.yahoo.com/intlindices?e=americas,
http://finance.yahoo.com/intlindices?e=asia,
http://finance.yahoo.com/intlindices?e=europe,
http://finance.yahoo.com/intlindices?e=africa,
http://finance.yahoo.com/indices?e=dow_jones,
http://finance.yahoo.com/indices?e=new_york,
http://finance.yahoo.com/indices?e=nasdaq,
http://finance.yahoo.com/indices?e=sp,
http://finance.yahoo.com/indices?e=other,
http://finance.yahoo.com/indices?e=treasury,
http://finance.yahoo.com/indices?e=commodities