Skip to main content

Unofficial Robinhood Python API

Project description

robinhood-logo

pyrh - Unofficial Robinhood API

Gitter GitHub Code style: black

Python Framework to make trades with Robinhood Private API. See the original blog post.

Supports Python 2.7+ and 3.6+

Current Features

  • Placing buy orders (Robinhood.place_buy_order)
  • Placing sell order (Robinhood.place_sell_order)
  • Fetch and cancel orders (Robinhood.order_history and Robinhood.cancel_order)
  • Quote information (Robinhood.quote_data)
  • User portfolio data (Robinhood.portfolios)
  • User positions data (Robinhood.positions)
  • More coming soon

How To Install:

Clone the repository into your project directory using:

git clone https://github.com/robinhood-unofficial/Robinhood

Then navigate to the cloned directory, where setup.py is located. Now run the following to install:

pip install .

Converting to Python 3

Project will work on both python 2 and python 3

Running example.py

  • Install jupyter
pip install jupyter
jupyter notebook

Then navigate to the example file linked above and run it.

Data returned

  • Quote data
    • Ask Price
    • Ask Size
    • Bid Price
    • Bid Size
    • Last trade price
    • Previous close
    • Previous close date
    • Adjusted previous close
    • Trading halted
    • Updated at
    • Historical Price
  • User portfolio data
    • Adjusted equity previous close
    • Equity
    • Equity previous close
    • Excess margin
    • Extended hours equity
    • Extended hours market value
    • Last core equity
    • Last core market value
    • Market value
    • Order history
    • Dividend history
  • User positions data
    • Securities owned
  • News

Changelog

2.0

  • Fixed 2fa connection issues
  • Last version to support python 2

1.0.1

  • Added custom exception

Developer setup

  • Python 3.7+ is required
  • poetry is used to manage package dependencies
  • pre-commit is used to manage the project's tooling and linting
    • black
    • flake8
brew install poetry
brew install pre-commit
poetry install
pre-commit install

To manually run the linting checks. They are automatically run when you try to push the code.

pre-commit run -a

Related

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrh-2.0.tar.gz (16.7 kB view hashes)

Uploaded Source

Built Distribution

pyrh-2.0-py2.py3-none-any.whl (18.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page