How to export Robinhood transaction data

Question: I have been using Robinhood stock trading platform, and I would like to export all the transaction records from my Robinhood account to a spreadsheet file for accounting purposes. Is there an easy way to export and save Robinhood transaction data in a CSV file, preferably from the Linux command line?

As a stock trading mobile app targeted for millennials, Robinhood revolutionizes the way stock trades are done. With its 100% commission-free trading, Robinhood makes stock trading something that average people like us can easily do for fun. While Robinhood is getting maturer with more advanced features like instant deposits and after-hour trading, it is still lacking in useful features like data export.

Exporting historical transaction data is a highly useful feature for various reasons (e.g., when calculating your portfolio's return or filing your tax return). However, Robinhood does not officially support data export feature as of yet.

In this tutorial let's find out how to export Robinhood transactions to a spreadsheet file from the Linux command line. While this tutorial is written for Linux environment, it should be applicable on any operating system platform as long as you can run Python.

The Robinhood data export tool presented in this tutorial is called Robinhood-for-Google-Finance, which exports Robinhood trade data to a CSV file by using Robinhood APIs. This tool works on Python 2.7+ and 3.5+.

You can install this Robinhood export tool by following these simple steps.

First, install git and pip in your Linux environment.

Next, install the tool along with its dependent Python modules as follows.

$ git clone https://github.com/briansrls/Robinhood-for-Google-Finance.git
$ cd Robinhood-for-Google-Finance/
$ sudo pip install -r requirements.txt

After installation, you can initiate the Robinhood data export process by simply running:

$ python gf-export.py

You will be asked to enter your Robinhood username and password. As you can verify from its Python source code, this Python tool does not send your login credential anywhere but the official Robinhood API endpoint, so don't worry about entering your credential here.

After successful data export, your transaction data will be stored in robinhood.csv.

The exported CSV file is formatted as follows.

Date purchased,Commission,Purchase price per share,Shares,Transaction type,Symbol,
2015-08-20T12:21:48.833890Z,0.00,26.55000000,30.00000,buy,XYZ,
2015-08-20T12:31:52.836129Z,0.00,154.00000000,5.00000,buy,FAKE,
2015-08-20T12:37:04.790341Z,0.00,104.00000000,5.00000,buy,ABC,
2015-08-20T13:49:01.425933Z,0.00,122.91990000,5.00000,buy,DIS,
2015-08-20T13:56:54.648714Z,0.00,62.00000000,5.00000,buy,DEL,
2015-08-20T13:58:31.913929Z,0.00,213.00000000,5.00000,buy,FC,
2015-08-20T15:24:48.325668Z,0.00,82.00000000,2.00000,buy,TTT,
2015-08-20T19:41:48.406801Z,0.00,20.00000000,5.00000,buy,JO,
2015-08-20T19:43:39.375537Z,0.00,56.10000000,10.00000,buy,TOU,

Once exported, the CSV file can easily be imported into other stock market software like JStock or online portfolio management solutions such as Google Finance.

Download this article as ad-free PDF (made possible by your kind donation): 
Download PDF

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.


Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

Leave a comment

Your email address will not be published. Required fields are marked *