npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

robinhood-node

v1.0.14

Published

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

Downloads

17

Readme

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!