Nasdaq Data Link Python Client

raw JSON →
1.0.4 verified Fri May 01 auth: no python

Official Python client for accessing Nasdaq Data Link (formerly Quandl) API. Version 1.0.4 supports Python >=3.7. Low maintenance cadence.

pip install nasdaq-data-link
error ImportError: cannot import name 'ApiConfig' from 'nasdaqdatalink'
cause Incorrect casing or wrong module name in import statement.
fix
Use: from nasdaqdatalink import ApiConfig
error AttributeError: module 'nasdaqdatalink' has no attribute 'get_data'
cause Using the old function name from Quandl package.
fix
Use: nasdaqdatalink.get()
error AuthenticationError: You need to provide an API key.
cause API key not set before making a request.
fix
Set ApiConfig.api_key = 'your_key' or export environment variable NASDAQ_DATA_LINK_API_KEY.
deprecated The 'WIKI' database is deprecated by Nasdaq Data Link. Use premium or other free datasets instead.
fix Use a different dataset code (e.g., 'EOD/AAPL' for end-of-day data).
gotcha API key must be set via ApiConfig.api_key or environment variable NASDAQ_DATA_LINK_API_KEY. Passing as parameter is not supported.
fix Set ApiConfig.api_key = 'your_key' at the start of your script.
gotcha The package is not compatible with Python 2 and requires Python >=3.7.
fix Ensure you are using Python 3.7 or higher.

Fetch stock data using the dataset code 'WIKI/AAPL'. Requires API key set as environment variable.

import nasdaqdatalink
from nasdaqdatalink import ApiConfig

ApiConfig.api_key = os.environ.get('NASDAQ_DATA_LINK_API_KEY', '')
data = nasdaqdatalink.get('WIKI/AAPL', start_date='2020-01-01', end_date='2020-12-31')
print(data.head())