PHPackages                             dambrogia/alpaca-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dambrogia/alpaca-php

ActiveLibrary

dambrogia/alpaca-php
====================

PHP REST client for Alpaca.

0.0.5(5y ago)12.0k—0%[2 issues](https://github.com/dambrogia/alpaca-php/issues)[2 PRs](https://github.com/dambrogia/alpaca-php/pulls)MITPHP

Since Jun 11Pushed 3y agoCompare

[ Source](https://github.com/dambrogia/alpaca-php)[ Packagist](https://packagist.org/packages/dambrogia/alpaca-php)[ RSS](/packages/dambrogia-alpaca-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (5)Versions (10)Used By (0)

Alpaca-PHP
==========

[](#alpaca-php)

A PHP REST client for [Alpaca](https://alpaca.markets/).

### Getting started:

[](#getting-started)

```
composer require dambrogia/alpaca-php

```

#### Using the client within your package:

[](#using-the-client-within-your-package)

Declare your configuration:

```
use Dambrogia\Alpaca\Config;
...
$config = new Config($key, $secret, Config::ENV_PAPER);
// Can also use Config::ENV_LIVE here ^ as well for production mode.

```

Once you declare the configuration, there's 2 ways to use the package. The entire package can be loaded and specific endpoints/features can be navigated to, or only certain sets of endpoints can be loaded initially. The package is fairly small so the overhead to load the entire library isn't much.

```
use Dambrogia\Alpaca\Alpaca;
...
$account = (new Alpaca($config))->v2()->account()->get();
// or
use Dambrogia\Alpaca\Client\V2;
...
$account = (new V2($config))->account()->get();

```

### Endpoints Covered

[](#endpoints-covered)

VerbCallableEndpointRFC6455 WebSocket protocol[`Dambrogia\Alpaca\Client\Streaming::connect`](https://github.com/dambrogia/alpaca-php/blob/master/src/Client/Streaming.php#L29)`/stream``GET`[`Dambrogia\Alpaca\Endpoint\V1\Account::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Account.php#L14)`/v1/account``GET`[`Dambrogia\Alpaca\Endpoint\V1\Assets::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Assets.php#L14)`/v1/assets``GET`[`Dambrogia\Alpaca\Endpoint\V1\Assets::getBySymbol`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Assets.php#L27)`/v1/assets/$symbol``GET`[`Dambrogia\Alpaca\Endpoint\V1\Bars::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Bars.php#L17)`/v1/bars/$timeframe``GET`[`Dambrogia\Alpaca\Endpoint\V1\Calendar::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Calendar.php#L14)`/v1/calendar``GET`[`Dambrogia\Alpaca\Endpoint\V1\Clock::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Clock.php#L14)`/v1/clock``POST`[`Dambrogia\Alpaca\Endpoint\V1\Orders::create`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Orders.php#L26)`/v1/orders``DELETE`[`Dambrogia\Alpaca\Endpoint\V1\Orders::delete `](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Orders.php#L59)`/v1/orders/$id``GET`[`Dambrogia\Alpaca\Endpoint\V1\Orders::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Orders.php#L15)`/v1/orders``GET`[`Dambrogia\Alpaca\Endpoint\V1\Orders::getByClientOrderId `](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Orders.php#L49)`/v1/orders:by_client_order_id``GET`[`Dambrogia\Alpaca\Endpoint\V1\Orders::getById`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Orders.php#L36)`/v1/orders/$id``GET`[`Dambrogia\Alpaca\Endpoint\V1\Positions::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Positions.php#L15)`/v1/positions``GET`[`Dambrogia\Alpaca\Endpoint\V1\Positions::getBySymbol`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V1/Positions.php#L27)`/v1/positions/$symbol``GET`[`Dambrogia\Alpaca\Endpoint\V2\Account::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Account.php#L14)`/v2/account``GET`[`Dambrogia\Alpaca\Endpoint\V2\Assets::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Assets.php#L14)`/v2/assets``GET`[`Dambrogia\Alpaca\Endpoint\V2\Assets::getBySymbol`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Assets.php#L27)`/v2/assets/$symbol``GET`[`Dambrogia\Alpaca\Endpoint\V2\Calendar::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Calendar.php#L14)`/v2/calendar``GET`[`Dambrogia\Alpaca\Endpoint\V2\Clock::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Clock.php#L14)`/v2/clock``POST`[`Dambrogia\Alpaca\Endpoint\V2\Orders::create`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Orders.php#L26)`/v2/orders``DELETE`[`Dambrogia\Alpaca\Endpoint\V2\Orders::delete `](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Orders.php#L59)`/v2/orders/$id``GET`[`Dambrogia\Alpaca\Endpoint\V2\Orders::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Orders.php#L15)`/v2/orders``GET`[`Dambrogia\Alpaca\Endpoint\V2\Orders::getByClientOrderId `](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Orders.php#L49)`/v2/orders:by_client_order_id``GET`[`Dambrogia\Alpaca\Endpoint\V2\Orders::getById`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Orders.php#L36)`/v2/orders/$id``GET`[`Dambrogia\Alpaca\Endpoint\V2\Positions::get`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Positions.php#L15)`/v2/positions``GET`[`Dambrogia\Alpaca\Endpoint\V2\Positions::getBySymbol`](https://github.com/dambrogia/alpaca-php/blob/master/src/Endpoint/V2/Positions.php#L27)`/v2/positions/$symbol`#### *If there are missing/incorrect endpoints, please create an issue so that it can be addressed!*

[](#if-there-are-missingincorrect-endpoints-please-create-an-issue-so-that-it-can-be-addressed)

### Testing

[](#testing)

To run the tests, download the package, copy `.env.sample` to `.env` and place your paper trading credentials in the .env file. Feel free to look at the testing [here](https://github.com/dambrogia/alpaca-php/tree/master/test).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~149 days

Total

5

Last Release

1927d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8572301ae2952343f9f78bf82aa62e842c7f2d379eedd247efc98f52b96aed3?d=identicon)[domdambrogia](/maintainers/domdambrogia)

---

Top Contributors

[![dambrogia](https://avatars.githubusercontent.com/u/6516452?v=4)](https://github.com/dambrogia "dambrogia (22 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dambrogia-alpaca-php/health.svg)

```
[![Health](https://phpackages.com/badges/dambrogia-alpaca-php/health.svg)](https://phpackages.com/packages/dambrogia-alpaca-php)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[zerodha/phpkiteconnect

The PHP client library for the Kite Connect trading APIs Resources

463.4k2](/packages/zerodha-phpkiteconnect)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
