Pythonで日本の個別銘柄の配当金情報を読む方法

!pip install yfinance
import yfinance as yf
import json
stock_code = '2914.T' #JTの銘柄コード
ticker = yf.Ticker(stock_code) #YahooFinanceから読込
js_dump = json.dumps(ticker.info) # jsonフォーマットが読み込めない形式なので読めるように変換
js = json.loads(js_dump) #jsonファイル読込
print(js['lastDividendValue']) #最新の配当金情報読込

ちなみにjsでjsonの要素を出してみると(jsをprintすると)…

{'zip': '105-6927',
'sector': 'Consumer Defensive',
'fullTimeEmployees': 55381,
'longBusinessSummary': 'Japan Tobacco Inc., a tobacco company, manufactures and sells tobacco products, prescription drugs, and processed foods in Japan and internationally. The company operates through four segments: Domestic Tobacco, International Tobacco, Pharmaceutical, and Processed Food. It offers tobacco products, such as cigarettes, cigars, pipe tobacco, oral tobacco, waterpipe tobacco, kretek, and fine cut products under the Winston, Camel, MEVIUS, and LD brands. The company also provides reduced-risk products, including tobacco-infused vapor and heated tobacco products, E-Vapor products, etc. under the Ploom, Logic, Ploom TECH, Ploom TECH+, and Ploom S brands. In addition, it researches and develops, manufactures, and sells prescription drugs for the therapeutic areas, such as cardiovascular, renal and metabolism, immunology, and neuroscience. Further, the company provides staple food products, such as frozen noodles and okonomiyaki, and frozen and packed cooked rice; ambient processed foods; bakery products; and seasonings, including yeast extracts and oyster sauce. Japan Tobacco Inc. was founded in 1898 and is headquartered in Tokyo, Japan.',
'city': 'Tokyo',
'phone': '81 3 6636 2914',
'country': 'Japan',
'companyOfficers': [],
'website': 'https://www.jt.com',
'maxAge': 1,
'address1': '1-1, Toranomon 4-chome',
'industry': 'Tobacco',
'address2': 'Minato-ku',
'ebitdaMargins': 0.29393998,
'profitMargins': 0.14787,
'grossMargins': 0.58814996,
'operatingCashflow': 625537974272,
'revenueGrowth': 0.062,
'operatingMargins': 0.21399,
'ebitda': 693409021952,
'targetLowPrice': 2084,
'recommendationKey': 'hold',
'grossProfits': 1367977000000,
'freeCashflow': 457133129728,
'targetMedianPrice': 2300,
'currentPrice': 2350,
'earningsGrowth': 0.091,
'currentRatio': 1.629,
'returnOnAssets': 0.05661,
'numberOfAnalystOpinions': 10,
'targetMeanPrice': 2346.1,
'debtToEquity': 32.264,
'returnOnEquity': 0.12332,
'targetHighPrice': 2727,
'totalCash': 690488016896,
'totalDebt': 962468970496,
'totalRevenue': 2358976970752,
'totalCashPerShare': 389.102,
'financialCurrency': 'JPY',
'revenuePerShare': 1329.379,
'quickRatio': 0.824,
'recommendationMean': 2.9,
'exchange': 'JPX',
'shortName': 'JAPAN TOBACCO INC',
'longName': 'Japan Tobacco Inc.',
'exchangeTimezoneName': 'Asia/Tokyo',
'exchangeTimezoneShortName': 'JST',
'isEsgPopulated': False,
'gmtOffSetMilliseconds': '32400000',
'quoteType': 'EQUITY',
'symbol': '2914.T',
'messageBoardId': 'finmb_878471',
'market': 'jp_market',
'annualHoldingsTurnover': None,
'enterpriseToRevenue': 1.916,
'beta3Year': None,
'enterpriseToEbitda': 6.518,
'52WeekChange': 0.09455049,
'morningStarRiskRating': None,
'forwardEps': 198.38,
'revenueQuarterlyGrowth': None,
'sharesOutstanding': 1774530048,
'fundInceptionDate': None,
'annualReportExpenseRatio': None,
'totalAssets': None,
'bookValue': 1637.485,
'sharesShort': None,
'sharesPercentSharesOut': None,
'fundFamily': None,
'lastFiscalYearEnd': 1640908800,
'heldPercentInstitutions': 0.1724,
'netIncomeToCommon': 348813983744,
'trailingEps': 196.49,
'lastDividendValue': 75,
'SandP52WeekChange': -0.0928334,
'priceToBook': 1.4351276,
'heldPercentInsiders': 0.34372002,
'nextFiscalYearEnd': 1703980800,
'yield': None,
'mostRecentQuarter': 1648684800,
'shortRatio': None,
'sharesShortPreviousMonthDate': None,
'floatShares': 1107418926,
'beta': 0.388116,
'enterpriseValue': 4519534002176,
'priceHint': 2,
'threeYearAverageReturn': None,
'lastSplitDate': 1340755200,
'lastSplitFactor': '200:1',
'legalType': None,
'lastDividendDate': 1672272000,
'morningStarOverallRating': None,
'earningsQuarterlyGrowth': 0.091,
'priceToSalesTrailing12Months': 1.7677772,
'dateShortInterest': None,
'pegRatio': None,
'ytdReturn': None,
'forwardPE': 11.845952,
'lastCapGain': None,
'shortPercentOfFloat': None,
'sharesShortPriorMonth': None,
'impliedSharesOutstanding': 0,
'category': None,
'fiveYearAverageReturn': None,
'previousClose': 2349.5,
'regularMarketOpen': 2354.5,
'twoHundredDayAverage': 2277.0076,
'trailingAnnualDividendYield': 0.059587147,
'payoutRatio': 0.7125,
'volume24Hr': None,
'regularMarketDayHigh': 2359.5,
'navPrice': None,
'averageDailyVolume10Day': 3921360,
'regularMarketPreviousClose': 2349.5,
'fiftyDayAverage': 2350.12,
'trailingAnnualDividendRate': 140,
'open': 2354.5,
'toCurrency': None,
'averageVolume10days': 3921360,
'expireDate': None,
'algorithm': None,
'dividendRate': 150,
'exDividendDate': 1672272000,
'circulatingSupply': None,
'startDate': None,
'regularMarketDayLow': 2341.5,
'currency': 'JPY',
'trailingPE': 11.959896,
'regularMarketVolume': 2705200,
'lastMarket': None,
'maxSupply': None,
'openInterest': None,
'marketCap': 4170145595392,
'volumeAllCurrencies': None,
'strikePrice': None,
'averageVolume': 6332421,
'dayLow': 2341.5,
'ask': 2352,
'askSize': 0,
'volume': 2705200,
'fiftyTwoWeekHigh': 2437.5,
'fromCurrency': None,
'fiveYearAvgDividendYield': 6.06,
'fiftyTwoWeekLow': 2000,
'bid': 2350,
'tradeable': False,
'dividendYield': 0.0638,
'bidSize': 0,
'dayHigh': 2359.5,
'coinMarketCapLink': None,
'regularMarketPrice': 2350,
'preMarketPrice': None,
'logo_url': 'https://logo.clearbit.com/jt.com',
'trailingPegRatio': 47.5781}

いいなと思ったら応援しよう!