canonical: https://jentic.com/apis/alpaca.markets

# Alpaca APIs

Alpaca is a US brokerage infrastructure provider whose APIs cover the full investing stack: opening and managing brokerage accounts on behalf of customers, self-directed order placement, and real-time and historical market data. The Broker API handles account onboarding, KYC and CIP, ACH funding, journals between accounts, and rebalancing for fintechs building branded investing products. The Trading API runs a single self-directed account with orders, positions, watchlists, and account activities. The Market Data API returns bars, quotes, trades, snapshots, and news across US stocks, options, crypto, and forex.

## For AI agents

Across Alpaca's APIs an agent can open and fund brokerage accounts, place and cancel stock, options, and crypto orders for its own or customer accounts, manage positions and watchlists, run automated rebalancing, and pull live and historical prices, snapshots, and news to inform those trades.

## Scope

Use for: Building investing products on Alpaca: opening and funding brokerage accounts, placing stock, options, and crypto orders for your own or customer accounts, running rebalancing, and reading market prices and news.

Not supported:
- real-time data streaming
- non-Alpaca custody
- banking outside brokerage
- fundamentals data
- tax reporting

## APIs

| API | Category | Endpoints | Description |
| --- | --- | --- | --- |
| Alpaca Broker API | finance | 131 | Open brokerage accounts, manage funding and ACH relationships, trade on behalf of customers, run rebalancing programmes, and handle journals across accounts via the Alpaca Broker API. |
| Alpaca Market Data API | finance | 45 | Pull historical and latest bars, quotes, trades, snapshots, and news for US stocks, options, crypto, and forex from Alpaca's market data service. |
| Alpaca Trading API | finance | 44 | Run a self-directed Alpaca account: place and cancel orders, manage positions and watchlists, read account activities, and check the market calendar through one set of API keys. |

## Which API to use

| Need | API | Why |
| --- | --- | --- |
| Trade on behalf of customers you onboard under your own brand | broker | Broker opens and manages multi-customer accounts with KYC, funding, journals, and trading on behalf of each account. |
| Trade a single self-directed account you own | trading | Trading places orders and manages positions and watchlists for one account with a single key pair, no customer onboarding. |
| Read prices, bars, quotes, snapshots, or news | market-data | Market Data is the read-only price feed for stocks, options, crypto, and forex that both trading surfaces rely on. |

## Cross-API use cases

### Price-driven trading on a self-directed account

An agent pulls a latest snapshot from Market Data to check price and volume, then places or cancels an order on the developer's own account through Trading after confirmation. Both surfaces share the APCA key pair, so one credential set drives read and execute.

Example prompt: Call GET /v2/stocks/{symbol}/snapshot on Market Data, then POST /v2/orders on Trading to buy the symbol after the user confirms.

### Managed customer account trading on market signals

A fintech agent reads current prices from Market Data, then trades on behalf of a specific customer account through Broker using the account id in the path. Market Data drives the decision while Broker executes against the branded account.

Example prompt: Read the latest bar via GET /v1beta3/crypto/us/latest/bars on Market Data, then POST /v1/trading/accounts/{account_id}/orders on Broker for the chosen customer account.

### Rebalancing programme with live pricing

A robo-advisor agent triggers rebalancing runs against model portfolios through Broker while pulling current prices and corporate actions from Market Data to inform allocation. The two APIs together cover the decision and the execution for customer portfolios.

Example prompt: Pull latest snapshots from GET /v2/stocks/snapshots on Market Data, then POST /v1/rebalancing/runs on Broker to rebalance the model portfolio.

## Why Jentic

- **Setup:** Wiring Alpaca by hand means encoding two different auth models across three hosts and coordinating account, order, and data calls yourself. Through Jentic you install Jentic One once, add the Broker, Trading, and Market Data APIs from the Jentic directory, store each credential once, and your agent calls them.
- **Permission scoping:** Because Jentic One is self-hosted, your own rules decide which Alpaca operations and credentials each agent may use. Account and symbol ids sit in the URL paths, so a rule can pin an agent to one customer account or one symbol, and write actions like placing orders or closing positions are only available if you add them.
- **Credential handling:** Your Alpaca Broker basic credential and your Trading and Market Data key pairs are each stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'open a brokerage account', 'place a buy order', or 'get a stock snapshot', and Jentic returns the matching Alpaca operation with its input schema so the agent calls the right endpoint across the three APIs without browsing the reference docs.

## Related vendors

- **Plaid** — Bank account verification used to fund brokerage accounts before an ACH relationship is created in Alpaca.
- **Stripe** — Collects platform or subscription fees from end customers outside the brokerage money-movement flow.
- **Polygon** — Alternative market data provider for prices and reference data when broader coverage is needed alongside Alpaca.

## FAQ

### What is the difference between the Broker, Trading, and Market Data APIs?

Broker manages many brokerage accounts on behalf of customers under your own brand, including onboarding, funding, and trading. Trading runs a single self-directed account that you own. Market Data is a read-only price feed for stocks, options, crypto, and forex that supports either trading surface. Broker is the broadest with 131 endpoints; Trading has 44 and Market Data 45.

### Do these APIs share one set of credentials?

No. Broker uses HTTP basic authentication for server-to-server calls, while Trading and Market Data both use the APCA-API-KEY-ID and APCA-API-SECRET-KEY header pair. You store each credential once in your own Jentic One instance, and the right one is injected per API at execution time.

### Should I use Broker or Trading?

Use Trading when you only need to trade a single account that you own, with no customer onboarding. Use Broker when you are building a product that opens and manages accounts for other people under your brand and trades on their behalf. Both can read prices from Market Data.

### Can an agent both read prices and place trades?

Yes. Market Data returns snapshots, bars, quotes, and news, and either Trading or Broker places the resulting orders. A common pattern is to read a snapshot from Market Data, then place an order on Trading or Broker after the user confirms.

### Are there sandbox or paper environments for testing?

Yes. Broker exposes a sandbox host, Trading exposes a paper-trading host alongside the live host, and Market Data exposes production and sandbox endpoints. You can develop and test the full flow before pointing at the production base URLs.

### Which asset classes are covered across the APIs?

Trading and Broker handle stock, options, and crypto orders, and Broker adds full account and money-movement operations. Market Data covers US stocks, options, crypto, crypto perpetual futures, and forex for both latest and historical requests.
