PHPackages                             masyasmv/freedom-broker-api - 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. [API Development](/categories/api)
4. /
5. masyasmv/freedom-broker-api

ActiveLibrary[API Development](/categories/api)

masyasmv/freedom-broker-api
===========================

PHP SDK &amp; parser for Freedom24 (TraderNet) Broker API — reports, securities, quotes, orders and history

v1.3.0(9mo ago)034↑757.1%1MITPHPPHP ^8.0CI passing

Since Jul 10Pushed 9mo agoCompare

[ Source](https://github.com/MasyaSmv/freedom-broker-api)[ Packagist](https://packagist.org/packages/masyasmv/freedom-broker-api)[ Docs](https://packagist.org/packages/masyasmv/freedom-broker-api)[ RSS](/packages/masyasmv-freedom-broker-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (6)Used By (0)

[![Packagist Version](https://camo.githubusercontent.com/ed6ff06157073e5e194230f7d9cc668c0a850681d58f8f4c04e0d66dd1e75ed2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61737961736d762f66726565646f6d2d62726f6b65722d6170693f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masyasmv/freedom-broker-api)[![PHP from Packagist](https://camo.githubusercontent.com/8164ededb2913d863b67320531068c36d754831ffc14102ef341ffdcbc5975be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d61737961736d762f66726565646f6d2d62726f6b65722d6170693f7374796c653d666c61742d737175617265)](https://php.net)[![Total Downloads](https://camo.githubusercontent.com/61524589aa18a6cb4d798d82782cb4fd194541526c41826c0918c362e90f0bc1/68747470733a2f2f706f7365722e707567782e6f72672f6d61737961736d762f66726565646f6d2d62726f6b65722d6170692f646f776e6c6f616473)](https://packagist.org/packages/masyasmv/freedom-broker-api)[![Tests](https://github.com/MasyaSmv/freedom-broker-api/actions/workflows/workflow.yml/badge.svg)](https://github.com/MasyaSmv/freedom-broker-api/actions)[![Coverage Status](https://camo.githubusercontent.com/995119206462f8e755ea55bb3e64cadae79b9a03df68c68e169b357df5e11897/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4d61737961536d762f66726565646f6d2d62726f6b65722d6170692f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/MasyaSmv/freedom-broker-api?branch=main)[![License](https://camo.githubusercontent.com/c64ffd2291a9c994b8f1af4d05884183f65b83b814cf43122782e99b34fbed1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d61737961736d762f66726565646f6d2d62726f6b65722d6170693f7374796c653d666c61742d737175617265)](LICENSE)

Freedom Broker API SDK for PHP 8 / Laravel 8 +
==============================================

[](#freedom-broker-api-sdk-for-php-8--laravel-8-)

Lean, fully‐typed SDK for **Freedom24 (TraderNet) broker API**:

DomainWhat you get**Reports**JSON fetch → strict DTO collections
balances, operations, positions, *payments* (dividends / compensations)**Trading**send, cancel, list orders**Market data**securities catalog, quotes, historical bars**Auth**V1 &amp; V2 HMAC request signing**Tooling**`ReportPeriodDTO` (start/end helpers)> All DTOs are Psalm-/PHPStan-friendly; persistence/business logic stays in **your**app.([GitHub](https://raw.githubusercontent.com/MasyaSmv/freedom-broker-api/develop/README.md))

---

✨ What’s new (v 1.3.0)
----------------------

[](#-whats-new-v-130)

- `PaymentDTO` + `payments` collection in parser (dividends, tax compensation).
- Safe numeric casting: `"-"` or `""` ⇒ `0.0` in money fields.
- `ReportPeriodDTO` with helpers `contains()` &amp; `lengthInDays()`.
- 100 % unit-coverage on GitHub Actions &amp; Coveralls.
- README overhaul 😎

Full list: see [CHANGELOG](CHANGELOG.md).

---

️Requirements
-------------

[](#️requirements)

- PHP **≥ 8.0** (8.1–8.3 preferred)
- `ext-json`, `ext-mbstring`
- Guzzle 7+
- Laravel 8/9/10 (auto-discover)

---

Installation
------------

[](#installation)

```
composer require masyasmv/freedom-broker-api
```

### Laravel setup

[](#laravel-setup)

```
php artisan vendor:publish \
  --provider="MasyaSmv\FreedomBrokerApi\Laravel\Providers\FreedomBrokerServiceProvider" \
  --tag="freedom-config"
```

```
FREEDOM_PUBLIC_KEY=your_public_key
FREEDOM_PRIVATE_KEY=your_secret_key
```

That’s it – the package facade **`Freedom::`** is ready.

---

Quick Start
-----------

[](#quick-start)

```
use MasyaSmv\FreedomBrokerApi\Laravel\Facades\Freedom;

$public  = config('freedom.public_key');
$private = config('freedom.private_key');
// 1. Full broker report – now includes `payments`
$report = Freedom::load($public, $private, '2025-06-01', '2025-06-30');
$dividends = $report['payments'];      // Collection

// 2. Send order
$order = Freedom::orders()->send('AAPL.US', 1, 182.50, 'ACC-123');

// 3. Quote info
$quote = Freedom::quotes()->get('AAPL.US');

// 4. Historical bars
$bars = Freedom::history()
        ->history('AAPL.US', new DateTime('2024-01-01'), new DateTime());
```

---

API Reference (brief)
---------------------

[](#api-reference-brief)

ServiceFacade/helperReturns / DTO`load($from,$to)``Freedom::load()``array{…}` – see above`StockService::all()``Freedom::stocks()``Collection``QuoteInfoService::get($ticker)``Freedom::quotes()``StockDTO`StockHistoryService::history()``Freedom::history()``Collection``OrderService::send/cancel/history()``Freedom::orders()``OrderDTO---

✅ Quality
---------

[](#-quality)

```
composer test       # PHPUnit (unit + stub integration)
composer coverage   # html/text coverage
composer cs         # style check
composer cs-fix     # auto-fix
composer phpstan    # static analysis (level 8)
```

Live API tests (`FREEDOM_LIVE_TEST=1`) are opt-in to keep CI fast.([GitHub](https://raw.githubusercontent.com/MasyaSmv/freedom-broker-api/develop/composer.json))

---

Contributing
------------

[](#contributing)

1. Fork → feature branch (`feat/xxx`)
2. Add tests (aim ≥ 95 % cov.)
3. `composer test && composer cs`
4. PR against `develop`

We follow PSR-12 + Laravel conventions.

---

License
-------

[](#license)

Released under the **MIT** license. © Masya Smv, 2025

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance59

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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 ~1 days

Total

4

Last Release

297d ago

### Community

Maintainers

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

---

Top Contributors

[![MasyaSmv](https://avatars.githubusercontent.com/u/61746307?v=4)](https://github.com/MasyaSmv "MasyaSmv (74 commits)")

---

Tags

apibrokerfreedom24laravelordersphpreportssdksecuritiestradernetphpapilaravelsdkdtoordersreportsbrokerfreedom24securities

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/masyasmv-freedom-broker-api/health.svg)

```
[![Health](https://phpackages.com/badges/masyasmv-freedom-broker-api/health.svg)](https://phpackages.com/packages/masyasmv-freedom-broker-api)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[gemini-api-php/laravel

Gemini API client for Laravel

8915.7k](/packages/gemini-api-php-laravel)

PHPackages © 2026

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