Get stock price data with Quandl API [Python]

Introduction

I tried to get stock price data using Quandl API, which provides various financial data of the world by API. I would like to share with you how to use the Quandl API service and your personal impressions of the service. (Because I am stingy, I will introduce the features within the range that can be used for free.)

Quandl API Quandl official website: https://www.quandl.com/

Library installation

$ pip install Quandl

Sample code

Tokens can be obtained by registering an account with Quandl. In the sample code, the stock price of Coca-Cola Company is acquired. Of course, you can also get data on Japanese stocks. For example, if you want to get the stock price of Toyota, you can get it by changing `'WIKI / KO'``` to `'TSE / 7203'```.

sample_quandl.py


import quandl

quandl.ApiConfig.api_key="MY_TOKEN"
data=quandl.get('WIKI/KO')
print(data)

Execution result

I was able to acquire the stock price from 1962 to 2018. However, as a result of executing it in 2020, it seems that the latest stock price cannot be obtained because only the data up to 2018 can be obtained. (It seems that the latest data cannot be obtained if Japanese stocks are also free versions.)

              Open      High      Low   Close      Volume  ...  Adj. Open  Adj. High   Adj. Low  Adj. Close  Adj. Volume
Date                                                       ...
1962-01-02  101.00  103.7500  101.000  101.00     16800.0  ...   0.262323   0.269465   0.262323    0.262323    1612800.0
1962-01-03   99.50   99.5000   97.250   98.75     32800.0  ...   0.258427   0.258427   0.252583    0.256479    3148800.0
1962-01-04   99.00  100.2500   99.000   99.50     17600.0  ...   0.257128   0.260375   0.257128    0.258427    1689600.0
1962-01-05   99.50  100.7500   97.000   97.25     29600.0  ...   0.258427   0.261673   0.251934    0.252583    2841600.0
1962-01-08   96.50   96.5000   94.380   96.25     42400.0  ...   0.250635   0.250635   0.245129    0.249986    4070400.0
...            ...       ...      ...     ...         ...  ...        ...        ...        ...         ...          ...
2018-03-21   43.13   43.4500   42.790   43.00  13029766.0  ...  43.130000  43.450000  42.790000   43.000000   13029766.0
2018-03-22   42.88   43.3650   42.700   42.76  12134714.0  ...  42.880000  43.365000  42.700000   42.760000   12134714.0
2018-03-23   42.82   43.1556   42.290   42.33  13190877.0  ...  42.820000  43.155600  42.290000   42.330000   13190877.0
2018-03-26   42.61   42.8099   42.250   42.69  10939927.0  ...  42.610000  42.809900  42.250000   42.690000   10939927.0
2018-03-27   42.70   43.3100   42.525   42.89  11595357.0  ...  42.700000  43.310000  42.525000   42.890000   11595357.0

[14155 rows x 12 columns]

Personal impression

It seems that the latest stock price data cannot be obtained if the Quandl API is the free version. I wanted to create a service that uses the latest stock price data, so I would like to find another API service that can get the latest version of the stock price.

Recommended Posts

Get stock price data with Quandl API [Python]
Get stock price with Python
Get US stock price from Python with Web API with Raspberry Pi
Get Youtube data with python
Get reviews with python googlemap api
[Python] Get economic data with DataReader
Get data from analytics API with Google API Client for python
Get additional data in LDAP with python
[Note] Get data from PostgreSQL with Python
Retrieving food data with Amazon API (Python)
Get Google Fit API data in Python
Get Youtube data in Python using Youtube Data API
[Python] Get Python package information with PyPI API
[Python] Get all comments using Youtube Data API
I tried to get CloudWatch data with Python
Get date with python
Get Gmail subject and body with Python and Gmail API
Automatic acquisition of stock price data with docker-compose
Let's do web scraping with Python (stock price)
Data analysis with Python
Get the stock price of a Japanese company with Python and make a graph
[First API] Try to get Qiita articles with Python
Get financial data with python (then a little tinkering)
Get schedule from Garoon SOAP API with Python + Zeep
Data is missing when getting stock price data with Pandas-datareader
[Python] Get insight data using Google My Business API
Get comments and subscribers with the YouTube Data API
[Time series with plotly] Dynamic visualization with plotly [python, stock price]
[Python] Get user information and article information with Qiita API
Get data from database via ODBC with Python (Access)
Get country code with python
Sample data created with python
Use Trello API with python
Get Twitter timeline with python
Use Twitter API with Python
Get information with zabbix api
Stock price forecast with tensorflow
Web API with Python + Falcon
Get thread ID with python
Python: Stock Price Forecast Part 2
Play RocketChat with API / Python
Get started with Python! ~ ② Grammar ~
Call the API with python3.
Use subsonic API with python3
Stock price data acquisition tips
Get home directory with python
Get keyboard events with python
Get Alembic information with Python
Python: Stock Price Forecast Part 1
Read json data with python
Get ranking with Rakuten API
"Getting stock price time series data from k-db.com with Python" Program environment creation memo
Programming history 1 month Extract NY Dow stock price with Python!
Get rid of dirty data with Python and regular expressions
Get stock articles of infrastructure engineer yuta with Qiita API
[Stock price analysis] Learning pandas with fictitious data (002: Log output)
Get additional data to LDAP with python (Writer and Reader)
[Introduction to Python] How to get data with the listdir function
Get Japanese stock price information from yahoo finance with pandas
Play with YouTube Data API v3 using Google API Python Client
Get Leap Motion data in Python.