yahoo-api - 雅虎更改了它的 API 还是部分关闭了?

标签 yahoo-api yfinance

有人知道 yfinance 模块发生了什么事吗? 我正在编写一个关于股票投资组合优化的大型网络应用程序,并且我依赖于该模块。现在我必须修改整个东西......

感谢任何帮助!

import yfinance as yf

msft = yf.Ticker("AAPL")

# get stock info
msft.info

打印

{'regularMarketPrice':无, 'preMarketPrice':无, '标志_url':'', 'trailingPegRatio':2.6609}

我曾经得到一个巨大的字典,但现在我只得到这个

最佳答案

好像我在我的 venv 中运行旧版本的 yfinance.. 更新后我得到了完整的 dict

ticker = yf.Ticker('AAPL')
info = ticker.info
info.keys()


dict_keys(['zip', 'sector', 'fullTimeEmployees', 'longBusinessSummary', 'city', 'phone', 'state', 'country', 'companyOfficers', 'website', 'maxAge', 'address1', 'industry', 'ebitdaMargins', 'profitMargins', 'grossMargins', 'operatingCashflow', 'revenueGrowth', 'operatingMargins', 'ebitda', 'targetLowPrice', 'recommendationKey', 'grossProfits', 'freeCashflow', 'targetMedianPrice', 'currentPrice', 'earningsGrowth', 'currentRatio', 'returnOnAssets', 'numberOfAnalystOpinions', 'targetMeanPrice', 'debtToEquity', 'returnOnEquity', 'targetHighPrice', 'totalCash', 'totalDebt', 'totalRevenue', 'totalCashPerShare', 'financialCurrency', 'revenuePerShare', 'quickRatio', 'recommendationMean', 'exchange', 'shortName', 'longName', 'exchangeTimezoneName', 'exchangeTimezoneShortName', 'isEsgPopulated', 'gmtOffSetMilliseconds', 'quoteType', 'symbol', 'messageBoardId', 'market', 'annualHoldingsTurnover', 'enterpriseToRevenue', 'beta3Year', 'enterpriseToEbitda', '52WeekChange', 'morningStarRiskRating', 'forwardEps', 'revenueQuarterlyGrowth', 'sharesOutstanding', 'fundInceptionDate', 'annualReportExpenseRatio', 'totalAssets', 'bookValue', 'sharesShort', 'sharesPercentSharesOut', 'fundFamily', 'lastFiscalYearEnd', 'heldPercentInstitutions', 'netIncomeToCommon', 'trailingEps', 'lastDividendValue', 'SandP52WeekChange', 'priceToBook', 'heldPercentInsiders', 'nextFiscalYearEnd', 'yield', 'mostRecentQuarter', 'shortRatio', 'sharesShortPreviousMonthDate', 'floatShares', 'beta', 'enterpriseValue', 'priceHint', 'threeYearAverageReturn', 'lastSplitDate', 'lastSplitFactor', 'legalType', 'lastDividendDate', 'morningStarOverallRating', 'earningsQuarterlyGrowth', 'priceToSalesTrailing12Months', 'dateShortInterest', 'pegRatio', 'ytdReturn', 'forwardPE', 'lastCapGain', 'shortPercentOfFloat', 'sharesShortPriorMonth', 'impliedSharesOutstanding', 'category', 'fiveYearAverageReturn', 'previousClose', 'regularMarketOpen', 'twoHundredDayAverage', 'trailingAnnualDividendYield', 'payoutRatio', 'volume24Hr', 'regularMarketDayHigh', 'navPrice', 'averageDailyVolume10Day', 'regularMarketPreviousClose', 'fiftyDayAverage', 'trailingAnnualDividendRate', 'open', 'toCurrency', 'averageVolume10days', 'expireDate', 'algorithm', 'dividendRate', 'exDividendDate', 'circulatingSupply', 'startDate', 'regularMarketDayLow', 'currency', 'trailingPE', 'regularMarketVolume', 'lastMarket', 'maxSupply', 'openInterest', 'marketCap', 'volumeAllCurrencies', 'strikePrice', 'averageVolume', 'dayLow', 'ask', 'askSize', 'volume', 'fiftyTwoWeekHigh', 'fromCurrency', 'fiveYearAvgDividendYield', 'fiftyTwoWeekLow', 'bid', 'tradeable', 'dividendYield', 'bidSize', 'dayHigh', 'coinMarketCapLink', 'regularMarketPrice', 'preMarketPrice', 'logo_url', 'trailingPegRatio'])

关于yahoo-api - 雅虎更改了它的 API 还是部分关闭了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74865937/

相关文章:

css - 使用 YUI 查看图像

iphone - 雅虎 API 集成?

python - 迭代 yfinance 股票代码列表的最快方法是什么?

python - 使用 yfinance 的 Assets 负债表没有像雅虎财经那样的 'Total Debt'

python-3.x - 我的 python 代码中有一个错误 key 错误 ['logo_url' ] 不在索引中

python - 在 For 循环中重试单次迭代 (Python)

session-variables - PHP session 在 Yahoo API 调用后过期?

雅虎内容分析 API 的 Python 包装器

python - Yfinance 没有在 1 分钟的时间范围内给出加密货币的准确价格