Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

robinhood-node

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robinhood-node

Trade stocks for **FREE** with this simple to use NodeJS library. Yes, it's really free using [Robinhood](http://share.robinhood.com/sagivo) service and their [undocumented API](https://github.com/sanko/Robinhood). The motivation behind this tool is to ag

  • 1.0.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by1100%
Maintainers
1
Weekly downloads
 
Created
Source

Robinhood node robinhood-node

Trade stocks for FREE with this simple to use NodeJS library.
Yes, it's really free using Robinhood service and their undocumented API.
The motivation behind this tool is to aggregate functions based on logic and not necessary api domain.

Install

yarn add robinhood-node

Use

const RH = require('robinhood-node');
const rh = new RH({ user: 'RH user', password: 'RH password' });
// get account
const account = new rh.Account();
console.log(await account.user);
// get stock quote
const stock = new rh.Stock('AMZN');
console.log(await stock.quote);
const orderResponse = await stock.buy(1);
// check order and cancel
const order = new rh.Order(orderResponse.id);
console.log(order.status());
order.cancel();

Interface

Each class can be initiated from a robinhood-node instance.

Login

In order to login you will need to have a Robinhood account. Use this link to open a free account.
Some of the calls (like stock quotes) can be used in anonymous mode. In order to trade (sell/buy) you will require to login as a Robinhood user. There are 2 ways to login into the library:

user & password [&mfa key]:
new RH({ user: 'your RH email', password: 'your RH password', mfa: 12345 });

mfa is optional and required only if your settings on Robinhood require it. In order to get the mfa try to leave it empty and then you should get the code on your first attempt.

token:
new RH({ token: 'your RH token' });

Once you login with username&password youu should get a token in reponse. this token can be used to access RH API from now on.

Stock

constructor(symbols) - symbols of stocks seperated by comma.
quote - get latest quote for symbol(s).

Stock actions

You can place orders directly from the stock class. For information about order types click here.
For a list of extra params available click here.
buy(quantity, extraParams = {})
sell(quantity, extraParams = {})
buyLimit(quantity, price, extraParams = {})
sellLimit(quantity, price, extraParams = {})
stopLossSell(quantity, stopPrice, extraParams = {})
stopLossBuy(quantity, stopPrice, extraParams = {})
stopLossSellLimit(quantity, stopPrice, sellPrice, extraParams = {})
stopLossBuyLimit(quantity, stopPrice, buyPrice, extraParams = {})

Order

constructor(id) - optional order id.
status(id) - get order status. order id is optional (can be set up when initiated).
cancel(id) - cancel an order. order id is optional (can be set up when initiated).
recent - get recent orders.
static place(params) - manually place an order. a better use will be to interact with Stock class in order to place an order.

Instrument

static all
static valueById(id)
static valueBySymbol(symbol)

Account

constructor()
positions
accounts
user
basicInfo
investment
watchlists
defaultWatchlist
portfolios

TODO

There are a lot of API calls that are still not implemented here. The important calls are. Any help or PR will be highly appriciated!

FAQs

Package last updated on 20 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc