Alpaca trading fees explained and estimated with Python

September 8, 2026
Facebook logo.
Twitter logo.
LinkedIn logo.
Newsletter issue count indicatorNewsletter total issues indicator
Alpaca trading fees explained and estimated with Python

Alpaca trading fees explained and estimated with Python

Alpaca trading fees are the first thing most people look up before connecting a Python script to a live brokerage account. The short answer is that Alpaca charges $0 commissions on US stock and ETF trades. But "commission-free" doesn't mean "cost-free," and the gap between those two words matters once you start sending orders from code. This guide covers the main costs that stock and ETF traders will face on Alpaca, and includes a Python script you can run to estimate your own fees from real order data. Note that this article focuses on US equities. If you trade crypto or options through Alpaca, those products have separate fee schedules not covered here.

Alpaca is a brokerage built around software access. Instead of clicking buttons in a browser, you send buy and sell orders from Python (or any language that can call a web API, which is a service that lets software talk to another service). That design makes it popular with developers who want to automate trades. But popularity and zero commissions don't tell you what you'll actually pay each month. Start with the fees Alpaca passes through on stock sales.

What Alpaca trading fees actually include

On the surface, the commission structure is simple. You pay $0 per trade for US stocks and ETFs. There's no minimum account balance for a basic account and no inactivity fee. If you place a handful of trades per month, your broker costs will be close to zero.

Alpaca does collect revenue in other ways, though, and some of those costs land directly on you. The table below gives a quick overview before we get into the details.

Cost typeWhen it appliesWho should care
Regulatory fees (SEC + FINRA TAF)Every time you sell sharesAnyone who trades frequently
Margin interestWhen you borrow money to hold positionsAnyone using borrowed funds overnight
Market data subscriptionIf you need quotes from all US exchangesIntraday or execution-sensitive scripts
Order routing costs (not on your statement)Every trade, indirectlyLarge-volume or tight-margin scripts

Regulatory fees on sell orders

Every US broker must collect certain fees on behalf of regulators. Alpaca passes these through at cost. The two main ones are a small SEC fee that US regulators charge as a percentage of the dollar value when you sell stock, and the FINRA Trading Activity Fee (TAF), which is a per-share charge on sales. As of early 2025, the TAF is $0.000119 per share sold, capped at $5.95 per trade. These fees apply only when you sell, not when you buy.

On a single small trade, the amounts are tiny. They stop being tiny when your script trades often. If your code sells 10,000 shares of a $5 stock, the TAF on that one order is $1.19. Do that 20 times in a day and you're paying about $24 per day in regulatory fees alone, roughly $500 per month. Both the SEC rate and the TAF rate can change periodically, so check the SEC's fee rate page and FINRA's notices before relying on any specific number.

Margin interest

If you borrow money from Alpaca to trade (this is called buying on margin), you'll pay interest on the borrowed amount. Alpaca's margin rates vary by account tier. As of early 2025, rates start around 5.75% annually for larger balances and go higher for smaller ones. You can check current rates on Alpaca's pricing page.

This matters if your script holds borrowed positions overnight. Say your code buys $50,000 worth of stock but your account only has $25,000 in cash. You're borrowing $25,000. At 5.75% annual interest, that's roughly $3.94 per day, or about $118 per month in costs that have nothing to do with commissions.

Data subscription fees

Alpaca offers free real-time price data through its basic plan, sourced from IEX. This data covers a subset of the market, not all exchanges. If you want price quotes collected from all major US exchanges in one feed, you'll need a paid subscription. The cost depends on your plan tier and whether you qualify as a professional or non-professional subscriber.

For scripts that use daily closing prices or simple order logic, the free IEX data usually works fine for testing. But if your code reacts to small intraday price moves, or if execution quality matters to your results, limited exchange coverage can distort what you see. In those cases, the paid feed is worth the monthly cost.

Order routing and execution price

Alpaca uses a practice called payment for order flow. When you place an order, Alpaca may route it to a firm (sometimes called a market maker, meaning a company that stands ready to buy and sell shares) that pays Alpaca for the right to handle your trade. That firm earns money from the gap between the current buy price and sell price of the stock.

In some cases, this routing can change the exact price where your order executes (the fill price, meaning the actual price you end up paying or receiving). Brokers have legal obligations to seek good execution, and the effect on any single trade is often small. But for a script that places hundreds of trades per day with thin profit margins, even a fraction of a penny per share adds up. This cost never appears as a line item on your statement, which is why it's easy to overlook.

How Alpaca trading fees compare to other brokers

Other retail brokers also offer commission-free stock trades. Interactive Brokers is one well-known alternative. It often charges lower margin rates (under 5% for larger accounts) and offers a tiered pricing model where you pay a small per-share commission in exchange for potentially better order routing. If your script trades large volumes, Interactive Brokers may cost less overall even though it charges commissions, because you may get better fill prices.

For someone building a Python-based trading system, Alpaca's main advantage isn't the zero commissions. It's the clean API that makes it straightforward to set up paper trading and move to live trading with minimal code changes. Broker features change often, so verify the current API offerings of any competitor before making a decision.

Estimate your Alpaca trading fees before you code

Before writing any Python, you can estimate your monthly costs with a simple formula. Take your expected number of shares sold per month, multiply by the TAF rate, and add the SEC fee rate times your expected total dollar value of sales. Then add any margin interest and data subscription costs.

For example, if you expect to sell 100,000 shares per month with a total sale value of $500,000, your estimated regulatory fees would be about $11.90 in TAF charges plus roughly $4.00 in SEC fees. Add $0 for margin if you don't borrow, and $0 for data if the free feed is enough. That's about $16 per month. A script that sells 2 million shares per month at $10 million in total value would pay closer to $238 in TAF and $80 in SEC fees, plus whatever margin and data costs apply.

Track your Alpaca trading fees with Python

A broker's pricing page gives you the rules. Your own order history shows what those rules actually cost you. Here's how to pull your order history from Alpaca and estimate the regulatory fees on your sell orders.

First, install the Alpaca SDK (software development kit):

pip install alpaca-py

Then run this script. It reads your last 30 days of filled orders and estimates the SEC and FINRA charges on each sell order. It does not pull official posted fees from a brokerage ledger. For exact totals, always check your account statements.

from alpaca.trading.client import TradingClient
from alpaca.trading.requests import GetOrdersRequest
from alpaca.trading.enums import OrderSide, QueryOrderStatus
from datetime import datetime, timedelta, timezone

# Replace with your actual API keys
client = TradingClient("YOUR_API_KEY", "YOUR_SECRET_KEY", paper=True)

# Fetch filled orders from the last 30 days (UTC)
request = GetOrdersRequest(
    status=QueryOrderStatus.CLOSED,
    after=datetime.now(timezone.utc) - timedelta(days=30),
    limit=500,
)
orders = client.get_orders(filter=request)

total_taf = 0.0
total_sec = 0.0
total_notional = 0.0

# Check SEC and FINRA sites for current rates before using these
SEC_FEE_RATE = 8.0 / 1_000_000  # $8 per million as of early 2025
TAF_RATE = 0.000119  # per share sold

for order in orders:
    if order.filled_qty is None or order.filled_avg_price is None:
        continue

    qty = float(order.filled_qty)
    price = float(order.filled_avg_price)
    notional = qty * price
    total_notional += notional

    # Regulatory fees only apply to sell orders
    if order.side == OrderSide.SELL:
        taf = min(qty * TAF_RATE, 5.95)
        sec = notional * SEC_FEE_RATE
        total_taf += taf
        total_sec += sec

print(f"Total notional traded: ${total_notional:,.2f}")
print(f"Total FINRA TAF fees:  ${total_taf:,.4f}")
print(f"Total SEC fees:        ${total_sec:,.4f}")
print(f"Combined reg fees:     ${total_taf + total_sec:,.4f}")

This script reads your filled orders from Alpaca (paper or live). Then it estimates the regulatory fees on each sell order using the rates defined at the top. If your script trades 50 times a day, even small per-sale fees can add up fast.

Two caveats. The code uses limit=500, so very active accounts may need pagination, which means fetching results in multiple batches, to capture all orders within 30 days. Also, if a single order fills in multiple pieces, the fee calculation can differ slightly from what the broker actually charges. Your brokerage statement is always the final source for exact totals.

You can extend this script to track costs by day or by stock symbol. That shows whether a script that places many trades still makes money after fees, or whether the regulatory charges are consuming the profits.

When "free" trading gets expensive

Your total Alpaca trading fees depend on how often your script trades and how large those orders are. A buy-and-hold approach with a few trades per month will genuinely cost almost nothing. A script that sells thousands of shares per day will accumulate meaningful regulatory fees and potentially worse execution prices from order routing.

Before you commit to any broker, run the cost estimate formula from earlier in this article. Compare that number against what you'd pay at a broker like Interactive Brokers, where a small commission might buy you better order execution.

If you're new to automated trading, start with Alpaca's paper trading to measure how often your script trades and what your average order size looks like. Then run the Python script above on those paper results. You'll get a rough estimate of broker costs before you place actual trades. Keep in mind that paper trading can estimate trade frequency and order size, but it won't reflect the exact prices you'd get in live markets.

Further reading

The free Algorithmic Trading With Python guides go deeper on this, from connecting to Alpaca's API to building and testing complete trading scripts.