Fio bank REST API implementation in PHP
genericapt install php-mhujer-fio-apiPHP library that allows you to download and iterate through account balance changes from the Fio bank REST API.
Fio bank REST API implementation in PHP. It allows you to download and iterate through account balance changes.
There is a Symfony Bundle for using this library in a Symfony app.
composer require mhujer/fio-api-php<?php
require_once 'vendor/autoload.php';
$downloader = new FioApi\Downloader('TOKEN@todo');
$transactionList = $downloader->downloadSince(new \DateTimeImmutable('-1 week'));
foreach ($transactionList->getTransactions() as $transaction) {
var_dump($transaction); //object with getters
}
downloadFromTo(DateTimeInterface $from, DateTimeInterface $to): TransactionListdownloadSince(DateTimeInterface $since): TransactionListdownloadLast(): TransactionListsetLastId(string $id) - sets the last downloaded ID through the APIFio API enforces a 30-second cooldown between requests using the same token. If you make a request sooner, the API returns HTTP 409.
This library includes a built-in rate limiter that coordinates requests across multiple processes using a shared JSON file with file locking.
<?php
require_once 'vendor/autoload.php';
$store = new FioApi\RateLimit\JsonRateLimitStore('/tmp/fio-rate-limit.json');
$limiter = new FioApi\RateLimit\RateLimiter($store, true);
$downloader = new FioApi\Downloader('TOKEN@todo', null, $limiter);
$transactionList = $downloader->downloadSince(new \DateTimeImmutable('-1 week'));
In wait mode, if less than 30 seconds have passed since the last request for the same token, the limiter will sleep() for the remaining time before proceeding.
<?php
require_once 'vendor/autoload.php';
$store = new FioApi\RateLimit\JsonRateLimitStore('/tmp/fio-rate-limit.json');
$limiter = new FioApi\RateLimit\RateLimiter($store, false);
$downloader = new FioApi\Downloader('TOKEN@todo', null, $limiter);
try {
$transactionList = $downloader->downloadSince(new \DateTimeImmutable('-1 week'));
} catch (FioApi\Exceptions\TooGreedyException $e) {
// Handle: request came too soon, try again later
}
RateLimiter::acquire() (used by Downloader) checks the 30 second window and reserves the slot in one step under an exclusive flock() on the store file. Concurrent cron jobs or workers sharing the same store file therefore never send a request for the same token within one window: in wait mode they queue up, otherwise TooGreedyException is thrown. Failing to open, lock or write the store file throws a RuntimeException instead of silently disabling the limit.
Implement FioApi\RateLimit\AtomicRateLimitStoreInterface (tryAcquire() must check and reserve atomically) to use a database or other shared storage (e.g. Redis, SQLite) instead of a JSON file. Stores implementing only FioApi\RateLimit\RateLimitStoreInterface still work, but fall back to a non-atomic check followed by record.
The library includes unit tests for all rate limiting components:
composer test
Fio API PHP works with PHP 8.1 or higher (including PHP 8.4).
Bugs and feature request are tracked on GitHub
Martin Hujer - https://www.martinhujer.cz
composer/ca-bundle as a required dependency instead of bundled root cert (thx @feldsam!)DateTime replaced with DateTimeImmutable (or DateTimeInterface)specification field in transaction (@soukiii)
pool/main/p/php-mhujer-fio-api/php-mhujer-fio-api_5.0.1.24~bookworm_amd64.deb
php-mhujer-fio-api| Název souboru | pool/main/p/php-mhujer-fio-api/php-mhujer-fio-api_5.0.1.24~bookworm_amd64.deb |
| Verze | 5.0.1.24~bookworm |
| Stáří ve dnech | 313 |
| Datum vydání | 2025 12. 29. |
| Velikost | 5.25 KB |
| id | 3090 |
| Jméno | php-mhujer-fio-api |
| Balíček | |
| Appname | |
| Essential | |
| Vendor | |
| License | |
| Distribution | bookworm |
| Suite | main |
| Source | |
| Architecture | binary-amd64 |
| MultiArch | foreign |
| Maintainer | Vítězslav Dvořák |
| InstalledSize | 33 |
| Depends | php-curl , php-guzzlehttp-guzzle , composer-debian , ca-certificates |
| PreDepends | |
| Breaks | |
| Enhances | |
| Section | unknown |
| Priority | optional |
| Popis | Fio API PHP implemention |
| LongDescription | Fio bank REST API implementation in PHP. It allows you to download and iteratethrough account balance changes. |
| AutoBuiltPackage | |
| Název souboru | pool/main/p/php-mhujer-fio-api/php-mhujer-fio-api_5.0.1.24~bookworm_amd64.deb |
| MD5sum | 2d766c65b37184db5e40102b17433880 |
| SHA1 | dab178741b5860cb395c074bd56938678cb65aca |
| SHA256 | 5d4138597d1bbfc9fbd9d240cc6e48d9b795e56376fa7985b3b3124e74804749 |
| SHA512 | 9988838591422c4b1fa35f3e9249eeb548dce72e505f1fa98c87c4ece9daf935bf77d84463a39d5cf4ba419b3a2b76f3f4cf83c487c08e2897559593013caf89 |
| Velikost | 5372 |
| Auto-Built-Package | |
| Domovská stránka | https://github.com/mhujer/fio-api-php |
| Provides | |
| Existing | |
| fileMtime | 2025-12-29 01:46:56 |
| created | 2024-11-28 12:48:40 |
| updated | 2025-12-29 01:46:56 |

| ./ | |
| ./usr/ | |
| ./usr/share/ | |
| ./usr/share/doc/ | |
| ./usr/share/doc/php-mhujer-fio-api/ | |
| ./usr/share/doc/php-mhujer-fio-api/README.Debian | 262 |
| ./usr/share/doc/php-mhujer-fio-api/changelog.gz | 349 |
| ./usr/share/php/ | |
| ./usr/share/php/FioApi/ | |
| ./usr/share/php/FioApi/Account.php | 1087 |
| ./usr/share/php/FioApi/Downloader.php | 2885 |
| ./usr/share/php/FioApi/Exceptions/ | |
| ./usr/share/php/FioApi/Exceptions/InternalErrorException.php | 122 |
| ./usr/share/php/FioApi/Exceptions/MissingTokenException.php | 129 |
| ./usr/share/php/FioApi/Exceptions/TooGreedyException.php | 118 |
| ./usr/share/php/FioApi/Transaction.php | 5760 |
| ./usr/share/php/FioApi/TransactionList.php | 3214 |
| ./usr/share/php/FioApi/UrlBuilder.php | 1379 |
| ./usr/share/php/FioApi/composer.json | 737 |
| ./ | |
| ./usr/ | |
| ./usr/share/ | |
| ./usr/share/doc/ | |
| ./usr/share/doc/php-mhujer-fio-api/ | |
| ./usr/share/doc/php-mhujer-fio-api/README.Debian | 262 |
| ./usr/share/doc/php-mhujer-fio-api/changelog.gz | 344 |
| ./usr/share/php/ | |
| ./usr/share/php/FioApi/ | |
| ./usr/share/php/FioApi/Account.php | 1087 |
| ./usr/share/php/FioApi/Downloader.php | 2885 |
| ./usr/share/php/FioApi/Exceptions/ | |
| ./usr/share/php/FioApi/Exceptions/InternalErrorException.php | 122 |
| ./usr/share/php/FioApi/Exceptions/MissingTokenException.php | 129 |
| ./usr/share/php/FioApi/Exceptions/TooGreedyException.php | 118 |
| ./usr/share/php/FioApi/Transaction.php | 5760 |
| ./usr/share/php/FioApi/TransactionList.php | 3214 |
| ./usr/share/php/FioApi/UrlBuilder.php | 1379 |
| ./usr/share/php/FioApi/composer.json | 737 |
| ./ | |
| ./usr/ | |
| ./usr/share/ | |
| ./usr/share/doc/ | |
| ./usr/share/doc/php-mhujer-fio-api/ | |
| ./usr/share/doc/php-mhujer-fio-api/README.Debian | 262 |
| ./usr/share/doc/php-mhujer-fio-api/changelog.gz | 349 |
| ./usr/share/php/ | |
| ./usr/share/php/FioApi/ | |
| ./usr/share/php/FioApi/Account.php | 1087 |
| ./usr/share/php/FioApi/Downloader.php | 2885 |
| ./usr/share/php/FioApi/Exceptions/ | |
| ./usr/share/php/FioApi/Exceptions/InternalErrorException.php | 122 |
| ./usr/share/php/FioApi/Exceptions/MissingTokenException.php | 129 |
| ./usr/share/php/FioApi/Exceptions/TooGreedyException.php | 118 |
| ./usr/share/php/FioApi/Transaction.php | 5760 |
| ./usr/share/php/FioApi/TransactionList.php | 3214 |
| ./usr/share/php/FioApi/UrlBuilder.php | 1379 |
| ./usr/share/php/FioApi/composer.json | 737 |
| ./ | |
| ./usr/ | |
| ./usr/share/ | |
| ./usr/share/doc/ | |
| ./usr/share/doc/php-mhujer-fio-api/ | |
| ./usr/share/doc/php-mhujer-fio-api/README.Debian | 262 |
| ./usr/share/doc/php-mhujer-fio-api/changelog.gz | 348 |
| ./usr/share/php/ | |
| ./usr/share/php/FioApi/ | |
| ./usr/share/php/FioApi/Account.php | 1087 |
| ./usr/share/php/FioApi/Downloader.php | 2885 |
| ./usr/share/php/FioApi/Exceptions/ | |
| ./usr/share/php/FioApi/Exceptions/InternalErrorException.php | 122 |
| ./usr/share/php/FioApi/Exceptions/MissingTokenException.php | 129 |
| ./usr/share/php/FioApi/Exceptions/TooGreedyException.php | 118 |
| ./usr/share/php/FioApi/Transaction.php | 5760 |
| ./usr/share/php/FioApi/TransactionList.php | 3214 |
| ./usr/share/php/FioApi/UrlBuilder.php | 1379 |
| ./usr/share/php/FioApi/composer.json | 737 |
| ./ | |
| ./usr/ | |
| ./usr/share/ | |
| ./usr/share/doc/ | |
| ./usr/share/doc/php-mhujer-fio-api/ | |
| ./usr/share/doc/php-mhujer-fio-api/README.Debian | 262 |
| ./usr/share/doc/php-mhujer-fio-api/changelog.gz | 346 |
| ./usr/share/php/ | |
| ./usr/share/php/FioApi/ | |
| ./usr/share/php/FioApi/Account.php | 1087 |
| ./usr/share/php/FioApi/Downloader.php | 2885 |
| ./usr/share/php/FioApi/Exceptions/ | |
| ./usr/share/php/FioApi/Exceptions/InternalErrorException.php | 122 |
| ./usr/share/php/FioApi/Exceptions/MissingTokenException.php | 129 |
| ./usr/share/php/FioApi/Exceptions/TooGreedyException.php | 118 |
| ./usr/share/php/FioApi/Transaction.php | 5760 |
| ./usr/share/php/FioApi/TransactionList.php | 3214 |
| ./usr/share/php/FioApi/UrlBuilder.php | 1379 |
| ./usr/share/php/FioApi/composer.json | 737 |
| ./ | |
| ./usr/ | |
| ./usr/share/ | |
| ./usr/share/doc/ | |
| ./usr/share/doc/php-mhujer-fio-api/ | |
| ./usr/share/doc/php-mhujer-fio-api/README.Debian | 262 |
| ./usr/share/doc/php-mhujer-fio-api/changelog.gz | 347 |
| ./usr/share/php/ | |
| ./usr/share/php/FioApi/ | |
| ./usr/share/php/FioApi/Account.php | 1087 |
| ./usr/share/php/FioApi/Downloader.php | 2885 |
| ./usr/share/php/FioApi/Exceptions/ | |
| ./usr/share/php/FioApi/Exceptions/InternalErrorException.php | 122 |
| ./usr/share/php/FioApi/Exceptions/MissingTokenException.php | 129 |
| ./usr/share/php/FioApi/Exceptions/TooGreedyException.php | 118 |
| ./usr/share/php/FioApi/Transaction.php | 5760 |
| ./usr/share/php/FioApi/TransactionList.php | 3214 |
| ./usr/share/php/FioApi/UrlBuilder.php | 1379 |
| ./usr/share/php/FioApi/composer.json | 737 |
Fio bank REST API implementation in PHP. It allows you to download and iterate through account balance changes.
There is a Symfony Bundle for using this library in a Symfony app.
composer require mhujer/fio-api-php<?php
require_once 'vendor/autoload.php';
$downloader = new FioApi\Downloader('TOKEN@todo');
$transactionList = $downloader->downloadSince(new \DateTimeImmutable('-1 week'));
foreach ($transactionList->getTransactions() as $transaction) {
var_dump($transaction); //object with getters
}
downloadFromTo(DateTimeInterface $from, DateTimeInterface $to): TransactionListdownloadSince(DateTimeInterface $since): TransactionListdownloadLast(): TransactionListsetLastId(string $id) - sets the last downloaded ID through the APIFio API PHP works with PHP 7.4 or higher.
Bugs and feature request are tracked on GitHub
Martin Hujer - https://www.martinhujer.cz
composer/ca-bundle as a required dependency instead of bundled root cert (thx @feldsam!)DateTime replaced with DateTimeImmutable (or DateTimeInterface)specification field in transaction (@soukiii)| Verze | Počet stažení/instalací | Poslední přístup |
|---|