https://github.com/andrewstuart/go-robinhood
A golang library for interacting with the Robinhood private API
https://github.com/andrewstuart/go-robinhood
golang options robinhood stocks trading
Last synced: 6 months ago
JSON representation
A golang library for interacting with the Robinhood private API
- Host: GitHub
- URL: https://github.com/andrewstuart/go-robinhood
- Owner: andrewstuart
- License: apache-2.0
- Created: 2017-06-09T07:59:07.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-11-23T18:37:38.000Z (almost 2 years ago)
- Last Synced: 2025-03-24T16:46:18.085Z (6 months ago)
- Topics: golang, options, robinhood, stocks, trading
- Language: Go
- Size: 1.98 MB
- Stars: 68
- Watchers: 7
- Forks: 34
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/astuart.co/go-robinhood/v2)
# Robinhood the rich and feeding the poor, now automated
> Even though robinhood makes me poor
## Notice
### 2022-05-24
Robinhood updated their API and our auth method broke. The new authentication
requires using your email as your username, so if you see an error message about
an invalid email, you'll need to update your username.### 2018-09-27:
If you have used this library before, and use credential caching, you will need
to remove any credential cache and rebuild if you experience errors.## General usage
```go
cli, err := robinhood.Dial(&robinhood.OAuth{
Username: "my.email@example.com",
Password: "mypasswordissecure",
})// err
i, err := cli.GetInstrumentForSymbol("SPY")
// err
o, err := cli.Order(i, robinhood.OrderOpts{
Price: 100.0,
Side: robinhood.Buy,
Quantity: 1,
})// err
time.Sleep(5*time.Second) //Let me think about it some more...
// Ah crap, I need to buy groceries.
err := o.Cancel()
if err != nil {
// Oh well
}
```