alpaca-broker-integration

Guides integration with Alpaca Broker, Trading, and Market Data APIs across languages.

4|Updated Aug 28, 2026
One-click install
npx skills add https://github.com/alan-d-smith/synthetix-alpha --skill alpaca-broker-integration-alan-d-smith
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: alpaca-broker-integration
Source: https://github.com/alan-d-smith/synthetix-alpha/tree/main/.agents/skills/alpaca-broker-integration
Command: npx skills add https://github.com/alan-d-smith/synthetix-alpha --skill alpaca-broker-integration-alan-d-smith

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers integrating with Alpaca's APIs face confusing differences between the Broker, Trading, Market Data, and Authentication API families — different base URLs, auth schemes, and wire conventions that cause subtle production bugs. This Skill provides the cross-cutting knowledge (URLs, auth, pagination, rate limits, money precision, async state machines) and routes to focused sub-skills for each domain. ## Core Features & Use Cases - API family routing: Explains the four Alpaca API families, their base URLs, and authentication schemes (HTTP Basic, key/secret headers, OAuth 2.0), then points to the right focused sub-skill for onboarding, funding, journals, orders, market data, SSE events, reconciliation, rate limits, or money precision. - Wire convention guidance: Documents numbers-as-strings, UUID/ULID identifiers, idempotency via client_order_id, pagination tokens, rate-limit headers, and asynchronous status state machines. - Sandbox-first workflow: Walks through a nine-step path from sandbox setup and account creation through funding, journaling, order placement, event subscription, and reconciliation. - Use Case: A fintech developer building a neobroker app asks how to open user accounts and place orders on Alpaca; the Skill explains Broker API Basic auth, the sandbox base URL, the account lifecycle, and directs them to the onboarding and trading-orders sub-skills. ## Quick Start Ask the assistant to explain how to authenticate with the Alpaca Broker API and create a sandbox account, then follow the routed sub-skill for your specific task.

Frequently Asked Questions about alpaca-broker-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate with the Alpaca Broker API?▼

The Broker API uses HTTP Basic authentication: send an Authorization header with base64 of your API key ID and secret key. Build the base64 token once at startup and reuse it; the same credential works for Broker REST, SSE event streams, and trading on behalf of accounts.

What is the difference between Alpaca Broker API and Trading API?▼

The Broker API manages many end-user accounts under your firm, placing orders at /v1/trading/accounts/{account_id}/orders. The Trading API trades a single account owned by the key holder at /v2/orders. They use different base URLs and authentication schemes.

Does Alpaca market data use WebSocket or SSE?▼

Market data streams over WebSocket at wss://stream.data.alpaca.markets with an auth message after connecting. Broker lifecycle events use SSE over a long-lived HTTPS GET with Basic auth and replayable cursors. They are different endpoints with different auth.

Why do Alpaca API responses return numbers as strings?▼

Alpaca returns prices, quantities, and money amounts as JSON strings to preserve precision. Parse them into a decimal type rather than a binary float to avoid rounding errors in monetary calculations.

How do I handle Alpaca API rate limits and 429 errors?▼

Responses include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers. On HTTP 429, wait until the reset time before retrying, and proactively back off as the remaining count drops.

Can I use the Alpaca Broker API with Python or TypeScript?▼

Yes, Alpaca is HTTP/SSE/WebSocket so any stack works. Python uses httpx or requests with decimal.Decimal; TypeScript uses fetch, an EventSource implementation, and ws. Official SDKs like alpaca-py exist but the wire protocol transfers to any language.