NodeJS Framework to make trades with the private Robinhood API. Using this API is not encouraged, since it's not officially available and it has been reverse engineered. See this blog post for more information on the API.
I have read Robinhood's Terms and Conditions and, without being a lawyer and/or this being valid in any way, it doesn't seem like interacting with their servers using the API is against them.
This framework was inspired by a deprecated Python framework originally developed by @Rohanpai.
- Placing buy orders
Robinhood.place_buy_order
- Placing sell order
Robinhood.place_sell_order
- Quote Information
Robinhood.quote_data
- Get Dividend information
Robinhood.dividends (v0.2+)
- Get User information
Robinhood.user (v0.2+)
- Get Orders
Robinhood.orders (v0.2+)
- More coming soon...
$ npm install --save robinhood
var Robinhood = require('robinhood');
Robinhood(null).quote_data('GOOG', function(error, response, body) {
if (error) {
console.error(error);
process.exit(1);
}
console.log(body);
});
Before using these methods, make sure you have initialized Robinhood using the snippet above.
Feel free to send a pull request expanding this with examples or info about the return objects
Get the current user's investment profile.
Get the user's instruments for a specified stock.
Get the user's quote data for a specified stock.
Return message: (passed to the callback)
{
results: [
{
ask_price: String, // Float number in a String, e.g. '735.7800'
ask_size: Number, // Integer
bid_price: String, // Float number in a String, e.g. '731.5000'
bid_size: Number, // Integer
last_trade_price: String, // Float number in a String, e.g. '726.3900'
last_extended_hours_trade_price: String, // Float number in a String, e.g. '735.7500'
previous_close: String, // Float number in a String, e.g. '743.6200'
adjusted_previous_close: String, // Float number in a String, e.g. '743.6200'
previous_close_date: String, // YYYY-MM-DD e.g. '2016-01-06'
symbol: String, // e.g. 'GOOG'
trading_halted: Boolean,
updated_at: String, // YYYY-MM-DDTHH:MM:SS e.g. '2016-01-07T21:00:00Z'
}
]
}
Get the user's accounts.
Get the user information.
Get the user's dividends information.
Get the user's orders information.
Place a buy order on a specified stock.
Options must contain:
{
bid_price: Number,
quantity: Number,
instrument: {
url: String,
symbol: String
},
// Optional:
trigger: String, // Defaults to "gfd" (Good For Day)
time: String, // Defaults to "immediate"
type: String // Defaults to "market"
}
For the Optional ones, the values can be:
[Disclaimer: This is an unofficial API based on reverse engineering, and the following option values have not been confirmed]
A trade trigger is usually a market condition, such as a rise or fall in the price of an index or security.
Values can be:
gfd
: Good For Daygtc
: Good Till Cancelledoco
: Order Cancels Other
The time in force for an order defines the length of time over which an order will continue working before it is canceled.
Values can be:
immediate
: The order will be cancelled unless it is fulfilled immediately.day
: The order will be cancelled at the end of the trading day.
Place a sell order on a specified stock.
Options must contain:
{
bid_price: Number,
quantity: Number,
instrument: {
url: String,
symbol: String
},
// Optional:
trigger: String, // Defaults to "gfd" (Good For Day)
time: String, // Defaults to "immediate"
type: String // Defaults to "market"
}
For the Optional ones, the values can be:
[Disclaimer: This is an unofficial API based on reverse engineering, and the following option values have not been confirmed]
A trade trigger is usually a market condition, such as a rise or fall in the price of an index or security.
Values can be:
gfd
: Good For Daygtc
: Good Till Cancelledoco
: Order Cancels Other
The time in force for an order defines the length of time over which an order will continue working before it is canceled.
Values can be:
immediate
: The order will be cancelled unless it is fulfilled immediately.day
: The order will be cancelled at the end of the trading day.
- Alejandro U. Alvarez (@aurbano)
- Wei-Sheng Su (@ted7726)
- Alex Ryan (@ialexryan)
- Dustin Moore (@dustinmoorenet)
- Ben Van Treese (@vantreeseba)
- Jason Truluck (@jasontruluck)
- Justin Keller (@nodesocket)
- Chris Busse (@busse)
This framework is still in a very alpha version and will likely change, so production usage is completely discouraged.
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.