Skip to main content

A Python wrapper around the Robinhood API

Project description

Robinhood API Library

Introduction

This library aims to create simple to use functions to interact with the Robinhood API. This is a pure python interface and it requires Python3. The purpose of this library is to allow people to make their own robo-investors or to view stock information in real time.

Installing

There is no need to download these files directly. This project is published on PyPi, so it can be installed by typing into terminal:

>>> pip install robin_stocks

Example Usage

In your python code write:

>>> from robin_stocks.robin_stocks import robin_stocks
>>> r = robin_stocks()
>>> login = r.login('joshsmith@email.com','password')
>>> my_stocks = r.build_holdings()

This will build a dictionary called “my_stocks” where the keys are the ticker symbols of all the stocks you hold, and the values of those keys are another dictionary containing important information about the stocks. If you then wanted to print this dictionary, you could type

>>> for key,value in my_stocks.items():
>>>   print(key,value)

Keep in mind that the functions contained in the library are just helper functions, and you are free to write your own functions that interact with the Robinhood API.

Functions Contained

(NOTE: parameters that are equal to a value are optional when calling the function.)

  • login(username,password)

  • logout()

  • get_user_profile(info=None)

  • get_investment_profile(info=None)

  • get_basic_profile(info=None)

  • get_portfolios_profile(info=None)

  • get_accounts_profile(info=None)

  • get_security_profile(info=None)

  • get_quotes(*inputSymbols,info=None)

  • get_latest_price(*inputSymbols)

  • get_fundamentals(*inputSymbols,info=None)

  • get_instruments_by_symbols(*inputSymbols,info=None)

  • get_instruments_by_url(url,info=None)

  • query_instruments(query)

  • get_positions(info=None)

  • get_owned_positions(info=None)

  • get_dividends(info=None)

  • get_total_dividends()

  • get_name_by_symbol(symbol)

  • get_name_by_url(url)

  • get_documents(info=None)

  • download_document(url,name=None,dirpath=None)

  • download_all_documents(doctype=None,dirpath=None)

  • get_historicals(*inputSymbols,span=’week’,bounds=’regular’)

  • get_all_watchlists(info=None)

  • get_watchlist_by_name(name=’Default’,info=None)

  • post_symbols_to_watchlist(*inputSymbols,name=’Default’)

  • delete_symbols_from_watchlist(*inputSymbols,name=’Default’)

  • get_notifications(info=None)

  • get_markets(info=None)

  • get_wire_transfers(info=None)

  • get_all_orders(info=None)

  • get_all_open_orders(info=None)

  • get_order_info(order_id)

  • query_orders(**arguments)

  • cancel_all_open_orders()

  • cancel_order(order_id)

  • order_buy_market(symbol,quantity,time_in_force=’gtc’)

  • order_sell_market(symbol,quantity,time_in_force=’gtc’)

  • build_holdings()

  • build_user_profile()

Project details


Release history Release notifications | RSS feed

This version

0.7

Download files

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

Source Distribution

robin_stocks-0.7.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robin_stocks-0.7-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file robin_stocks-0.7.tar.gz.

File metadata

  • Download URL: robin_stocks-0.7.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.19.1 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.1

File hashes

Hashes for robin_stocks-0.7.tar.gz
Algorithm Hash digest
SHA256 5c9e8f09205a3396283463b0c30e2fa29a3ab3e1dbc61102dfe699711a9e55bd
MD5 e4f0f2af125046551855cc7e1d32cd6c
BLAKE2b-256 e5ee44d16ac59e60b84ae614d5fdeebd2f776b65c7b88f418da835902b5b7c20

See more details on using hashes here.

File details

Details for the file robin_stocks-0.7-py3-none-any.whl.

File metadata

  • Download URL: robin_stocks-0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.19.1 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.1

File hashes

Hashes for robin_stocks-0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 550987af8199042d58530c64196b3cc26d5a43a32e28a71cec9be7fa0b8e9aa5
MD5 953f13ab8979391239e40dada474ab11
BLAKE2b-256 1b15712981ccfb849de5025f8b03ead374654b0bde0861aec430a6019bfec670

See more details on using hashes here.

Supported by

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