Back to Ccxt

Alpaca

wiki/exchanges-implicit/alpaca.md

4.5.737.6 KB
Original Source

Every endpoint in alpaca's api definition is exposed as an implicit method — a thin, generated wrapper around the raw exchange endpoint. Use these for exchange-specific functionality the CCXT API does not cover.

These methods are available in every CCXT language — TypeScript, JavaScript, Python, PHP, C#, Go and Java. Call them by the camelCase name shown in the tables below (e.g. traderPrivateGetV2Account); the snake_case alias (trader_private_get_v2_account) also works in JavaScript, Python and PHP, and Go uses the PascalCase form (TraderPrivateGetV2Account). Switch tabs for the call in each language:

<!-- tabs:start -->

JavaScript

javascript
const alpaca = new ccxt.alpaca ();
const response = await alpaca.traderPrivateGetV2Account (params);

TypeScript

typescript
import ccxt from 'ccxt';
const alpaca = new ccxt.alpaca ();
const response = await alpaca.traderPrivateGetV2Account (params);

Python

python
import ccxt
alpaca = ccxt.alpaca()
response = alpaca.trader_private_get_v2_account(params)

PHP

php
$alpaca = new \ccxt\alpaca();
$response = $alpaca->trader_private_get_v2_account($params);

C#

csharp
using ccxt;
var alpaca = new Alpaca();
var response = await alpaca.traderPrivateGetV2Account(parameters);

Go

go
alpaca := ccxt.NewAlpaca(nil)
response := <-alpaca.TraderPrivateGetV2Account(params)
<!-- tabs:end -->

Path parameters wrapped in {} (e.g. {pair}) are substituted from params; everything else in params is sent as the query string or request body. Cost is the rate-limiter weight of each call.

📚 Official alpaca API documentation: alpaca.markets

70 implicit endpoints across 2 access groups.

trader

Base URL: https://api.{hostname}

MethodHTTPEndpointCost
traderPrivateGetV2AccountGETv2/account1
traderPrivateGetV2OrdersGETv2/orders1
traderPrivateGetV2OrdersOrderIdGETv2/orders/{order_id}1
traderPrivateGetV2PositionsGETv2/positions1
traderPrivateGetV2PositionsSymbolOrAssetIdGETv2/positions/{symbol_or_asset_id}1
traderPrivateGetV2AccountPortfolioHistoryGETv2/account/portfolio/history1
traderPrivateGetV2WatchlistsGETv2/watchlists1
traderPrivateGetV2WatchlistsWatchlistIdGETv2/watchlists/{watchlist_id}1
traderPrivateGetV2WatchlistsByNameGETv2/watchlists:by_name1
traderPrivateGetV2AccountConfigurationsGETv2/account/configurations1
traderPrivateGetV2AccountActivitiesGETv2/account/activities1
traderPrivateGetV2AccountActivitiesActivityTypeGETv2/account/activities/{activity_type}1
traderPrivateGetV2CalendarGETv2/calendar1
traderPrivateGetV2ClockGETv2/clock1
traderPrivateGetV2AssetsGETv2/assets1
traderPrivateGetV2AssetsSymbolOrAssetIdGETv2/assets/{symbol_or_asset_id}1
traderPrivateGetV2CorporateActionsAnnouncementsIdGETv2/corporate_actions/announcements/{id}1
traderPrivateGetV2CorporateActionsAnnouncementsGETv2/corporate_actions/announcements1
traderPrivateGetV2WalletsGETv2/wallets1
traderPrivateGetV2WalletsTransfersGETv2/wallets/transfers1
traderPrivatePostV2OrdersPOSTv2/orders1
traderPrivatePostV2WatchlistsPOSTv2/watchlists1
traderPrivatePostV2WatchlistsWatchlistIdPOSTv2/watchlists/{watchlist_id}1
traderPrivatePostV2WatchlistsByNamePOSTv2/watchlists:by_name1
traderPrivatePostV2WalletsTransfersPOSTv2/wallets/transfers1
traderPrivatePutV2OrdersOrderIdPUTv2/orders/{order_id}1
traderPrivatePutV2WatchlistsWatchlistIdPUTv2/watchlists/{watchlist_id}1
traderPrivatePutV2WatchlistsByNamePUTv2/watchlists:by_name1
traderPrivatePatchV2OrdersOrderIdPATCHv2/orders/{order_id}1
traderPrivatePatchV2AccountConfigurationsPATCHv2/account/configurations1
traderPrivateDeleteV2OrdersDELETEv2/orders1
traderPrivateDeleteV2OrdersOrderIdDELETEv2/orders/{order_id}1
traderPrivateDeleteV2PositionsDELETEv2/positions1
traderPrivateDeleteV2PositionsSymbolOrAssetIdDELETEv2/positions/{symbol_or_asset_id}1
traderPrivateDeleteV2WatchlistsWatchlistIdDELETEv2/watchlists/{watchlist_id}1
traderPrivateDeleteV2WatchlistsByNameDELETEv2/watchlists:by_name1
traderPrivateDeleteV2WatchlistsWatchlistIdSymbolDELETEv2/watchlists/{watchlist_id}/{symbol}1

market

Base URL: https://data.{hostname}

MethodHTTPEndpointCost
marketPublicGetV1beta3CryptoLocBarsGETv1beta3/crypto/{loc}/bars1
marketPublicGetV1beta3CryptoLocLatestBarsGETv1beta3/crypto/{loc}/latest/bars1
marketPublicGetV1beta3CryptoLocLatestOrderbooksGETv1beta3/crypto/{loc}/latest/orderbooks1
marketPublicGetV1beta3CryptoLocLatestQuotesGETv1beta3/crypto/{loc}/latest/quotes1
marketPublicGetV1beta3CryptoLocLatestTradesGETv1beta3/crypto/{loc}/latest/trades1
marketPublicGetV1beta3CryptoLocQuotesGETv1beta3/crypto/{loc}/quotes1
marketPublicGetV1beta3CryptoLocSnapshotsGETv1beta3/crypto/{loc}/snapshots1
marketPublicGetV1beta3CryptoLocTradesGETv1beta3/crypto/{loc}/trades1
marketPrivateGetV1beta1CorporateActionsGETv1beta1/corporate-actions1
marketPrivateGetV1beta1ForexLatestRatesGETv1beta1/forex/latest/rates1
marketPrivateGetV1beta1ForexRatesGETv1beta1/forex/rates1
marketPrivateGetV1beta1LogosSymbolGETv1beta1/logos/{symbol}1
marketPrivateGetV1beta1NewsGETv1beta1/news1
marketPrivateGetV1beta1ScreenerStocksMostActivesGETv1beta1/screener/stocks/most-actives1
marketPrivateGetV1beta1ScreenerMarketTypeMoversGETv1beta1/screener/{market_type}/movers1
marketPrivateGetV2StocksAuctionsGETv2/stocks/auctions1
marketPrivateGetV2StocksBarsGETv2/stocks/bars1
marketPrivateGetV2StocksBarsLatestGETv2/stocks/bars/latest1
marketPrivateGetV2StocksMetaConditionsTicktypeGETv2/stocks/meta/conditions/{ticktype}1
marketPrivateGetV2StocksMetaExchangesGETv2/stocks/meta/exchanges1
marketPrivateGetV2StocksQuotesGETv2/stocks/quotes1
marketPrivateGetV2StocksQuotesLatestGETv2/stocks/quotes/latest1
marketPrivateGetV2StocksSnapshotsGETv2/stocks/snapshots1
marketPrivateGetV2StocksTradesGETv2/stocks/trades1
marketPrivateGetV2StocksTradesLatestGETv2/stocks/trades/latest1
marketPrivateGetV2StocksSymbolAuctionsGETv2/stocks/{symbol}/auctions1
marketPrivateGetV2StocksSymbolBarsGETv2/stocks/{symbol}/bars1
marketPrivateGetV2StocksSymbolBarsLatestGETv2/stocks/{symbol}/bars/latest1
marketPrivateGetV2StocksSymbolQuotesGETv2/stocks/{symbol}/quotes1
marketPrivateGetV2StocksSymbolQuotesLatestGETv2/stocks/{symbol}/quotes/latest1
marketPrivateGetV2StocksSymbolSnapshotGETv2/stocks/{symbol}/snapshot1
marketPrivateGetV2StocksSymbolTradesGETv2/stocks/{symbol}/trades1
marketPrivateGetV2StocksSymbolTradesLatestGETv2/stocks/{symbol}/trades/latest1