Alpaca-py Documentation

The official Python SDK for Alpaca's APIs.

GitHub stars

PyPI version shields.io

PyPI pyversions

Note

Migrating from alpaca-trade-api-python? Start with the Migration from alpaca-trade-api-python guide for the minimum code changes, common method mappings and the main capabilities added by alpaca-py.

Introduction

_images/introduction.png

Learn more about what Alpaca-py offers and how it’s different from the previous SDK on the Getting Started page.

Broker

_images/broker.png

The Broker API allows you to build the full brokerage experiences for your end users around account opening, funding and trading. Learn more on the Broker page.

Market Data

_images/market-data.png

The Market Data API gives you access to real time and historical data for equities, crypto and options. Learn more on the Market Data page.

Trading

_images/trading.png

Trade stocks & crypto with Alpaca’s easy to use Trading API. Paper trading is free and available to all Alpaca users. Learn more on the Trading page.


Discover Python Finance Libraries

Here are some libraries that work well with Alpaca-py.

Trading and Backtesting

  • Backtrader - Python Backtesting library for trading strategies.

  • Vectorbt - Find your trading edge, using a powerful toolkit for backtesting, algorithmic trading, and research.

  • LiuAlgoTrader - A scalable, multi-process ML-ready framework for effective algorithmic trading.

  • FinRL - The first open-source project for financial reinforcement learning.

Portfolio Analytics

  • Pyfolio - Portfolio and risk analytics in Python.

  • FinQuant - A program for financial portfolio management, analysis and optimisation.

FinTech Integrations

  • Plaid - Connect user banking information.

  • Onfido - Identity verification / KYC.