• Stars
    star
    1,652
  • Rank 28,305 (Top 0.6 %)
  • Language
  • License
    The Unlicense
  • Created over 8 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unofficial Documentation of Robinhood Trade's Private API

News

https://www.quantopian.com/posts/were-joining-robinhood

NOTICE: Consider this project dead.

I continued to keep this documentation up to date and it's now complete locally and until recently, I was happy to answer questions that wouldn't potentially expose a private, internal API, unreleased feature, or sensitive 3rd party data. But certain ones here have moved from friendly open source devs to angry, weird stalkers and have even used this documentation maliciously to steal assets and hijack accounts. Sadly, closing the issue tracker was only a temporary fix. Shuttering the project will be more permanent.

To the weird ones: Do not contact me about Robinhood. Do not send any more email. Do not text me. Do not call me anymore. Do not cyberstalk my teenage family member and leave messages for me on her voicemail anymore. Stop offering money to help you. I will not.

To everyone else: Bad actors, profiteers, and scammers have created a situation that puts us all at risk of having our accounts closed. I suggest you find ways to distance yourselves. These people have pushed Robinhood into making drastic changes to their API, shutting down established partnerships, and enforcing their customer agreements. If you haven't been contacted by an automated support agent yet for using the API directly, don't be too surprised if you are in the near future.

I'm not sure what will happen to this repo yet but I have had a good relationship with RH HQ since there was a waiting list to even create an account and I intend to stay in their good graces. I will not plug one here but commission-free firms exist that are designed to be accessed via their API. If that's in line with your plans, use one of those firms.


**NOTICE: I do not need pull requests or other contributions of endpoints!

Unofficial Documentation of Robinhood Trade's Private API

Table of Contents:

See also

  • Authentication.md for methods related to user authentication, password recovery, etc.
  • Banking.md for bank accounts & ACH transfers methods
  • Order.md for order-related functions (placing, cancelling, listing previous orders, etc.)
  • Options.md for options related endpoints
  • Quote.md for stock quotes
  • Fundamentals.md for basic, fundamental data
  • Instrument.md for internal reference to financial instruments
  • Watchlist.md for watchlists management
  • Account.md talks about gathering and modifying user and account information
  • Settings.md covers notifications and other settings
  • Markets.md describes the API for getting basic info about specific exchanges themselves
  • Referrals.md is all about account referrals
  • Statistics.md exposes the new social/statistical endpoints
  • Tags.md exposes the new categorizing endpoints

Things I have yet to organize are in Unsorted.md

Introduction

Robinhood is a commission-free, online securities brokerage. As you would expect, being an online service means everything is handled through a request that is made to a specific URL.

API Security

The HTTPS protocol is used to access the Robinhood API. Transactions require security because most calls transmit actual account informaion. SSL Pinning is used in the official Android and iOS apps to prevent MITM attacks; you would be wise to do the same at the very least.

Calls to API endpoints make use of two different levels of authentication:

  1. None: No authentication. Anyone can query the method.
  2. Token: Requires an authorization token generated with a call to log in.

Calls which require no authentication are generally informational (quote gathering, securities lookup, etc.).

Authorized calls require an Authorization HTTP Header with the authentication type set as Token (Example: Authorization: Token 40charauthozationtokenherexxxxxxxxxxxxxx).

API Error Reporting

The API reports incorrect data or improper use with HTTP status codes and JSON objects returned as body content. Some that I've run into include:

HTTP Status Key Value What I Did Wrong
400 non_field_errors ["Unable to log in with provided credentials."] Attempted to log in with incorrect username/password
400 password ["This field may not be blank."] Attempted to log in without a password
401 detail ["Invalid token."] Attempted to use cached token after logging out
400 password ["This password is too short. It must contain at least 10 characters.", "This password is too common."] Attempted to change my password to password

...you get the idea. Letting you know exactly what went wrong makes the API almost self-documenting so thanks Robinhood.

Pagination

Some data is returned from the Robinhood API as paginated data with next and previous cursors already in URL form.

If your call returns paginated data, it will look like this call to https://api.robinhood.com/instruments/:

{
    "previous": null,
    "results": [{
        "splits" : "https://api.robinhood.com/instruments/42e07e3a-ca7a-4abc-8c23-de49cb657c62/splits/",
        "margin_initial_ratio" : "1.0000",
        "url" : "https://api.robinhood.com/instruments/42e07e3a-ca7a-4abc-8c23-de49cb657c62/",
        "quote" : "https://api.robinhood.com/quotes/SBPH/",
        "symbol" : "SBPH",
        "bloomberg_unique" : "EQ0000000028928752",
        "list_date" : null,
        "fundamentals" : "https://api.robinhood.com/fundamentals/SBPH/",
        "state" : "active",
        "tradeable" : true,
        "maintenance_ratio" : "1.0000",
        "id" : "42e07e3a-ca7a-4abc-8c23-de49cb657c62",
        "market" : "https://api.robinhood.com/markets/XNAS/",
        "name" : "Spring Bank Pharmaceuticals, Inc. Common Stock"
    },
        ...
    ],
    "next": "https://api.robinhood.com/instruments/?cursor=cD04NjUz"
}

To get the next page of results, just use the next URL.

Semi-Pagination

Some data is returned as a list of results as if they were paginate but the API doesn't supply us with previous or next keys.

More Repositories

1

Finance-Robinhood

Trade stocks and ETFs with free brokerage Robinhood and Perl
Perl
44
star
2

readonly

Facility for creating read-only scalars, arrays, hashes
Perl
16
star
3

net-bittorrent

Perl based BitTorrent module available on CPAN
Perl
13
star
4

robinhood_rs

Rust wrapper for Robinhood, the commission-free brokerage
Rust
12
star
5

template-liquid

Perl port of Shopify's Liquid markup language. Safe, customer facing template language for flexible web apps.
Perl
9
star
6

net-bittorrent-dht

Kademlia-like BitTorrent DHT Node in Perl
Perl
8
star
7

fltk-2.0.x

My changes to the fltk2 codebase which may eventually make it to the upstream SVN
C++
8
star
8

rubytorrent

Ruby BitTorrent library
Ruby
7
star
9

FFI-SDL3.pm

SDL3 wrapper for Perl written with FFI::Platypus
Perl
6
star
10

Fl.pm

Perl Bindings to the 1.3.x Branch of Fltk
Perl
5
star
11

device-mx240a

Motorola IMFree (MX240a) Device Interface
Perl
5
star
12

perl-fltk

Perl interface to the (experimental) 2.0.x branch of the FLTK GUI toolkit
Perl
5
star
13

anyevent-msn

My Modern MSN Messenger Module
Perl
4
star
14

acme-cpanauthors-acme-cpanauthors-authors

We are CPAN authors who have authored Acme::CPANAuthors modules.
Perl
3
star
15

RPi-UnicornHatHD

Perl wrapper for the Unicorn Hat HD by Pimoroni
Perl
3
star
16

anyevent-bittorrent

Basic, Easily Extended BitTorrent Client built on AnyEvent
Perl
3
star
17

perl4mirc

Dll which allows users to run perl directly from mIRC's edit box and embed perl snippets in msl scripts
C
3
star
18

Finance-Alpaca

Perl Wrapper for Alpaca's Commission-free Stock Trading API
Perl
3
star
19

digest-xxhash

Perl wrapper for the xxHash hashing algorithm
Perl
2
star
20

alien-fltk2

Installs libraries for the (experimental) 2.0.x branch of the Fast Light Toolkit
Perl
2
star
21

config-ipfilter

IPFilter.dat parser
Perl
2
star
22

MMS

The stock Android SMS/MMS app converted to an SDK app.
Java
2
star
23

Termbox.pm

Perl bindings to Termbox
Perl
2
star
24

alien-fltk

Installs libraries for the (stable) 1.3.x branch of the Fast Light Toolkit
Perl
2
star
25

net-bittorrent-protocol

Basic, Protocol-level BitTorrent Utilities
Perl
2
star
26

anyevent-handle-throttle

AnyEvent::Handle subclass with user-defined up/down bandwidth cap
Perl
2
star
27

At.pm

The Bluesky Protocol for Social Networking in Perl
Perl
2
star
28

perl-fl

Perl interface to the (current, stable) 1.3.x branch of the FLTK GUI toolkit
Prolog
2
star
29

Readonly-XS

Release history of Readonly-XS
C
1
star
30

www-thisismyjam

ThisIsMyJam.com and this project have both been archived
Perl
1
star
31

Reddit-Bot

A Reddit Bot Framework Developed in Perl
Perl
1
star
32

Affix.pm

A Foreign Function Interface eXtension for Perl
C
1
star
33

Template-LiquidX-Tag-Include

Perl
1
star
34

php4mIRC

Embed my least favorite language in my least favorite client. Ah, free time well spent...
C++
1
star
35

Template-LiquidX-Tag-Dump

Simple Data Dumping Tag for Template::Liquid
Perl
1
star
36

Lenovo-CD-17302F_opensource_15.42.1

Open Source Code - Lenovo Smart Display 7 (CD-17302F)
Java
1
star
37

mbx-alien-fltk

[git submodule] Module::Build subclass for Alien::FLTK and Alien::FLTK2
Perl
1
star
38

demo2

1
star
39

demo

1
star
40

enabler

1
star
41

Dyn.pm

Low Level wrapper of dyncall for Creating your own FFI in Perl
C
1
star
42

Acme-ICan-tBelieveItCanSort

Acme::ICan'tBelieveItCanSort
Perl
1
star
43

unicornhathd_rs

Rust wrapper for the Unicorn Hat HD by Pimoroni
1
star
44

Alien-libsdl2

Alien dist to build and use libsdl2
Perl
1
star
45

enablr

1
star