This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(9)
我有类似的问题。雅虎不提供它,但您可以通过查看 nyse.com 列表上的 document.write 语句并找到 .js 文件来获得它,其中它们恰好存储以给定字母开头的公司列表作为 js 数组文字。您还可以从 nasdaq.com 获取整洁的 csv 文件:
http://www.nasdaq .com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=download(对于 nyse 符号,将 Exchange=nasdaq 替换为 Exchange=nyse)。
i had a similar problem. yahoo doesn't offer it, but you can get one by looking through the document.write statements on nyse.com's list and finding the .js file where they just happen to store the list of companies starting with the given letter as a js array literal. you can also get nice tidy csv files from nasdaq.com here:
http://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=download (replace exchange=nasdaq with exchange=nyse for nyse symbols).
我设法使用以下 URL 完成类似的操作:
它使用 Yahoo YQL API 下载股票代码的完整列表,包括股票名称、股票代码和行业 ID。它似乎没有任何类型的股票代码修饰符。例如,对于 Rogers Communications Inc,它只下载 RCI,而不是 RCI-A.TO、RCI-B.TO 等。我还没有找到该信息的来源 - 如果有人知道自动下载该信息的方法,我我想听听。另外,最好找到一种方法来下载股票代码与其交易的交易所之间的某种关系,因为有些股票在多个交易所交易,或者也许我只想查看 TSX 或其他地方的内容。
I managed to do something similar by using this URL:
It downloads a complete list of stock symbols using the Yahoo YQL API, including the stock name, stock symbol, and industry ID. What it doesn't seem to have is any sort of stock symbol modifiers. E.g. for Rogers Communications Inc, it only downloads RCI, not RCI-A.TO, RCI-B.TO, etc. I haven't found a source for that information yet - if anyone knows of a way to automate downloading that, I'd like to hear it. Also, it'd be nice to find a way to download some sort of relation between the stock symbol and the exchange it's traded on, since some are traded on multiple exchanges, or maybe I only want to look at stuff on the TSX or something.
纳斯达克股票列表
ftp://ftp.nasdaqtrader.com/symboldirectory
这 2 个文件 nasdaqlisted.txt 和 otherlisted.txt 是 |管道分开。这应该会给你一份所有股票的详细清单。
NASDAQ Stock lists
ftp://ftp.nasdaqtrader.com/symboldirectory
The 2 files nasdaqlisted.txt and otherlisted.txt are | pipe separated. That should give you a good list of all stocks.
http://code.google 有一个很好的 Yahoo.Finance API C# 包装器.com/p/yahoo-finance-management/ 即可帮助您实现这一目标。不幸的是,没有直接的方法来下载股票列表,但以下内容通过迭代字母组来创建列表:
它在大约 4 分钟内为我提供了大约 75,000 种证券的列表。
There is a nice C# wrapper for the Yahoo.Finance API at http://code.google.com/p/yahoo-finance-managed/ that will get you there. Unfortunately there is no direct way to download the ticker list but the following creates the list by iterating through the alphabetical groups:
It gave me a list of about 75,000 securities in about 4 mins.
我也许可以帮助列出(美国和非美国)股票和 ETF 的股票代码列表。
雅虎提供了一个收益日历,其中列出了所有宣布的股票
某一天的收入。这包括非美国股票。
例如,这是今天的: http://biz.yahoo.com/research/earncal /20120710.html
URL 的最后一部分是您想要的日期(采用 YYYYMMDD 格式)
收益日历。您可以循环几天并抓取符号
当日报告收益的所有股票。
无法保证雅虎拥有所有报告收益的股票的数据,
特别是因为一些股票不再存在(破产、收购等),
但这可能是一个不错的起点。
如果您熟悉
R
,则可以使用qmao 包 来执行此操作。
(请参阅这篇文章)
如果您安装时遇到问题。
这不包括任何 ETF、期货、期权、债券、外汇或共同基金。
您可以在此处从 yahoo 获取 ETF 列表:http://finance.yahoo.com/etf /浏览器/mkt
这只显示前 20 个。您需要“显示全部”链接的 URL
该页面的底部。您可以抓取页面以了解有多少
ETF有,然后构造一个URL。
现在,您可以从该页面上的表格中提取代码
这就是我可以提供的所有帮助,但您可以执行类似的操作
通过抓取这些页面来获取他们提供的一些期货
(这些仅是美国期货)
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,
并且,对于美国和非美国指数,您可以抓取这些页面
http://finance.yahoo.com /intlindices?e=美洲,
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
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 theqmao package to do this.
(See this post)
if you have trouble installing it.
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.
Now, you can extract the Tickers from the table on that page
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
雅虎符号/股票/股票的完整列表可在以下网站下载(Excel 格式)。 http://www.myinvestorshub.com/yahoo_stock_list.php
列表更新至 2016 年 1 月:
http://investexcel.net/all-yahoo-finance-stock-tickers/
Complete list of yahoo symbols/tickers/stocks is available for download(excel format) at below website. http://www.myinvestorshub.com/yahoo_stock_list.php
List updated to january 2016:
http://investexcel.net/all-yahoo-finance-stock-tickers/
我已经研究这个问题几天了,追踪了无数的线索,这些线索接近但不完全是我所追求的。
我需要一个简单的“符号、部门、行业”列表。我正在使用 Java 工作,不想使用任何平台本机代码。
似乎大多数其他数据,如报价等,都是容易获得的。
最后,按照建议查看“finviz.com”。看来只有门票了尝试使用以下内容:
http://finviz.com/导出.ashx?v=111&t=aapl,cat&o=ticker
它以 csv 样式的线条形式返回,带有标题行,按股票代码排序。您可以继续添加代码。在代码中,您可以读取流。或者您可以让浏览器询问您是否打开或保存文件。
http://finviz.com/export.ashx?v=111&& ;o=股票代码
相同的 csv 样式,但提取所有可用符号(很多,跨全球交易所)
将“导出”替换为“筛选器”,数据将显示在浏览器中。
您还可以使用更多选项,每个选项对应网站上的每个筛选器元素。
到目前为止,这是获取少数我似乎无法轻松获取的数据的最强大、最方便的编程方式。而且,看起来这个网站很可能是除了实时或近实时报价之外您可能需要的大部分内容的单一来源。
I have been researching this for a few days, following endless leads that got close, but not quite, to what I was after.
My need is for a simple list of 'symbol, sector, industry'. I'm working in Java and don't want to use any platform native code.
It seems that most other data, like quotes, etc., is readily available.
Finally, followed a suggestion to look at 'finviz.com'. Looks like just the ticket. Try using the following:
http://finviz.com/export.ashx?v=111&t=aapl,cat&o=ticker
This comes back as lines, csv style, with a header row, ordered by ticker symbol. You can keep adding tickers. In code, you can read the stream. Or you can let the browser ask you whether to open or save the file.
http://finviz.com/export.ashx?v=111&&o=ticker
Same csv style, but pulls all available symbols (a lot, across global exchanges)
Replace 'export' with 'screener' and the data will show up in the browser.
There are many more options you can use, one for every screener element on the site.
So far, this is the most powerful and convenient programmatic way to get the few pieces of data I couldn't otherwise seem to easily get. And, it looks like this site could well be a single source for most of what you might need other than real- or near-real-time quotes.
我对此的一种解决方法是迭代扇区(当时你可以这样做......我最近没有测试过)。
不过,当您这样做时,您最终会被阻止,因为 YQL 每天都会受到限制。
尽可能使用 CSV API 来避免这种情况。
One workaround I had for this was to iterate over the sectors(which at the time you could do...I haven't tested that recently).
You wind up getting blocked eventually when you do it that way though, since YQL gets throttled per day.
Use the CSV API whenever possible to avoid this.
我遇到了同样的问题,但我认为我有简单的解决方案(代码来自我的 RoR 应用程序):
从 yahoo.finance.sectors 中提取行业 id 并将其添加到 db:
提取所有公司及其符号和行业 id:
Connection hellper:
抱歉搞砸了,但这是我的项目的第一个测试版本,我很快就需要它。我的应用程序有一些助手变量和其他东西,对此感到抱歉。但我有一个问题:你有很多符号吗?我有5500
I had same problem, but I think I have simple solution(code is from my RoR app):
Extract industry ids from yahoo.finance.sectors and add it to db:
Extract all comanies with their symbols with industry ids:
Connection hellper:
Sorry for mess, but this is first testing version for my project and I needed it very fast. There are some helpers variabels and other things for my app, sorry for it. But I have question: Have many symbols do you have? I have 5500.