How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Alpaca Trading API

The Alpaca Trading API enables commission-free trading of US-listed equities, options, and crypto. It exposes endpoints for orders, positions, account information, watchlists, calendar, clock, and assets. A paper trading sandbox is available at paper-api.alpaca.markets.

Alpaca Trading API is one of 17 APIs that Alpaca publishes on the APIs.io network, described by a machine-readable OpenAPI specification and an AsyncAPI event-driven specification.

Tagged areas include Trading, Stocks, Options, Crypto, and Order. The published artifact set on APIs.io includes API documentation, an OpenAPI specification, and an AsyncAPI specification.

This API exposes 11 operations across 5 paths, and defines 15 schemas. It is described by OpenAPI 3.2.0, at version 1.0.0.

Requests are made against 2 base URLs: https://broker-api.sandbox.alpaca.markets, https://broker-api.alpaca.markets.

11 operations 5 paths 15 schemas 4 DELETE5 GET1 PATCH1 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.2.0
API Version
1.0.0
Base URL
https://api.alpaca.markets/v2
Authentication
HTTP Basic
Terms of Service
Resource Areas
1

Authentication & Security 1

Alpaca Trading API declares 1 security scheme for authenticating requests. It accepts HTTP basic authentication (BasicAuth). By default, every request must be authenticated.

Paths & Operations 11

Across 5 paths, the API surfaces 11 operations — 4 DELETE, 5 GET, 1 PATCH, 1 POST. Each is listed below with its method, path, parameters, and response codes.

Trading 11
GET
/v1/trading/accounts/{account_id}/positions
List open positions for an account
getPositionsForAccount 1 param → 200
DELETE
/v1/trading/accounts/{account_id}/positions
Close All Positions for an Account
closeAllPositionsForAccount 2 params → 207500
GET
/v1/trading/accounts/{account_id}/positions/{symbol_or_asset_id}
Get an Open Position for account by Symbol or AssetId
getPositionsForAccountBySymbol 2 params → 200404
DELETE
/v1/trading/accounts/{account_id}/positions/{symbol_or_asset_id}
Close a Position for an Account
closePositionForAccountBySymbol 4 params → 200
GET
/v1/trading/accounts/{account_id}/orders/{order_id}
Retrieves a single order for the given orderid.
getOrderForAccount 2 params → 200400404
PATCH
/v1/trading/accounts/{account_id}/orders/{order_id}
Replaces a single order with updated parameters
replaceOrderForAccount 2 params body → 200400403404
DELETE
/v1/trading/accounts/{account_id}/orders/{order_id}
Attempts to cancel an open order.
deleteOrderForAccount 2 params → 204400404
GET
/v1/trading/accounts/{account_id}/orders
Retrieves a list of orders for the account, filtered by the supplied query parameters.
getAllOrdersForAccount 8 params → 200400404
POST
/v1/trading/accounts/{account_id}/orders
Create an order for an account.
createOrderForAccount 1 param body → 200400403404
DELETE
/v1/trading/accounts/{account_id}/orders
Attempts to cancel all open orders. A response will be provided for each order that is attempted to be cancelled.
deleteAllOrdersForAccount 1 param → 207400404
GET
/v1/events/trades
Subscribe to Trade Events (SSE)
subscribeToTradeSSE 4 params → 200

Schemas 15

The contract defines 15 schemas that model the data the API accepts and returns. The most detailed are Order (33 properties), Position (17 properties), CreateOrderRequest (16 properties), TradeUpdateEvent (7 properties). Each schema is shown below with its type and property counts.

CreateOrderRequest
object
16 properties 4 required
PositionClosedResponse
object
Represents the result of asking the api to close a position. body is the Order used to close out the position.
3 properties 2 required
TradeUpdateEvent
object
Represents an update to an order/trade, sent over the events streaming api.
7 properties 7 required
TradeUpdateEventType
string
Common events These are the events that are the expected results of actions you may have taken by sending API requests. The meaning of the timestamp field chan…
OrderClass
string
OrderType
string
Position
object
17 properties 16 required
OrderClosedResponse
object
Represents the result of asking the api to cancel an Order.
3 properties 2 required
TimeInForce
string
Order
object
33 properties 2 required
UpdateOrderRequest
object
Represents the fields that are editable in an order replace/update call. Note: clientorderid is currently not editable on its own, one of the other fields must…
6 properties
Error
object
2 properties 2 required
OrderSide
string
Represents what side of the transaction an order was on.
AssetClass
string
OrderStatus
string

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

alpaca-trading-api-openapi.yml Raw ↑

Other APIs Alpaca publishes across the network.

Alpaca OAuth API
Alpaca Accounts API
Alpaca Assets API
Alpaca Calendar API
Alpaca Clock API
Alpaca Corporate Actions API
Alpaca Crypto Pricing Data API API
Alpaca Documents API
Alpaca Events API
Alpaca Funding API
Alpaca Journals API
Alpaca Logo API
Where this information came from

This is an independent, third-party profile of Alpaca Trading API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.