Coder Social home page Coder Social logo

robinhood-api's People

Contributors

s0up avatar thisiskj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

robinhood-api's Issues

Request Routing error - unsafe method

I'm trying the sample code given:

`const RobinHood = require('robinhood-api');
const robinhood = new RobinHood();

(async () => {
try{
let loginResult = await robinhood.login({ username:'[email protected]', password:'mycoolpassword' });

let myUserData = await robinhood.getUserData();
console.log(myUserData);

}catch(e){
console.log('Oh noes! Login probably failed!', e);
}
})();`

Of course I am actually changing out [email protected] and mycoolpassword with my actual credentials, but I'm getting the error APIError: API Response Error. | Request routing error - unsafe method

User Historicals

Hey. I'm a little confused, hopefully I'm just missing something. Here is what I've got in an attempt to get historicals for the user.

// Auth into Robinhood
router.get('/auth', ensureAuthenticated, function(req, res){
    (async () => {
        try {
            let loginResult = await robinhood.login({ username:req.user.robinhood_user, password:req.user.robinhood_password });
			let account = await robinhood.getUserData();
			var opts = { 
				account_number:account.id, 
				interval:"day" 
			};
			let historicals = await robinhood.getHistoricals(opts);
            res.json(historicals);
        } catch(e) {
            console.log(e);
        }
    })();
});

and the error I'm getting says simply that

{ Error: API Response Error. | <h1>Not Found</h1><p>The requested URL /portfolios/historicals/<my account id>/ was not found on this server.</p>
    at RobinHood.request (C:\Users\Dylan\Documents\hunch2.0\node_modules\robinhood-api\index.js:144:18)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:169:7)
  additionalInfo: '<h1>Not Found</h1><p>The requested URL /portfolios/historicals/<my account id>/ was
not found on this server.</p>',
  code: 'E_API_ERROR' }

Is there another account number I should be using or is the API broken? What's up?

Thanks in advance for taking a look.

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.