How to download Chinese stock prices

Ting-Hao Chen
Quantitative Investment with Python
2 min readSep 7, 2020

In this article, I will show you how to download Chinese stock prices from an open source platform “TuShare” for free!

Since TuShare is written in Chinese, if you don’t know Chinese, you might have problem registering the website. I might write an alternative article teaching non-Chinese readers how to download Chinese stock prices, so stay tune.

Let’s get started on how to use TuShare to download data. The website is listed below, so make share to register an account.

After registering, under your profile, you could find your API token. Copy it and we will use it later.

# Import libraries
import pandas as pd
import tushare as ts
from datetime import date
from tqdm import tqdm

Let’s first download the information of tickers which includes code, symbol, name, area, industry, market, and IPO date.

The data is shown below.

Next, let’s download the stock prices. It will take some time because the code will loop all the tickers and append the data in a big data frame.

The whole code can be found below. Have fun and enjoy!

--

--