The `quandl` Python library provides a convenient interface for accessing financial, economic, and alternative datasets from Nasdaq Data Link (formerly Quandl). It allows users to fetch data as Pandas DataFrames or NumPy arrays, facilitating data analysis and integration into quantitative workflows. The library is actively maintained, with the current version being 3.7.0, and new features and fixes are released regularly.
pip install quandlVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import the `quandl` library, configure your API key (preferably via environment variable), and fetch a sample dataset. Data is returned as a Pandas DataFrame, making it easy to inspect and manipulate. An API key is essential for most practical uses beyond very limited anonymous calls.
Upgrade Python to version 3.6 or later.
Register for a free account on the Nasdaq Data Link website, obtain your API key from your account settings, and set it using `quandl.ApiConfig.api_key = 'YOUR_KEY'` or via the `QUANDL_API_KEY` environment variable.
Consult the Nasdaq Data Link website for the most current dataset codes and documentation, even when using the `quandl` library.
Ensure your environment's SSL certificates are correctly configured or, as a last resort for debugging (not recommended for production), disable SSL verification via `quandl.ApiConfig.verify_ssl_certs = False`.
Avoid relying on `authtoken.p`. Explicitly set `quandl.ApiConfig.api_key` in your script or use the `QUANDL_API_KEY` environment variable.
Change the import statement to `import quandl` (all lowercase).
Set your API key using `quandl.ApiConfig.api_key = 'YOUR_API_KEY'` before making data requests. Ensure 'YOUR_API_KEY' is replaced with your actual key from Nasdaq Data Link.
Verify your API key is correct and active. Check your Nasdaq Data Link account for subscription status and daily call limits. Some datasets require paid subscriptions. If the key is correct, try accessing a free dataset like `WIKI/GOOGL` to isolate the problem.
Check the full error message for a `QuandlError` status code (e.g., 403, 500). Ensure your API key is valid, your request parameters are correct, and you are not exceeding rate limits. Temporarily enabling verbose logging might reveal the actual HTTP response body.