← ClaudeAtlas

lib-alpaca-pylisted

Alpaca's current Python SDK, which defaults to the paper host but lets url_override silently send live orders from a client that believes it is in the sandbox. TRIGGER - import alpaca, pip install alpaca-py, TradingClient, StockHistoricalDataClient, CryptoHistoricalDataClient, submit_order, LimitOrderRequest, MarketOrderRequest, OrderSide, TimeInForce, client_order_id, url_override, paper=True, BaseURL.TRADING_PAPER, paper-api.alpaca.markets, bracket OCO OTO orders, trail_percent, IEX vs SIP feed, Algo Trader Plus, alpaca-trade-api, APCA_API_BASE_URL; an order rejected asynchronously for time-in-force or price precision. Memory is stale here: alpaca-trade-api was deprecated in 2024 and defaulted to LIVE, whereas alpaca-py 0.44.0 (2026-08-11) declares paper=True - the widely repeated warning is inverted. SKIP for Interactive Brokers and for the general order-safety patterns (broker-execution-apis). SKIP for choosing between libraries, or when no library is named - the domain skill's job.
howard-lynn-ye/fin-skills · ★ 1 · AI & Automation · score 77
Install: claude install-skill howard-lynn-ye/fin-skills
# alpaca-py The easiest US broker to automate — REST, real paper trading, free data — and the one whose rules change silently depending on **which asset class** you point them at. | | | |---|---| | pip / import | `pip install alpaca-py` · `import alpaca` | | Version | **0.44.0 (2026-08-11)** · `>=3.10,<4.0`, classifiers through 3.14 · pure-Python wheel | | Licence | ✅ **Apache-2.0** | | Status | ✅ Active. 1,481★ `alpacahq/alpaca-py`, pushed 2026-09-03. 🔴 Legacy `alpaca-trade-api` 3.2.0 (2024-01-12) is deprecated | ## The trap that costs you money 🚨 **`url_override` bypasses the `paper` flag.** It replaces the base URL outright while `sandbox=paper` is still set from the flag — so `url_override=<live host>, paper=True` sends **live orders from a client that believes it is in the sandbox.** Never combine the two. 🚨 **And the advice you remember is inverted.** Paper and live are separate key pairs *and* separate hosts (`paper-api.alpaca.markets` vs `api.alpaca.markets`); keys are not portable. - ✅ Verified in `alpaca/trading/client.py`: `TradingClient.__init__` declares **`paper: bool = True`**, resolving `url_override if url_override else BaseURL.TRADING_PAPER if paper else BaseURL.TRADING_LIVE`. **Omitting `paper` in `alpaca-py` gives you PAPER.** - ✅ Verified in `alpaca_trade_api/common.py`: the legacy library's `get_base_url()` returns `os.environ.get('APCA_API_BASE_URL', 'https://api.alpaca.markets')` — **live by default, with no `paper` argument anywhere.** `REST(