Skip to content

pyhood

A modern, reliable Python client for the Robinhood API.

Built for automated trading โ€” with auth that doesn't break, proper error handling, and sane defaults.

Features

  • ๐Ÿ” Auth that just works โ€” Login with timeouts, automatic token refresh, and session persistence.
  • ๐Ÿ”„ Automatic token refresh โ€” OAuth refresh tokens renew your session silently โ€” no credentials, no device approval, no human in the loop.
  • ๐Ÿท๏ธ Type hints everywhere โ€” Full type annotations, dataclass responses, IDE-friendly.
  • ๐Ÿ›ก๏ธ Built-in rate limiting โ€” Automatic request throttling and retry logic.
  • ๐Ÿ“Š Options-first โ€” Deep options chain support with Greeks, volume/OI analysis, and earnings integration.
  • ๐Ÿ“ˆ Futures trading โ€” Contract details, real-time quotes, order history, and P&L calculation for futures.
  • ๐Ÿช™ Dual API support โ€” Wraps both Robinhood's unofficial stocks/options API and their official Crypto Trading API.
  • ๐Ÿงช Tested and maintained โ€” 170+ tests, CI across Python 3.10-3.13, linted with ruff.

Quick Example

import pyhood
from pyhood.client import PyhoodClient

session = pyhood.login(username="you@email.com", password="...", timeout=90)
client = PyhoodClient(session)

quote = client.get_quote("AAPL")
print(f"AAPL: ${quote.price:.2f} ({quote.change_pct:+.1f}%)")

Next Steps

Getting Started

Market Data

Reference