--- id: alpaca-trade-api version: "3.2.0" license: unclear license_treatment: unclear maintenance: abandoned --- # alpaca-trade-api — Alpaca API python client License: unclear · Maintenance: abandoned · Downloads: 655.2K/mo ## What it is and what it does alpaca-trade-api is a Python client for Alpaca's commission-free trading platform. It wraps the Alpaca REST and streaming APIs, allowing developers to fetch historical market data (bars, quotes, trades), manage trading accounts and portfolios, and stream live market data. The library supports both synchronous REST calls and asynchronous operations via asyncio, with built-in pagination for large data queries. The package depends on pandas, numpy, requests, websocket-client, websockets, aiohttp, and other utilities for HTTP and data handling. It is designed for rapid algo development but is no longer actively maintained—the maintainers deprecated it in favor of Alpaca-py starting in 2023 and committed to maintenance only through end-2022. The repository is now archived, making this a legacy choice for new projects. Use it for: - Fetch historical OHLCV bars and quotes for backtesting trading strategies - Stream real-time market data and execute trades programmatically against a live or paper trading account - Build automated trading bots that monitor account positions and rebalance portfolios on schedule - Retrieve historical trade data and account statements for analysis and reporting - Prototype trading algorithms with support for custom timeframes and data pagination ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Python client library for the Alpaca Commission Free Trading API, providing REST and streaming interfaces for market data retrieval, account management, and algorithmic trading. No, not for new projects. The package is abandoned and explicitly superseded by Alpaca-py. While it has low install friction and no known vulnerabilities, the lack of active maintenance, unclear license, and the maintainers' own recommendation to migrate make it unsuitable for new development. Use only if maintaining legacy code that cannot yet be ported to Alpaca-py. ## Install pip install alpaca-trade-api uv add alpaca-trade-api poetry add alpaca-trade-api ## Installing alpaca-trade-api Before you install: Low install friction with a pure-Python wheel and ten runtime dependencies. However, the package is abandoned as of end-2022; the maintainers explicitly recommend migrating to the newer Alpaca-py SDK. Last commit was 2024-12-02, but the repository is archived and no active development is expected. License in practice: License treatment is unclear—no SPDX identifier or raw license text is available in the metadata. Before adopting this package, verify the actual license terms in the repository to ensure compatibility with your project. Quickstart: from alpaca_trade_api.rest import REST, TimeFrame api = REST() bars = api.get_bars("AAPL", TimeFrame.Hour, "2021-06-08", "2021-06-08", adjustment='raw') print(bars.df) Requires Python 3.7 or above. API key from Alpaca (https://app.alpaca.markets/signup) and environment variables APCA_API_BASE_URL and APCA_API_DATA_URL must be set or passed directly to REST(). Verify before relying: - Current state of the archived repository and whether security patches are still applied - Compatibility of this SDK with the current Alpaca API v2 after end-of-2022 maintenance window - Whether the websockets>=9.0 recommendation is a hard requirement or a best practice ## Package facts - License: not declared (unclear) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 655.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags alpaca trading api python client, stock market data streaming, algorithmic trading framework, commission-free trading api, real-time market data, portfolio management api, trading bot development, trading-api, deprecated, archived [View on SkillFed](https://skillfed.io/packages/alpaca-trade-api) · [View on PyPI](https://pypi.org/project/alpaca-trade-api/)