(UNMAINTAINED) US stock market data since 2009
Clone or download
Latest commit 5e42f8c Apr 2, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
2015 20151231 Jan 1, 2016
2016 20161230 Dec 31, 2016
2017 20170331 Apr 1, 2017
.gitignore Add index pages May 31, 2015
CNAME Move CNAME to right place May 28, 2015
LICENSE Initial commit Mar 21, 2015
README.md Add announcement Apr 2, 2017
index.html Add 2017 to index Jan 4, 2017
index.txt Add 2017 to index Jan 4, 2017


IMPORTANT UPDATE on Apr 2, 2017: I've decided to stop maintaining this repo. The HTTP API (http://data.pystock.com) and the GitHub repo will be still accessible, only that latest data will stay at Mar 31, 2017 forever. However, I do offer paid service for maintaining this dataset. Please contact me at eliang.cs@gmail.com.

US Stock Data

Historical data of US stocks, updated daily.

How Data are Collected

The data are collected using pystock-crawler and pystock-github. Every day before the US stock exchanges open at 9:30 EST/EDT, the crawler collects the stock prices and financial reports, and pushes the data to this repository. Thus, the latest data is of yesterday. The data are day-based, meaning that you won't find hourly or minute-level data here.

pystock-crawler crawls data from the following sources:

Directory Layout

All data are stored in CSV and TXT files, archived with gzip. The files are categorized and named by their created dates. For example, a file collected on 2015-03-23 is named 20150323.tar.gz placed under 2015 directory.

Initial data are the first batch of collected data, whose date range spans from 2009-01-01 to 2015-03-20. They are split into three files: 0001_initial.tar.gz to 0003_initial.tar.gz, under 2015 directory.

Every gzip archive file may or may not contain the following files:

  • symbols.txt
  • prices.csv
  • reports.csv

symbols.txt is a list of companies, line by line. For example:

AAPL	Apple Inc.
FB	Facebook
GOOGL	Google Inc.

prices.csv contains daily prices in CSV format. Normally, in a daily-generated file, two trading days of prices are included. This is because when a company splits its shares, you will need to compare the close price (close) and the adjusted close price (adj_close) of the previous trading day to detect the split. See Yahoo's explaination for more details.

Here's a sample of prices.csv:


reports.csv contains several financial metrics extracted from 10-Q or 10-K reports. 10-Q is a quarterly report. 10-K is an annual report. The CSV file looks like:


The financial metrics included are:

  • end_date: the end date of the period of the filing report
  • amend: is the filing an amendment?
  • period_focus: Q1, Q2, Q3 for quarterly reports, or FY for annual reports
  • fiscal_year: fiscal year of the company
  • doc_type: 10-Q or 10-K

Income statement

  • revenues: revenues or sales
  • op_income: operating income
  • net_income: net income or net earnings
  • eps_basic: basic earnings per share
  • eps_diluted: diluted earnings per share
  • dividend

Balance sheet

  • assets: total assets
  • cur_assets: current assets
  • cur_liab: current liabilities
  • cash: cash and cash equivalents
  • equity: total equity

Cash flow

  • cash_flow_op: cash from operating activities
  • cash_flow_inv: cash from investing activities
  • cash_flow_fin: cash from financing activities


Besides the Github repo (https://github.com/eliangcs/pystock-data), you can also use the HTTP API provided by http://data.pystock.com.

This "website" is built with Github Pages and is a mirror of the git repo. If you're building an application on pystock-data, http://data.pystock.com is a better choice over the git repo, since not only is HTTP API easier to use, but you will also benefit from the fast CDN provided by Github Pages.

To navigate the filesystem on the HTTP API, you just visit index file:


where you can find the index file for each year. For instance:


From there, you will find all the .tar.gz files for that year. For instance: