Get Stock Data from Quandl via Python

Prerequisites

  1. quandl
  2. matplotlib
  3. An API key from https://www.quandl.com/

Install prerequisites

  1. launch a CMD prompt with the ‘Run as Administrator’ option
  2. python -m pip install –upgrade pip
  3. pip install quandl
  4. pip install matplotlib

Helpful PIP Commands

  1. pip list
  2. pip search <module>
  3. pip search quandl

Code

# auth_tok = "<your-api-key-here>";

import quandl as ql;
data = ql.get("WIKI/MSFT", start_date="2000-01-01", end_date="2019-12-31", authtoken=auth_tok);
print(data);

import matplotlib.pyplot as plt;
data.Close.plot();
plt.show();

Output: Chart

Output: Data

Git

  1. https://github.com/raybishun/scripts/tree/master/py/fin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Get Stock Data from Quandl via Python

Prerequisites

  1. quandl
  2. matplotlib
  3. An API key from https://www.quandl.com/

Install prerequisites

  1. launch a CMD prompt with the ‘Run as Administrator’ option
  2. python -m pip install –upgrade pip
  3. pip install quandl
  4. pip install matplotlib

Helpful PIP Commands

  1. pip list
  2. pip search <module>
  3. pip search quandl

Code

# auth_tok = "<your-api-key-here>";
import quandl as ql;
data = ql.get("WIKI/MSFT", start_date="2000-01-01", end_date="2019-12-31", authtoken=auth_tok);
print(data);
import matplotlib.pyplot as plt;
data.Close.plot();
plt.show();

Output: Chart

Output: Data

Git

  1. https://github.com/raybishun/scripts/tree/master/py/fin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s