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.
Next, install the tool along with its dependent Python modules as follows.
$ cd Robinhood-for-Google-Finance/
$ sudo pip install -r requirements.txt
After installation, you can initiate the Robinhood data export process by simply running:
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.
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.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!