• This repository has been archived on 16/Apr/2021
  • Stars
    star
    124
  • Rank 279,645 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 6 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

(no longer maintained) A simple yet robust (stock+options) API client for Robinhood

PLEASE NOTE - PROJECT IS UNMAINTAINED

I've made a personal choice to use a different brokerage due to Robinhood's outages during the Covid19 market moves. There are some other fantastic Robinhood focused python clients out there. I'd suggest finding them and using them going forward. Best of luck.

fast_arrow

A simple yet robust (stock+options) API client for Robinhood

Build Status Β  Coverage Status Β  Version

please note - breaking changes introduced in 1.0.0 release

Sometime during Spring 2019, Robinhood changed how their API handles authentication. In order to adapt to those changes, I've moved "authentication" outside this library to fast_arrow_auth, https://github.com/westonplatter/fast_arrow_auth.

Please see:

  • issue 35 for a detailed account of the issue
  • this comment for the approach I've taken to remediate auth issues
  • this PR for a run down on exact code changes

I have released these changes under version 1.0.0 to follow semantic version guidelines (since auth changes are incompatible API changes).

example

from fast_arrow import Client, Stock, OptionChain, Option

#
# new auth process as of 1.0.0
# get auth_data (see https://github.com/westonplatter/fast_arrow_auth)
#
with open("fast_arrow_auth.json") as f:
    auth_data = json.loads(f.read())

#
# initialize client with auth_data
#
client = Client(auth_data)

#
# fetch the stock info for TLT
#
symbol = "TLT"
md = StockMarketdata.quote_by_symbol(client, symbol)

#
# get the TLT option chain
#
stock_id = md["instrument"].split("/")[-2]
option_chain = OptionChain.fetch(client, stock_id, symbol)

#
# let's get TLT options (calls and puts) for next 4 expiration dates
#
oc_id = option_chain["id"]
eds = option_chain['expiration_dates'][0:3]

#
# get all options on the TLT option chain
#
ops = Option.in_chain(client, oc_id, expiration_dates=eds)

#
# merge in market data fro TLT option instruments (ask, bid, delta, theta, etc)
#
ops = Option.mergein_marketdata_list(client, ops)

install

Install the package from pypi,

pip install fast_arrow

design principles

You might be asking, "yet another Robinhood client? There's already a few out there. What's different about this one?"

fast_arrow holds to these design principles,

  • focus on simple features that expose data. Don't interpret data.
  • make stock & option operations easy to reason through & execute with code
  • organize code in small and discrete python classes
  • use fast_arrow_auth to handle authentication process

features

Here's what you can do with fast_arrow (some features still in development)

Stocks

  • get quotes
  • fetch historical data
  • fetch all stock trades
  • submit orders
  • fetch earning events (past and future)
  • fetch company news articles
  • fetch company fundamentals
  • fetch popularity data

Options

  • fetch option quotes (example)
  • fetch open option positions (example)
  • fetch all option orders (filled, canceled, rejected)
  • fetch historical options data (example)
  • fetch option events (example)
  • generate option strategy orders
  • generate humanized names for option strategies
  • submit order (example)
  • cancel order (example)
  • replace order (example)

Portfolio

  • fetch historical value of portfolio (example)

Authentication/Security

Want to propose a feature? Open a feature request or open a Pull Request.

development

Install pipenv, and then run,

pipenv install --dev

Run the test suite via,

make test

Run all the examples (make sure you add username/password to config.debug.ini),

sh run_all_examples.sh

Run the test suite against a specific python version,

pipenv run tox -e py36

releases

Adding so I don't forget the next time I release a version,

python setup.py sdist bdist_wheel
twine upload dist/*

supporting libraries

projects using fast_arrow

More Repositories

1

phashion

Ruby wrapper around pHash, the perceptual hash library for detecting duplicate multimedia files
Ruby
700
star
2

example-golang-todo

Golang API backend powering a TodoList app
CSS
33
star
3

finx-option-pricer

Price options, visualize PnL/1st+2nd order greeks in Dash app UI
Jupyter Notebook
23
star
4

ta_scanner

Scanner that finds patterns in stocks/options/futures and discerns future risk/reward. Ie, money ball engine.
Jupyter Notebook
19
star
5

simple_portfolio

Export trades from Robinhood and run basic reporting on portfolio performance
Python
18
star
6

portfolio_management

Engine and UI for tracking trading performance across stocks and derivatives (options, futures, & future options).
Jupyter Notebook
15
star
7

example_meteor_deploy

Example for how to provision a linux server and deploy meteor app to it
Ruby
12
star
8

ibdatafetcher

Fetch data (futures, stock, coming next => options) from IBKR for local use.
Python
12
star
9

railsy_backbone

Use https://github.com/codebrew/backbone-rails
Ruby
9
star
10

Black-Litterman-Entropy-Pooling

Python
7
star
11

finx-option-data

Fetch, store, and warehouse Option Data
Python
6
star
12

ledgerx-python

Client for the LedgerX exchange (BTC and ETH derivatives)
Python
5
star
13

fast_arrow_auth

Robinhood API Authentication for fast_arrow
Python
4
star
14

finx-tracker

Web app to track PnL for options & futures strategies.
Python
4
star
15

example_ios_coredata_tdd

Build a simple Todo iOS app showing how to TDD the CoreData/JSON functionality
Objective-C
2
star
16

opening_range_breakout

opening range breakout modeling in ruby and python
Jupyter Notebook
2
star
17

learning_javascript

learn Javascript by proving concepts with tests
JavaScript
2
star
18

phash

fork of the official pHash library
Shell
2
star
19

simple_metrics

Simple metrics for Robinhood trading
Python
2
star
20

gdi-boulder-servers-intro

GDI Course - Intro to Servers
CSS
1
star
21

ta_visualizer

Visualizations of Pre-Entry, Post-Exit trades based on TA. Basically a heads up display for westonplatter/ta_scanner
Python
1
star
22

mapper

Android Mapper Application
Java
1
star
23

finx-reports-ib

Compose custom reports from IBKR Flex Statements.
Python
1
star
24

example_rails_bower

Example Rails app integrated with Bower so Bower manages all JS/CSS dependencies
Ruby
1
star
25

finx-pm

Python
1
star
26

zing

simple Nodejs + Socket.io chat app
JavaScript
1
star