├── .gitignore ├── test1_auth.js ├── robinhood.js ├── package.json └── test2_fundamentals.js /.gitignore: -------------------------------------------------------------------------------- 1 | usrpass.js 2 | credentials.js 3 | credential.js 4 | node_modules -------------------------------------------------------------------------------- /test1_auth.js: -------------------------------------------------------------------------------- 1 | var credentials = require("./credentials.js"); 2 | 3 | var Robinhood = require('robinhood')(credentials, function(){ 4 | console.log(Robinhood.auth_token()); 5 | // 6 | }); -------------------------------------------------------------------------------- /robinhood.js: -------------------------------------------------------------------------------- 1 | var Robinhood = require('robinhood')(credentials, function(){ 2 | 3 | //Robinhood is connected and you may begin sending commands to the api. 4 | 5 | Robinhood.quote_data('GOOG', function(error, response, body) { 6 | if (error) { 7 | console.error(error); 8 | process.exit(1); 9 | } 10 | console.log(body); 11 | }); 12 | 13 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "auto-trade", 3 | "version": "1.0.0", 4 | "description": "Private App to help trade", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "robinhood" 11 | ], 12 | "author": "Shan", 13 | "license": "ISC", 14 | "dependencies": { 15 | "robinhood": "^1.1.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test2_fundamentals.js: -------------------------------------------------------------------------------- 1 | var credentials = require('./credentials.js'); 2 | var Robinhood = require('robinhood')(credentials, function(){ 3 | Robinhood.fundamentals("SBPH", function(error, response, body){ 4 | if(error){ 5 | console.error(error); 6 | }else{ 7 | console.log(body); 8 | //{ // Example for SBPH 9 | // average_volume: string, // "14381.0215" 10 | // description: string, // "Spring Bank Pharmaceuticals, Inc. [...]" 11 | // dividend_yield: string, // "0.0000" 12 | // high: string, // "12.5300" 13 | // high_52_weeks: string, // "13.2500" 14 | // instrument: string, // "https://api.robinhood.com/instruments/42e07e3a-ca7a-4abc-8c23-de49cb657c62/" 15 | // low: string, // "11.8000" 16 | // low_52_weeks: string, // "7.6160" 17 | // market_cap: string, // "94799500.0000" 18 | // open: string, // "12.5300" 19 | // pe_ratio: string, // null (price/earnings ratio) 20 | // volume: string // "4119.0000" 21 | //} 22 | } 23 | }) 24 | }); --------------------------------------------------------------------------------