Package: nasdaq-data
Install guidepipinstallnasdaq-dataHow toFirst import and create an instance of your nasdaq data grabber objectfromnasdaq_dataimportnasdaq_grabberasngmy_ng=ng()Get Top Stocks by Market CapCall nasdaq_stocks and input the number of tickers you want and you will get info on stocks in order of Market Capmy_ng.nasdaq_stocks(10)symbolnamelastsalenetchangepctchangemarketCapurl0AAPLApple Inc. Common Stock$150.43-2.31-1.512%2,608,056,056,200/market-activity/stocks/aapl1MSFTMicrosoft Corporation Common Stock$237.92-3.06-1.27%1,774,381,634,186/market-activity/stocks/msft2GOOGAlphabet Inc. Class C Capital Stock$99.17-1.40-1.392%1,293,573,480,000/market-activity/stocks/goog3GOOGLAlphabet Inc. Class A Common Stock$98.74-1.40-1.398%1,287,964,560,000/market-activity/stocks/googl4AMZNAmazon.com, Inc. Common Stock$113.78-3.53-3.009%1,157,926,339,396/market-activity/stocks/amzn5TSLATesla, Inc. Common Stock$275.33-13.26-4.595%862,738,307,490/market-activity/stocks/tsla6BRK/ABerkshire Hathaway Inc.$404485.25-889.76-0.219%594,946,837,609/market-activity/stocks/brk/a7BRK/BBerkshire Hathaway Inc.$267.77-0.74-0.276%590,783,995,813/market-activity/stocks/brk/b8UNHUnitedHealth Group Incorporated Common Stock (DE)$513.61-3.85-0.744%480,421,913,683/market-activity/stocks/unh9JNJJohnson & Johnson Common Stock$166.720.540.325%438,336,872,094/market-activity/stocks/jnjGet Historical PricesPass a start date and end date in ISO format along with your ticker to nasdaq_historical_price to get historical pricesfromdateutil.relativedeltaimportrelativedeltaimporttimeimportdatetimeasdt#todayt=dt.date.today().replace(day=1)#one year agot0=t-relativedelta(years=1)#isoformatiso_t0,iso_t=t0.isoformat(),t.isoformat()my_ng.nasdaq_historical_price('AAPL',iso_t0,iso_t)dateclosevolumeopenhighlow009/01/2022$157.9674,229,900$156.64$158.42$154.67108/31/2022$157.2287,991,090$160.305$160.58$157.14208/30/2022$158.9177,906,200$162.13$162.56$157.72308/29/2022$161.3873,313,950$161.145$162.9$159.82408/26/2022$163.6278,960,980$170.57$171.05$163.56.....................24809/08/2021$155.1174,420,210$156.98$157.04$153.97524909/07/2021$156.6982,278,260$154.97$157.26$154.3925009/03/2021$154.357,866,070$153.76$154.63$153.0925109/02/2021$153.6571,171,320$153.87$154.72$152.425209/01/2021$152.5180,313,710$152.83$154.98$152.34253 rows Ã— 6 columnsGet Stocks Financal DataCall nasdaq_financals and pass in a frequency you desireAnnualSemi Annualmy_ng.nasdaq_financals('AAPL',1)symboltabs.incomeStatementTabletabs.balanceSheetTabletabs.cashFlowTabletabs.financialRatiosTableincomeStatementTable.headers.value1incomeStatementTable.headers.value2incomeStatementTable.headers.value3incomeStatementTable.headers.value4incomeStatementTable.headers.value5...cashFlowTable.headers.value3cashFlowTable.headers.value4cashFlowTable.headers.value5cashFlowTable.rowsfinancialRatiosTable.headers.value1financialRatiosTable.headers.value2financialRatiosTable.headers.value3financialRatiosTable.headers.value4financialRatiosTable.headers.value5financialRatiosTable.rows0AAPLIncome StatementBalance SheetCash FlowFinancial RatiosPeriod Ending:9/25/20219/26/20209/28/20199/29/2018...9/26/20209/28/20199/29/2018[{'value1': 'Net Income', 'value2': '$94,680,0...Period Ending:9/25/20219/26/20209/28/20199/29/2018[{'value1': 'Liquidity Ratios', 'value2': '', ...1 rows Ã— 29 columnsGet Other DataCalling the nasdaq_data function and supplying type to any of the numbers below will get youAnalyst Target Price and RatingsPEG RatioMomentum EstimateEarnings ForecastEarnings SurpriseEPS#analysts ratingsmy_ng.nasdaq_data('AAPL',1)symbolhistoricalConsensusconsensusOverview.lowPriceTargetconsensusOverview.highPriceTargetconsensusOverview.priceTargetconsensusOverview.buyconsensusOverview.sellconsensusOverview.hold0aapl[{'z': {'buy': 19, 'hold': 5, 'sell': 0, 'date...136.0220.0183.452314#PEG Ratiomy_ng.nasdaq_data('AAPL',2)pegr.labelpegr.textpegr.pegValueper.peRatioChartper.labelper.textper.dataProvidergr.peGrowthChartgr.title0Forecast 12 Month Forward PEG RatioInvestors are always looking for companies wit...1.95[{'x': '2021 Actual', 'y': 26.81}, {'x': '2022...Price/Earnings RatioPrice/Earnings Ratio is a widely used stock ev...<b>Data Provider:</b> Zacks Investment Research[{'z': 'Growth', 'x': '2022', 'y': 8.8}, {'z':...Forecast P/E Growth Rates