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¶
- Getting Started โ Install and authenticate
- Authentication โ Deep dive on login, refresh, and device approval
Market Data¶
- Stock Quotes โ Fetching market data
- Options Chains โ Options with Greeks
- Futures Trading โ Contracts, quotes, orders, and P&L
- Crypto Trading โ Official crypto API with API key auth
- Fundamentals โ Fundamental data and screening
Reference¶
- API Reference โ Full API docs
- Error Handling โ Exception reference
- Rate Limits โ Request throttling
- Contributing โ Development guide