Robinhood module in Python
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
robinhood Add pagination for get_options_orders (address #28) Aug 14, 2018
.gitignore Add show_potentials.py Mar 10, 2018
.pylintrc Do a quick pylint run for sanity Apr 8, 2018
CONTRIBUTING.md Typo Apr 6, 2018
LICENSE Initial commit Mar 2, 2018
README.md Update README with RobinhoodPortfolio May 21, 2018
__init__.py Add order script Mar 8, 2018
cancel.py Add crypto scripts Apr 11, 2018
cancel_crypto.py Add crypto scripts Apr 11, 2018
cancel_options.py Add crypto scripts Apr 11, 2018
disable_mfa.py Add scripts to enable/disable MFA and force disclosure verification Apr 14, 2018
download_documents.py Separate session by host and simplify shared auth/verify code Apr 8, 2018
download_history.py Do a quick pylint run for sanity Apr 8, 2018
download_portfolio.py Add RobinhoodPortfolio to dedupe some code May 21, 2018
enable_mfa.py Add scripts to enable/disable MFA and force disclosure verification Apr 14, 2018
login.py Add half-baked MFA support Mar 8, 2018
logout.py Add generate_dividends Mar 4, 2018
order.py Add show_options_quote.py Apr 8, 2018
order_crypto.py Add more sanity checking for crypto orders Apr 12, 2018
order_options.py Add confirmations when ordering options or crypto Apr 12, 2018
prepare_sentiment.py Add RobinhoodPortfolio to dedupe some code May 21, 2018
requirements.txt Add flake8 (nothing done yet) Mar 2, 2018
setup.py Added setup script (#25) Jun 23, 2018
show_crypto_quote.py Add crypto scripts Apr 11, 2018
show_interesting_stocks.py Add RobinhoodPortfolio to dedupe some code May 21, 2018
show_options_discoveries.py Add show_options_discoveries.py and show_pending_options_orders.py Apr 8, 2018
show_options_quote.py Allow mixing and matching options quotes Apr 10, 2018
show_pending_options_orders.py Add what I have so far for options ordering Apr 8, 2018
show_pending_orders.py Add quote information to pending orders May 2, 2018
show_potentials.py Add RobinhoodPortfolio to dedupe some code May 21, 2018
show_quote.py Do a quick pylint run for sanity Apr 8, 2018

README.md

robinhood-python 🗠

Robinhood module with convenience scripts for automating common activites (downloading entire history, trading, etc.)

Join, get a free stock, develop, profit. https://share.robinhood.com/matts952

  • Matt S

Some current caveats:

  • Development has been in python 3, I'm not taking much care to keep python 2 support at the moment.
  • The scripts currently default to extreme caching policies, use --live to guarantee most recent data.
  • Much of the code will assert (or not) in scenarioes where states and paging is involved where they haven't been handled correctly yet

Security

  • Certificate pinning is used to block against MITM attacks

Module

Scripts

Account

  • login.py
    • Forces a new login and caches the token. Note most scripts will do this automatically so you usually don't need to call this.
  • logout.py
    • Invalidates the current auth token and deletes the cached token
  • enable_mfa.py [app|sms]
    • Enables MFA for login
  • disable_mfa.py
    • Disables MFA for login

Portfolio management

Stocks

Purchasing stocks

  • show_quote.py AMZN [--live]
    • Displays the latest stock quote for the given symbol along with auxilary info
  • order.py [market|limit] [buy|sell] SYMBOL QUANTITY PRICE [--no-cancel]
    • Prints the quote for the given symbol, confirms, and places an order
  • show_pending_orders.py
    • Displays any outstanding stock orders along with position information
  • cancel.py ORDER_ID...
    • Cancels one or more order ids given, or all pending orders if none given
  • show_potentials.py
    • Show stocks and some stats to help decide on positions to push forward on.
      • Note this is basically only useful to myself ATM.
  • show_interesting_stocks.py
    • Show stocks that are on various lists
      • 10 popular S&P 500 stocks with Robinhood users
      • S&P 500 top movers up and down
      • Top 10 and 100 popular sticks with Robinhood users
    • This script is kind of a mess and mostly just a raw dump.

Options

Purchasing options

  • show_options_discoveries.py AMZN [--live]
    • Displays robinhood's options suggestions for the given symbol (pretty raw for now)
  • show_options_quote.py AMZN [--type=call|put] [--date 2018-05-21] [--strike=55] [--live]
    • Displays the quote for the given options contract (pretty raw for now)
      • Can do things like get all $55 puts, get all puts on 2 dates, etc.
  • order_options.py [market|limit] [buy|sell] SYMBOL DATE STRIKE [call|put] QUANTITY PRICE
    • Places an options order
  • show_pending_options_orders.py
    • Displays any outstanding options orders
  • cancel_options.py ORDER_ID...
    • Cancels one or more options order ids given, or all pending options orders if none given

Cryptocurrency

Purchasing cryptocurrency

  • show_crypto_quote.py [-s BTCUSD] [--live]
    • Displays a quote for the given cryptocurrencies or all crypto currencies when none given.
  • order_crypto.py [market|limit] [buy|sell] SYMBOL QUANTITY PRICE
    • Places some cryptocurrency
  • show_pending_crypto_orders.py
    • Displays any outstanding crypto orders
  • cancel_crypto.py ORDER_ID...
    • Cancels one or more crypto order ids given, or all pending crypto orders if none given

Legal

  • This library may have bugs which could result in financial consequences, you are responsible for anything you execute. Inspect the underlying code if you want to be sure it's doing what you think it should be doing.
  • I am not affiliated with Robinhood and this library uses an undocumented API. If you have any questions about them, contact Robinhood directly: https://robinhood.com/
  • By using this library, you understand that you are not to charge or make any money through advertisements or fees. Until Robinhood releases an official API with official guidance, this is only to be used for non-profit activites. I am not responsible if Robinhood cancels your account because of misuse of this library.