Short answer: The official Robinhood API is the Robinhood Crypto Trading API, a REST API for US Robinhood Crypto customers that signs each request with an Ed25519 key. As read on 26 November 2026, Robinhood publishes no REST API for stocks or options; its only documented software route to them is the Trading MCP server for AI agents, which trades in a dedicated account.
Sources are Robinhood's own documentation, Help Center and agreements, read on 26 November 2026. No account or key was used. Nothing here recommends Robinhood or a strategy, and automated trading can lose money.
Does Robinhood have an API for stocks?
Not a public one: Robinhood's developer documentation covers only crypto.
| Route | Assets | Who can use it | Authentication |
|---|---|---|---|
| Crypto Trading API (REST) | Crypto | US Robinhood Crypto customers | API key and Ed25519 signature |
| Trading MCP | Equities, options, crypto | Holders of a primary individual account in good standing | An authentication step when the AI client connects |
| Robinhood Connect | Crypto on-ramp and off-ramp | Partner apps, after an NDA | Application ID and app key from Robinhood |
The documentation site's build manifest lists only /crypto/trading and /crypto/connect.
The Trading MCP is a Model Context Protocol server at agent.robinhood.com/mcp/trading. Per the Help Center, the agent reads all your accounts and order history but trades only in the MCP account, one of at most 10 self-directed individual accounts. Trade approvals are off by default for MCP accounts, and agent crypto trading is unavailable in some states, including New York. See LLM trading bot for a pre-trade gate and stock trading API for other brokers.
Robinhood crypto API: endpoints, v1, v2 and fee tiers
The Crypto Trading API offers the same eight operations in two versions on https://trading.robinhood.com, and only v2 places orders with fee tiers.
| Method and path | Returns or does |
|---|---|
GET /api/v2/crypto/trading/accounts/ | Buying power, fee tier status |
GET /api/v2/crypto/trading/trading_pairs/ | Increments, max_order_size, min_order_amount |
GET /api/v2/crypto/trading/holdings/ | Total and tradable quantity |
GET /api/v2/crypto/marketdata/best_bid_ask/ | Best bid and ask |
GET /api/v2/crypto/trading/estimated_price/ | Price for a quantity, with estimated fee |
GET, POST /api/v2/crypto/trading/orders/ | List or place orders |
POST /api/v2/crypto/trading/orders/{id}/cancel/ | Cancel an open order |
- Account number. v2 orders, order lists and holdings take
account_numberin the query string, which the signature covers. - Fee tiers. Only v2 orders count toward fee-tier volume, and v1 has no deprecation timeline, per the Help Center.
- Orders. Types:
market,limit,stop_limit,stop_loss; time in force:gtc,gfd,gfw,gfm. The schema calls quantities numbers, yet every example sends strings.
How to create a Robinhood API key
You create an Ed25519 key pair locally and register the public key in your crypto account settings on Robinhood's web classic site, which issues the API key.
- Generate the pair, for example with the documentation's PyNaCl script.
- In web classic, open crypto account settings and select Add key.
- Add the public key and enable only the API actions you need.
- Keep the API key; those issued after 13 August 2024 start with
rh-api-.
The private key stays with you; Robinhood says it will never ask for it. No key limit or IP allowlist is documented. See API key security for trading bots and Ed25519 API key.
Robinhood API signature: the documented example and a trap
Each request sends x-api-key, x-timestamp (Unix seconds, valid for 30 seconds) and x-signature: the base64 Ed25519 signature of API key, timestamp, path, method and body concatenated, the body omitted when empty.
Test vector check, 26 November 2026. Ed25519 signatures are deterministic (RFC 8032), so the documented example is a test vector. Its table shows a compact JSON body, yet its signature is reproduced only from the Python dictionary text that the accompanying snippet signs. Robinhood's full client script signs the JSON it sends.
Match the vector to prove your signing code, then sign exactly the bytes you send; whether the server verifies the raw body could not be tested without a key. Other schemes are in API signature generation.
Robinhood API Python: tested signing against a local mock
The code reproduces the vector, then signs requests with a throwaway key against a local mock that verifies signatures; it ran on 26 November 2026 with Python 3.11.3, PyNaCl 1.6.2 and requests 2.31.0.
import base64, json, threading, time, uuid
from decimal import Decimal, InvalidOperation
from http.server import BaseHTTPRequestHandler, HTTPServer
import requests
from nacl.exceptions import BadSignatureError
from nacl.signing import SigningKey
def sign(signer, api_key, ts, path, method, body=""):
msg = f"{api_key}{ts}{path}{method}{body}".encode()
return base64.b64encode(signer.sign(msg).signature).decode()
# Documented example values (published samples, not a live key)
doc_key = SigningKey(base64.b64decode("xQnTJVeQLmw1/Mg2YimEViSpw/SdJcgNXZ5kQkAXNPU="))
doc = ("rh-api-6148effc-c0b1-486c-8940-a1d099456be6", "1698708981", "/api/v1/crypto/trading/orders/", "POST")
doc_sig = "q/nEtxp/P2Or3hph3KejBqnw5o9qeuQ+hYRnB56FaHbjDsNUY9KhB1asMxohDnzdVFSD7StaTqjSd9U9HvaRAw=="
table_json = ('{"client_order_id":"131de903-5a9c-4260-abc1-28d562a5dcf0","side":"buy","type":"market",'
'"symbol":"BTC-USD","market_order_config":{"asset_quantity":"0.1"}}')
snippet_dict = {"client_order_id": "131de903-5a9c-4260-abc1-28d562a5dcf0", "side": "buy",
"symbol": "BTC-USD", "type": "market", "market_order_config": {"asset_quantity": "0.1"}}
print("vector, JSON body from the table:", sign(doc_key, *doc, table_json) == doc_sig)
print("vector, Python dict text:", sign(doc_key, *doc, str(snippet_dict)) == doc_sig)
class ApiError(Exception):
pass
def quantity(value, increment):
try:
q = Decimal(str(value))
ok = q.is_finite() and q > 0 and q % Decimal(increment) == 0
except InvalidOperation:
ok = False
if not ok:
raise ValueError(f"bad quantity {repr(value)}")
return format(q, "f")
def find_by_client_id(orders, client_order_id): # after a timeout; never guess
client_order_id = str(uuid.UUID(client_order_id))
hits = [o for o in orders if o.get("client_order_id") == client_order_id]
if len(hits) > 1:
raise ApiError(f"{len(hits)} orders share client_order_id {client_order_id}")
return hits[0] if hits else None
class Client:
def __init__(self, api_key, private_key_b64, base):
if not (api_key and private_key_b64): # fail before any network call
raise ValueError("API key and private key are both required")
seed = base64.b64decode(private_key_b64, validate=True)
self.key, self.signer, self.base = api_key, SigningKey(seed), base
self.http = requests.Session()
def call(self, method, path, payload=None):
body = json.dumps(payload, separators=(",", ":")) if payload else ""
ts = str(int(time.time()))
headers = {"x-api-key": self.key, "x-timestamp": ts, "Content-Type": "application/json",
"x-signature": sign(self.signer, self.key, ts, path, method, body)}
r = self.http.request(method, self.base + path, data=body.encode() or None,
headers=headers, timeout=10) # send exactly the signed bytes
if r.status_code >= 400:
try:
err = r.json()
except ValueError:
err = None
err = err if isinstance(err, dict) else {}
detail = "; ".join(str(e.get("detail")) for e in err.get("errors") or [] if isinstance(e, dict))
raise ApiError(f"HTTP {r.status_code} {err.get('type', 'no JSON')}: {detail or r.text[:60]}")
return r.json()
def list_all(self, path): # follows next; refuses a foreign URL
rows = []
while path:
page = self.call("GET", path)
rows += page.get("results") or []
nxt = page.get("next")
if nxt and not nxt.startswith(self.base + "/"):
raise ApiError(f"unexpected next URL {nxt[:60]}")
path = nxt[len(self.base):] if nxt else None
return rows
def market_order(self, account, symbol, side, qty, increment, client_order_id):
client_order_id = str(uuid.UUID(client_order_id)) # canonical; empty or malformed fails
order = {"client_order_id": client_order_id, "side": side, "type": "market", "symbol": symbol,
"market_order_config": {"asset_quantity": quantity(qty, increment)}}
return self.call("POST", f"/api/v2/crypto/trading/orders/?account_number={account}", order)
# Local mock that verifies signatures, not Robinhood's server
KEYS, ORDERS = {}, []
class Mock(BaseHTTPRequestHandler):
def log_message(self, *args):
pass
def reply(self, code, text):
self.send_response(code)
self.end_headers()
self.wfile.write(text.encode())
def do_POST(self):
self.do_GET("POST")
def do_GET(self, method="GET"):
if self.path == "/down":
return self.reply(503, "upstream unavailable")
body = self.rfile.read(int(self.headers.get("Content-Length") or 0)).decode()
key, ts = self.headers.get("x-api-key", ""), self.headers.get("x-timestamp", "")
try:
KEYS[key].verify(f"{key}{ts}{self.path}{method}{body}".encode(),
base64.b64decode(self.headers.get("x-signature", "")))
except (KeyError, ValueError, BadSignatureError) as e:
error = {"type": "client_error", "errors": [{"attr": None, "detail": str(e)}]}
return self.reply(401, json.dumps(error))
if method == "POST":
ORDERS.append(dict(json.loads(body), id=str(uuid.uuid4()), state="filled"))
return self.reply(201, json.dumps(ORDERS[-1]))
page2 = "cursor=2" in self.path
nxt = None if page2 or len(ORDERS) < 2 else f"{base}{self.path}&cursor=2"
self.reply(200, json.dumps({"next": nxt, "results": ORDERS[1:] if page2 else ORDERS[:1]}))
server = HTTPServer(("127.0.0.1", 0), Mock)
threading.Thread(target=server.serve_forever, daemon=True).start()
base = f"http://127.0.0.1:{server.server_port}"
local = SigningKey.generate() # throwaway key pair
api_key = f"rh-api-{uuid.uuid4()}"
KEYS[api_key] = local.verify_key
client = Client(api_key, base64.b64encode(bytes(local)).decode(), base)
INC, cid = "0.00000001", str(uuid.UUID(int=1)) # hypothetical increment; fixed ID for repeatable output
orders_path = "/api/v2/crypto/trading/orders/?account_number=A1"
tests = {
"float 1e400": lambda: quantity(float("1e400"), INC),
"no key": lambda: Client("", "", base),
"empty client ID": lambda: client.market_order("A1", "BTC-USD", "buy", "0.0005", INC, ""),
"order": lambda: client.market_order("A1", "BTC-USD", "buy", "0.0005", INC, cid)["state"],
"plain-text 503": lambda: client.call("GET", "/down"),
"lookup": lambda: find_by_client_id(client.list_all(orders_path), cid)["state"],
"same ID, page 1 only": lambda: ORDERS.append(dict(ORDERS[0]))
or find_by_client_id(client.call("GET", orders_path)["results"], cid)["state"],
"same ID, all pages": lambda: find_by_client_id(client.list_all(orders_path), cid),
}
for name, test in tests.items():
try:
print(f"{name}: {test()}")
except (ValueError, ApiError) as err:
print(f"{name}: rejected, {err}")Output:
vector, JSON body from the table: False
vector, Python dict text: True
float 1e400: rejected, bad quantity inf
no key: rejected, API key and private key are both required
empty client ID: rejected, badly formed hexadecimal UUID string
order: filled
plain-text 503: rejected, HTTP 503 no JSON: upstream unavailable
lookup: filled
same ID, page 1 only: filled
same ID, all pages: rejected, 2 orders share client_order_id 00000000-0000-0000-0000-000000000001Floats pass through text, so 1e400 becomes infinity and is refused. Reading only the first page silently picks one of two matching orders; following next exposes the clash. Network errors propagate on purpose: after a POST they leave the order's fate unknown.
Robinhood API rate limit, errors and timeouts
The documentation allows 100 requests per minute per user account, with bursts to 300, through a token bucket per endpoint whose values may change with load.
Error bodies carry type and a list of attr and detail; 429 means too many requests. Under backup withholding, sell orders get 422 until the tax status is confirmed. No retry header is documented, so pace calls yourself, as in token bucket rate limiter in Python.
A timeout on placing an order is the hard case: client_order_id serves idempotency validation, but the reply to a repeated ID is undocumented and order lists cannot be filtered by it. Keep the ID, list orders created since just before the attempt, follow next and match, refusing to guess between two. See client order ID.
Unofficial Robinhood API libraries and account terms
Treat unofficial libraries as a risk, never a route around Robinhood's terms.
- Libraries.
robin_stocks3.4.0 (uploaded 18 May 2025, PyPI read 26 November 2026) describes itself as a Python interface to the Robinhood API, among others, for stocks, options and crypto; an individual publishes it, not Robinhood. Undocumented endpoints can change without notice, and a tool asking for your login wants credentials the customer agreement says to keep secret. - Consent. Section 29 of the brokerage Customer Agreement (revised 2 November 2026) and section 20 of the Robinhood Crypto Customer Agreement (revised 3 November 2026) bar using the API Package or developing Licensee Products without Robinhood's express written consent. They do not say how this applies to a script for your own account; a product for others needs that consent.
- Personal use and routing. The same sections limit API Products to personal use, warn that API orders may be routed differently, with possibly adverse execution quality and/or speed, and let Robinhood disable API or MCP access, including for excessive market data usage.
Rules depend on your country; read the agreements and take legal advice. Options, futures and leverage carry high risk. For readers in Turkey, Article 99/A of Capital Markets Law No. 6362 treats activity by foreign crypto-asset platforms directed at Turkish residents as unauthorized, and the Capital Markets Board (SPK) said on 23 February 2023 that residents may trade on leverage only through institutions it has authorized, with access blocks and criminal penalties for unauthorized offers (Law No. 6362 Articles 99(4) and 109(2)). For integration work in general, see broker API integration; naming Robinhood here does not mean Fincode integrates it or has built on it.
Related guide: E*TRADE API Python · Webull API.
Frequently asked questions
Does Robinhood have an API for stocks?
Not a public REST API, as read on 26 November 2026. Its only documented software route to equities and options is the Trading MCP for AI agents.
How do I get a Robinhood API key?
Generate an Ed25519 key pair, then select Add key in your crypto account settings on Robinhood's web classic site, add the public key and choose the API actions.
Is there an official Robinhood Python library?
No packaged SDK: the documentation offers sample scripts built on PyNaCl and requests. Packages such as robin_stocks are not Robinhood's.
Can I use the Robinhood crypto API outside the US?
No. The documentation says it is available to customers in the United States only.
Sources
- Robinhood Crypto Trading API documentation (authentication, rate limiting, errors, v1 and v2 endpoints) (opens in a new tab)
- Robinhood Help Center: Robinhood Crypto Trading API (versions, fee tiers, getting started) (opens in a new tab)
- Robinhood Help Center: Onboarding an external agent (Trading MCP, MCP account) (opens in a new tab)
- Robinhood Help Center: Trading with your agent (tools, order types, trade approvals, state restrictions) (opens in a new tab)
- Robinhood Connect documentation (partner on-ramp and off-ramp) (opens in a new tab)
- Robinhood Financial and Robinhood Securities Customer Agreement, revised 2 November 2026 (section 29, API and MCP) (opens in a new tab)
- Robinhood Crypto Customer Agreement, revised 3 November 2026 (section 20, API and MCP) (opens in a new tab)
- PyPI: robin-stocks 3.4.0 (unofficial, uploaded 18 May 2025) (opens in a new tab)
- RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA) (opens in a new tab)
- Capital Markets Law No. 6362, consolidated text, Articles 99, 99/A and 109 (Turkish) (opens in a new tab)
- SPK (Capital Markets Board): Notice on unauthorized leveraged transactions, 23 February 2023 (Turkish) (opens in a new tab)
This guide is general information about software and markets, not investment, legal or tax advice. Automated trading can lose money, past or backtested performance does not guarantee future results, and the rules that apply depend on your jurisdiction and your exchange's terms. Sources, checks and corrections: see the editorial policy.