Download the PHP package dambrogia/alpaca-php without Composer

On this page you can find all versions of the php package dambrogia/alpaca-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package alpaca-php

Alpaca-PHP

A PHP REST client for Alpaca.

Getting started:

composer require dambrogia/alpaca-php

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

Verb Callable Endpoint
RFC6455 WebSocket protocol Dambrogia\Alpaca\Client\Streaming::connect /stream
GET Dambrogia\Alpaca\Endpoint\V1\Account::get /v1/account
GET Dambrogia\Alpaca\Endpoint\V1\Assets::get /v1/assets
GET Dambrogia\Alpaca\Endpoint\V1\Assets::getBySymbol /v1/assets/$symbol
GET Dambrogia\Alpaca\Endpoint\V1\Bars::get /v1/bars/$timeframe
GET Dambrogia\Alpaca\Endpoint\V1\Calendar::get /v1/calendar
GET Dambrogia\Alpaca\Endpoint\V1\Clock::get /v1/clock
POST Dambrogia\Alpaca\Endpoint\V1\Orders::create /v1/orders
DELETE Dambrogia\Alpaca\Endpoint\V1\Orders::delete /v1/orders/$id
GET Dambrogia\Alpaca\Endpoint\V1\Orders::get /v1/orders
GET Dambrogia\Alpaca\Endpoint\V1\Orders::getByClientOrderId /v1/orders:by_client_order_id
GET Dambrogia\Alpaca\Endpoint\V1\Orders::getById /v1/orders/$id
GET Dambrogia\Alpaca\Endpoint\V1\Positions::get /v1/positions
GET Dambrogia\Alpaca\Endpoint\V1\Positions::getBySymbol /v1/positions/$symbol
GET Dambrogia\Alpaca\Endpoint\V2\Account::get /v2/account
GET Dambrogia\Alpaca\Endpoint\V2\Assets::get /v2/assets
GET Dambrogia\Alpaca\Endpoint\V2\Assets::getBySymbol /v2/assets/$symbol
GET Dambrogia\Alpaca\Endpoint\V2\Calendar::get /v2/calendar
GET Dambrogia\Alpaca\Endpoint\V2\Clock::get /v2/clock
POST Dambrogia\Alpaca\Endpoint\V2\Orders::create /v2/orders
DELETE Dambrogia\Alpaca\Endpoint\V2\Orders::delete /v2/orders/$id
GET Dambrogia\Alpaca\Endpoint\V2\Orders::get /v2/orders
GET Dambrogia\Alpaca\Endpoint\V2\Orders::getByClientOrderId /v2/orders:by_client_order_id
GET Dambrogia\Alpaca\Endpoint\V2\Orders::getById /v2/orders/$id
GET Dambrogia\Alpaca\Endpoint\V2\Positions::get /v2/positions
GET Dambrogia\Alpaca\Endpoint\V2\Positions::getBySymbol /v2/positions/$symbol

If there are missing/incorrect endpoints, please create an issue so that it can be addressed!

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.


All versions of alpaca-php with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.0
ratchet/pawl Version ^0.3.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dambrogia/alpaca-php contains the following files

Loading the files please wait ....