Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
robinhood-simple
Advanced tools
Readme
A simple nodejs module to interact with the private Robinhood API. The API has been reverse engineered; no official nodejs api for robinhood exists. FYI: Robinhood's Terms and Conditions.
This repository is based off of robinhood-node by aurbano. It was generated as a new repository rather than a fork because of the massive, backwards-incompatible, changes that were created in order to:
and most importantly
$ npm install robinhood-simple --save
To access most functionality one must use either the username
and password
of an active Robinhood account or a token
from a previously authenticated Robinhood session. For example:
var credentials = {
username: STRING,
password: STRING
}
// -- or --
var credentials = {
token: STRING
}
var Robinhood = require('robinhood-simple');
var robinhood = new Robinhood(credentials);
// robinhood is now ready to use!
After authenticating, you may now interact with the Robinhood API.
token()
accounts()
expire_token()
investment_profile()
instruments(symbol)
user()
dividends()
orders(options)
positions()
nonzero_positions()
place_buy_order(options)
place_sell_order(options)
fundamentals(symbol)
cancel_order(order)
watchlists(name)
create_watch_list(name)
sp500_up()
sp500_down()
splits(instrument)
historicals(symbol, intv, span)
url(url)
These examples assume that the robinhood
object has already been initialized as demonstrated above. Note, the robinhood module will automatically wait until authorization has completed before running any subsequent requests are made. In other words the following usage is supported:
var robinhood = new Robinhood(credentials);
robinhood.instruments("AAPL")
.then((body)=>{/* magic */})
token()
This resolves with the token after the robinhood
instance is authenticated.
robinhood.token()
.then((token)=>{
console.log(token) // don't share this! whoever has this can access your account.
})
accounts()
robinhood.accounts()
.then((body)=>{
console.log(body)
})
expire_token()
expire_token()
enables a user to log out and terminate the robinhood session, de-authorizing a specific token.
robinhood.expire_token()
.then(()=>{
console.log("logged out of robinhood and expired the token")
})
historicals()
var ticker = "AAPL";
var interval = "10minute"; // either `10minute` or `5minute`
var period = "day"; // either "day" or "week"
robinhood.historicals(ticker, interval, period)
.then((body)=>{
var historicals = body.historicals;
console.log(historicals);
/*
[
{ begins_at: '2018-01-16T14:30:00Z',
open_price: '245.3500',
close_price: '245.5400',
high_price: '246.0800',
low_price: '245.2100',
volume: 12701,
session: 'reg',
interpolated: false },
{ begins_at: '2018-01-16T14:40:00Z',
open_price: '245.6096',
close_price: '245.8100',
high_price: '245.8400',
low_price: '245.2400',
volume: 8133,
session: 'reg',
interpolated: false },
{ begins_at: '2018-01-16T14:50:00Z',
open_price: '245.7502',
close_price: '245.9100',
high_price: '246.0548',
low_price: '245.5861',
volume: 4569,
session: 'reg',
interpolated: false },
...
]
*/
})
instruments(symbol)
instruments(...)
is used to retreive detailed information about specific instruments (e.g., companies).
var ticker_symbol = "AAPL"; // use apple symbol for demo
robinhood.instruments(ticker_symbol)
.then((body)=>{
console.log(body);
// { previous: null,
// results:
// [ { min_tick_size: null,
// splits: 'https://api.robinhood.com/instruments/450dfc6d-5510-4d40-abfb-f633b7d9be3e/splits/',
// margin_initial_ratio: '0.5000',
// url: 'https://api.robinhood.com/instruments/450dfc6d-5510-4d40-abfb-f633b7d9be3e/',
// quote: 'https://api.robinhood.com/quotes/AAPL/',
// symbol: 'AAPL',
// bloomberg_unique: 'EQ0010169500001000',
// list_date: '1990-01-02',
// fundamentals: 'https://api.robinhood.com/fundamentals/AAPL/',
// state: 'active',
// day_trade_ratio: '0.2500',
// tradeable: true,
// maintenance_ratio: '0.2500',
// id: '450dfc6d-5510-4d40-abfb-f633b7d9be3e',
// market: 'https://api.robinhood.com/markets/XNAS/',
// name: 'Apple Inc. - Common Stock' } ],
// next: null }
})
From github.com/aurbano/robinhood-node:
Even though this should be obvious: I am not affiliated in any way with Robinhood Financial LLC. I don't mean any harm or disruption in their service by providing this. Furthermore, I believe they are working on an amazing product, and hope that by publishing this NodeJS framework their users can benefit in even more ways from working with them.
FAQs
A simple module to interact with the Robinhood API; incl. promise support, readable code, more
The npm package robinhood-simple receives a total of 4 weekly downloads. As such, robinhood-simple popularity was classified as not popular.
We found that robinhood-simple demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.