Git Product home page Git Product logo

robinhood-node's Introduction

Travis npm David

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.

Features

  • 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...

Installation

$ npm install --save robinhood

Usage

var Robinhood = require('robinhood');

Robinhood(null).quote_data('GOOG', function(error, response, body) {
    if (error) {
        console.error(error);
        process.exit(1);
    }

    console.log(body);
});

API

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

investment_profile(callback)

Get the current user's investment profile.

instruments(stock, callback)

Get the user's instruments for a specified stock.

quote_data(stock, callback) // Not authenticated

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'
        }
    ]
}

accounts(callback)

Get the user's accounts.

user(callback)

Get the user information.

dividends(callback)

Get the user's dividends information.

orders(callback)

Get the user's orders information.

place_buy_order(options, callback)

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]

trigger

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 Day
  • gtc: Good Till Cancelled
  • oco: Order Cancels Other

time

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_sell_order(options, callback)

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]

trigger

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 Day
  • gtc: Good Till Cancelled
  • oco: Order Cancels Other

time

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.

Contributors


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.

Analytics

robinhood-node's People

Contributors

aurbano avatar nodesocket avatar ted7726 avatar dustinmoorenet avatar ialexryan avatar vantreeseba avatar busse avatar

Watchers

 avatar  avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.