Alpaca exchange client (alpaca).
Generated from the owned vendored spec at compile time. Provides raw REST endpoint wrappers, unified-method mapping, and response parsers.
Metadata
- Hostname:
alpaca.markets - Countries:
US - Certified:
no - Pro:
yes
Signing
Pattern: api_key_secret_headers — API key and secret header authentication
Capabilities
- Enabled:
fetchTicker,fetchOHLCV,fetchBalance,fetchPositions,createOrder,cancelOrder,fetchOpenOrders,fetchMarkets,fetchTime,fetchClosedOrders,fetchOrder,fetchOrders
Credentials
Private endpoints require: apiKey, secret.
Introspection
__endpoints__/0— 70 raw REST endpoints__unified_endpoints__/0— unified method → endpoint mapping__features__/0— explicit owned capability declarations__signing__/0— resolved signing pattern and config
Usage
{:ok, exchange} = Bourse.Exchange.new("alpaca")
endpoints = Bourse.Alpaca.__endpoints__()API Functions
| Function | Arity | Description | Param Kinds |
|---|
Summary
Functions
Returns all pre-computed endpoint configs.
Returns the exchange capability map.
Returns the owned normalization field maps (per response-type slot).
Returns the exchange ID string.
Returns the exchange display name.
Returns per-slot unified-method response envelope configs.
Returns the signing pattern and config for this exchange.
Returns the lean spec (runtime describe minus API tree).
Returns endpoint configs for a specific unified method, or [] if unknown.
Returns the full unified method → endpoint configs mapping.
Parses a raw account response into Bourse.Account.
Parses a raw adl_rank response into Bourse.ADLRank.
Parses a raw balance response into Bourse.Balance.
Parses a raw borrow_interest response into Bourse.BorrowInterest.
Parses a raw borrow_rate response into Bourse.BorrowRate.
Parses a raw conversion response into Bourse.Conversion.
Parses a raw currency response into Bourse.Currency.
Parses a raw deposit_address response into Bourse.DepositAddress.
Parses a raw funding_history response into Bourse.FundingHistory.
Parses a raw funding_rate response into Bourse.FundingRate.
Parses a raw funding_rate_history response into Bourse.FundingRateHistory.
Parses a raw greeks response into Bourse.Greeks.
Parses a raw ledger_entry response into Bourse.LedgerEntry.
Parses a raw leverage response into Bourse.Leverage.
Parses a raw leverage_tiers response into Bourse.LeverageTier.
Parses a raw liquidation response into Bourse.Liquidation.
Parses a raw long_short_ratio response into Bourse.LongShortRatio.
Parses a raw margin_loan response into Bourse.MarginLoan.
Parses a raw margin_mode response into Bourse.MarginMode.
Parses a raw margin_modification response into Bourse.MarginModification.
Parses a raw market response into Bourse.Market.
Parses a raw ohlcv response into Bourse.OHLCV.
Parses a raw open_interest response into Bourse.OpenInterest.
Parses a raw option response into Bourse.OptionData.
Parses a raw order response into Bourse.Order.
Parses a raw position response into Bourse.Position.
Parses a raw ticker response into Bourse.Ticker.
Parses a raw trade response into Bourse.Trade.
Parses a raw trading_fee response into Bourse.TradingFee.
Parses a raw transaction response into Bourse.Transaction.
Parses a raw transfer response into Bourse.TransferEntry.
Parses a raw volatility_history response into Bourse.VolatilityHistory.
Functions
@spec __endpoints__() :: [map()]
Returns all pre-computed endpoint configs.
@spec __features__() :: map()
Returns the exchange capability map.
@spec __field_maps__() :: map()
Returns the owned normalization field maps (per response-type slot).
@spec __id__() :: String.t()
Returns the exchange ID string.
@spec __name__() :: String.t()
Returns the exchange display name.
@spec __response_envelopes__() :: map()
Returns per-slot unified-method response envelope configs.
Returns the signing pattern and config for this exchange.
@spec __spec__() :: map()
Returns the lean spec (runtime describe minus API tree).
Returns endpoint configs for a specific unified method, or [] if unknown.
Returns the full unified method → endpoint configs mapping.
Parses a raw account response into Bourse.Account.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw adl_rank response into Bourse.ADLRank.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw balance response into Bourse.Balance.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw borrow_interest response into Bourse.BorrowInterest.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw borrow_rate response into Bourse.BorrowRate.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw conversion response into Bourse.Conversion.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw currency response into Bourse.Currency.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw deposit_address response into Bourse.DepositAddress.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw funding_history response into Bourse.FundingHistory.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw funding_rate response into Bourse.FundingRate.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
@spec parse_funding_rate_history( term(), keyword() ) :: {:ok, struct() | [struct()]} | {:error, term()}
Parses a raw funding_rate_history response into Bourse.FundingRateHistory.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw greeks response into Bourse.Greeks.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw ledger_entry response into Bourse.LedgerEntry.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw leverage response into Bourse.Leverage.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw leverage_tiers response into Bourse.LeverageTier.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw liquidation response into Bourse.Liquidation.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
@spec parse_long_short_ratio( term(), keyword() ) :: {:ok, struct() | [struct()]} | {:error, term()}
Parses a raw long_short_ratio response into Bourse.LongShortRatio.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw margin_loan response into Bourse.MarginLoan.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw margin_mode response into Bourse.MarginMode.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
@spec parse_margin_modification( term(), keyword() ) :: {:ok, struct() | [struct()]} | {:error, term()}
Parses a raw margin_modification response into Bourse.MarginModification.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw market response into Bourse.Market.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw ohlcv response into Bourse.OHLCV.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw open_interest response into Bourse.OpenInterest.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw option response into Bourse.OptionData.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw order response into Bourse.Order.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw position response into Bourse.Position.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw ticker response into Bourse.Ticker.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw trade response into Bourse.Trade.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw trading_fee response into Bourse.TradingFee.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw transaction response into Bourse.Transaction.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
Parses a raw transfer response into Bourse.TransferEntry.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.
@spec parse_volatility_history( term(), keyword() ) :: {:ok, struct() | [struct()]} | {:error, term()}
Parses a raw volatility_history response into Bourse.VolatilityHistory.
Delegates to Bourse.Parser.parse/4 with this exchange's upstream
normalization field map. Returns {:error, :no_field_map} when the slot
is unmapped and {:error, {:unresolved, reason}} when upstream flagged it
as not safely derivable. opts may carry :market for discriminated maps.