/algo-trading-skills:robinhood-unofficial-api-integrationfrom algo-trading-skills
Evaluates programmatic access to Robinhood accounts, covering contractual restrictions, unofficial endpoints, and official alternatives like the Agentic Trading MCP server and Crypto Trading API.
Ships in algo-trading-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Use this when evaluating — or, having obtained Robinhood's consent, building — programmatic access to a Robinhood brokerage account for US equities.
Start with the contractual finding, because it is usually the whole answer.
The RHF-RHS Customer Agreement (effective 2026-07-02) states in §29.1 that a
customer "may not use the API Package or develop Licensee Products without
Robinhood's express written consent (and Robinhood may decline any such request
for use or development in its sole discretion)", and in §4.7 that "You agree
not to allow any person access to your Account, your Account username or
password, or permit any other person to give orders or instructions on your
Account to Robinhood, without the prior consent of Robinhood." Credential-based
automation of api.robinhood.com is squarely inside both clauses.
And there is now a supported path that did not exist when tooling like this was
written. Robinhood opened its Agentic Trading MCP server —
https://agent.robinhood.com/mcp/trading — to third-party agents for stocks and
options on 2026-05-27 and for crypto on 2026-07-20, free to eligible US
customers, and has published a Crypto Trading API at https://docs.robinhood.com/
since 2024. If your use case is covered there, this skill's answer is to route
through the supported surface, not these endpoints.
If you proceed anyway, this skill covers what the unofficial integration must get
right: device-token persistence, a login flow that an mfa_code no longer
satisfies, ref_id as the only reconciliation handle on an order, and a
/positions/ response that is paginated and carries no ticker symbol.
broker-agnostic-adapter-interface to keep the strategy
portable.headless-broker-auth-patterns before designing around this.market-data-entitlement-and-licensing-per-venue.kill-switch-and-drawdown-circuit-breakers
and sec-rule-15c3-5-risk-controls-us.new_device_token(), written
to durable storage, and reused on every login thereafter.http_fn transport, so timeouts and TLS verification stay
under caller control.client_id you are authorised to use. The reference client ships no
default: the id community libraries pass is harvested from Robinhood's own web
client, and redistributing it is part of the contractual problem this skill exists
to surface.Resolve the contractual question before writing any code.
Load the persisted device token; never mint one at start-up.
RobinhoodUnofficialClient refuses to
construct without one.Authenticate, and classify the challenge before deciding what to do.
POST /oauth2/token/ with client_id, grant_type=password, username,
password, device_token, scope=internal.verification_workflow is not an MFA code prompt. It
is Robinhood's device-approval flow, completed by tapping a prompt in the
mobile app; no mfa_code satisfies it. Check for it before reading
access_token: it can arrive on a 200, and treating that as success
installs a session that does not exist. It raises
RobinhoodDeviceApprovalRequired, carrying the workflow id for a caller
that implements the out-of-band poll itself.mfa_required raises RobinhoodMFARequired with the reported mfa_type.
Both subclass RobinhoodAuthError, so a caller catching the base class is
unaffected; classify on the type, never by substring-matching the message.expires_in. A client that assumes a
lifetime the server did not state keeps using a dead token, and every
subsequent call 401s for a reason nothing in the logs explains. A missing or
non-numeric value is fatal. Expiry is tracked against a monotonic deadline
so a clock step cannot resurrect or kill a session.Submit orders with a client-generated ref_id, and treat a lost response as
ambiguous.
account URL, the instrument URL, symbol,
side, type, quantity, time_in_force, trigger and ref_id.ref_id is the only handle you control. Reuse the same
value when resubmitting a logically identical order; generate a new one for
a genuinely new order. Robinhood publishes no idempotency contract for it,
so treat it as a reconciliation key first and a duplicate guard second.RobinhoodAmbiguousOrderError carries the ref_id; reconcile against order
history before any resubmission. See order-placement-idempotency.type you send. Size and monitor
accordingly.Poll /positions/ across every page, and never fabricate a symbol.
instrument
URL only. Defaulting the missing field to a placeholder makes every position
reconcile as the same fake symbol. RobinhoodPosition.symbol stays None
unless a caller-supplied symbol_resolver fills it.next to completion; exceeding
max_pages, or a looping cursor, raises rather than returning a truncated
portfolio.?nonzero=true and filter locally on quantity != 0 — a negative
quantity is a real exposure, not noise to drop.Full step-by-step procedure: see
references/workflows.md. Verified endpoints, fields and sources: seereferences/standards.md. Printable pre-flight checklist: seeassets/checklist.md.
mfa_code to complete a login. Robinhood has moved to in-app
device approvals, and approvals reach only a trusted device — which a
headless host never is. Community wrappers break on this repeatedly.verification_workflow as a successful login.
The session was not issued; the next authenticated call fails without a clear
cause.expires_in. The client then believes a dead token is live.ref_id. After a timeout there is then no
handle to reconcile with, and the only options are "retry and risk a duplicate"
or "do nothing and risk an unmanaged position".ref_id first./accounts/MOCK/). A guessed account URL addresses the wrong account, and a
placeholder one guarantees rejection./orders/ keys the security off the
instrument URL; the ticker alone is not enough.symbol on a position to a placeholder. Every real
position then reports the same fake ticker. An absent symbol is correct; a
fabricated one corrupts every downstream report./positions/. Silent portfolio truncation,
and it looks exactly like a correct empty-tail response.> 0 filter. That is exposure
disappearing from a risk view.AuthToken reach a log. Exclude access and refresh tokens from
repr, and never echo an auth response body into an exception message.device_token
(the pre-2.0 constructor sent a different one every time — that is the
regression).verification_workflow raises
RobinhoodDeviceApprovalRequired with the workflow id, is not a
RobinhoodMFARequired, and installs no session — including when it arrives
alongside a 200 with an access_token.mfa_required raises with the reported mfa_type and no session;
the retry with mfa_code succeeds. Both exceptions remain RobinhoodAuthError
subclasses.expires_in is fatal;
expiry decisions follow a monotonic deadline; an expired token blocks both
order placement and position polling.repr() of a token or client must not contain the
access or refresh token.ref_id, the configured
account URL (never MOCK) and the supplied instrument URL; a caller-supplied
ref_id is sent verbatim on both attempts of a resubmission; distinct orders
get distinct ids.0, -1, NaN, inf, "10", None and
True, a LIMIT order with no or non-positive price, and extended-hours on a
market order each raise before anything is dispatched — the transport must
record zero order calls.RobinhoodAmbiguousOrderError
carrying the ref_id and records no order; a 2xx with no id does the same; a
definitive HTTP 400 rejection raises RobinhoodOrderError instead.symbol is None, never a placeholder, and the instrument URL
is preserved; a resolver fills the ticker; a two-page response returns both
positions (page-one-only returned one — that is the regression); the first
request carries nonzero=true; a runaway cursor and a looping cursor each
raise rather than truncate; a negative quantity is retained; an unparsable
position is skipped with a warning rather than crashing the poll.python -m unittest discover -s skills/robinhood-unofficial-api-integration/scripts
and confirm all tests pass.degiro-unofficial-api-risk-assessmentheadless-broker-auth-patternsorder-placement-idempotencybroker-agnostic-adapter-interfacebroker-api-deprecation-notice-monitoringpattern-day-trader-rule-compliance-ustoken-lifecycle-live-probingWhat SKILL.md sets; muted values are Claude Code's defaults
36 skills in this plugin
/alpaca-paper-live-key-separationUse when a bot connects to the Alpaca Trading API and must never cross paper keys with the live endpoint; pins the base URL per environment, checks the key prefix, probes /v2/account and requires an explicit ALLOW_LIVE_TRADING flag./api-key-least-privilege-audit-toolUse before deploying a live bot, to audit existing broker API keys for scopes they do not need. Flags withdrawal, transfer and admin rights that turn a leaked execution key into theft./broker-account-margin-call-handlingUse when a bot trades a Reg T, portfolio or futures margin account and must act before the broker liquidates: tiered maintenance-margin warnings cross-checked against broker excess liquidity, initial-margin order gating and liquidity-aware de-leveraging.npx claudepluginhub himanshuj16/algo-trading-skills --plugin algo-trading-broker-integrationOther plugins' skills for the same job