Can you bypass Robinhood’s buy restrictions via API? Let’s find out…

ParkCityUtah
2 min readJan 31, 2021

Author’s note: this piece is not investment advice; it is provided for entertainment and educational purposes only.

I’m sure you made the same assumption as me — no modern application would be so disjoint to allow different functionality from UI vs APi, that no major player would restrict functionality by simply disabling a button or throwing up an error BEFORE the underlying buy functionality (API) was triggered.

Well, unfortunately, you’d be surprised how many times I’ve seen functionality restrictions and security measures limited **only** to the user interface; we’re talking Enterprise applications from companies with billion-dollar valuations. The reality is many applications are monolithic, consist of legacy code written by different individuals and teams over many years of development. Time can absolutely be the enemy of quality and, in this case, Robinhood was under an immense deal of pressure to pivot and deploy updates to their codebase nearly immediately.

To test this you could simply search the Robinhood docs and use curl to execute your API calls but luckily I was able to find a Robinhood API wrapper in the form of a Python library. You can find (and clone) the repository here.

Since this is available in PyPI we’ll just use pip install:

pip install robin_stocks

You will of course be required to import robin_stocks. You can find the entirely of the script…

--

--

ParkCityUtah
ParkCityUtah

Written by ParkCityUtah

Engineer, Founder. 0x46ff5611679349eB517F511A73465F786e2EBDF8