In [1]:
import pynasdaq as nas;

Stock

Current price of a stock

In [2]:
nas.currentPrice("AMZN")
Out[2]:
symbol                                    AMZN
company          Amazon.com, Inc. Common Stock
lastSalePrice                          1806.33
dtype: object

Stock summary quote

In [3]:
nas.stockSummaryQuote("IBM")
Out[3]:
symbol                                                         IBM
company          International Business Machines Corporation Co...
lastSalePrice                                              $142.45
volume                                                     367,370
MarketCap                                          126,192,916,684
dtype: object

Historical stock prices

In [4]:
nas.historicalStockQuote('ibm',fromdate='2019-08-16',todate='2019-09-16')
Out[4]:
high low open close volume dateTime value
0 134.59 132.9539 133.04 133.76 3,011,993 08/16/2019 133.76
1 136.33 134.88 134.88 135.04 3,165,436 08/19/2019 135.04
2 135.28 132.81 135.24 133 3,018,934 08/20/2019 133
3 135.94 133.8 134.96 134.25 2,806,774 08/21/2019 134.25
4 135.68 133.81 134.69 134.32 2,695,009 08/22/2019 134.32
5 134.26 128.83 133.63 129.57 4,818,759 08/23/2019 129.57
6 131.3 129.16 131.05 129.99 2,836,837 08/26/2019 129.99
7 131.6961 130.31 131.2 131.17 4,728,392 08/27/2019 131.17
8 132.89 130.04 130.44 132.76 2,720,362 08/28/2019 132.76
9 135.69 134.04 134.18 134.88 2,972,842 08/29/2019 134.88
10 136.07 134.3627 135.58 135.53 2,960,594 08/30/2019 135.53
11 134.9013 133.3301 134.85 134.1 2,828,242 09/03/2019 134.1
12 136.43 135.15 135.71 136.32 2,262,081 09/04/2019 136.32
13 141.695 138.05 138.3 140.97 5,012,914 09/05/2019 140.97
14 141.525 140.46 141.52 140.57 2,577,200 09/06/2019 140.57
15 143.02 140.46 140.59 142.6 4,226,944 09/09/2019 142.6
16 145.46 142.96 143 145.05 4,979,741 09/10/2019 145.05
17 145.12 142.7051 144.85 143.6 3,869,731 09/11/2019 143.6
18 144.04 141.88 144.03 143.62 2,505,432 09/12/2019 143.62
19 144.65 143.26 144.32 143.67 2,206,612 09/13/2019 143.67

Batch quotes

In [5]:
nas.batchQuotes(['AAPL','GOOG',"FB","IBM"])
Out[5]:
companyName lastSalePrice netChange percentageChange deltaIndicator lastTradeTimestamp volume
symbol
AAPL Apple Inc. Common Stock $219.77 +1.02 0.47% up DATA AS OF Sep 16, 2019 3:20 PM ET 7,322,583
GOOG Alphabet Inc. Class C Capital Stock $1,231.29 -8.27 0.67% down DATA AS OF Sep 16, 2019 3:20 PM ET 270,146
FB Facebook, Inc. Class A Common Stock $186.13 -1.065 0.57% down DATA AS OF Sep 16, 2019 3:20 PM ET 2,593,937
IBM International Business Machines Corporation Co... $142.45 -1.22 0.85% down DATA AS OF Sep 16, 2019 3:20 PM ET 367,370

Dividend

Dividend calendar for a given date

In [6]:
nas.dividendCalendar(date="2019-09-17").head()
Out[6]:
companyName symbol dividend_Ex_Date payment_Date record_Date dividend_Rate indicated_Annual_Dividend announcement_Date
0 Altra Industrial Motion Corp. AIMC 09/17/2019 10/02/2019 09/18/2019 0.170 0.680 07/22/2019
1 Brookfield Real Assets Income Fund Inc. RA 09/17/2019 09/26/2019 09/18/2019 0.199 2.587 07/05/2019
2 Briggs & Stratton Corporation BGG 09/17/2019 10/02/2019 09/18/2019 0.050 0.200 01/01/1900
3 Brookfield Global Listed Infrastructure Income... INF 09/17/2019 09/26/2019 09/18/2019 0.082 1.062 07/05/2019
4 Cohen & Steers Closed-End Opportunity Fund, Inc. FOF 09/17/2019 09/30/2019 09/18/2019 0.087 1.131 06/11/2019

Dividend history for a company given the symbol

In [7]:
nas.dividendHistory("AAPL").head()
Out[7]:
exOrEffDate type amount declarationDate recordDate paymentDate
0 08/09/2019 Cash $0.77 07/30/2019 08/12/2019 08/15/2019
1 05/10/2019 Cash $0.77 04/30/2019 05/13/2019 05/16/2019
2 02/08/2019 Cash $0.73 01/29/2019 02/11/2019 02/14/2019
3 11/08/2018 Cash $0.73 11/01/2018 11/12/2018 11/15/2018
4 08/10/2018 Cash $0.73 07/31/2018 08/13/2018 08/16/2018