skillfed

alpaca-trade-api

Alpaca API python client

alpaca-trade-api v3.2.0 655.2K downloads/30d#5,516 on PyPI1,883
License unclear Abandoned released

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 on this page — 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

alpaca-trade-api on PyPI

pip

pip install alpaca-trade-api

uv

uv add alpaca-trade-api

poetry

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 not specified
Install friction low — pure-Python wheel
Runtime dependencies 10 — pandas, numpy, requests, urllib3, websocket-client, websockets, msgpack, aiohttp, PyYAML, deprecation
Maintenance abandoned — 945 days since the last release
Last repo commit (repository archived)
First released
Downloads 655,225/month — #5,516 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: alpaca_trade_api-3.2.0-py3-none-any.whl

Keywords: financial, timeseries, api, trade

Tags

alpaca trading api python clientstock market data streamingalgorithmic trading frameworkcommission-free trading apireal-time market dataportfolio management apitrading bot development
trading-apideprecatedarchived

More Internet packages