Download, email and report FioBank account statements
console applicationOfficeFinanceapt install fiobank-statement-toolsA suite of CLI tools for working with FioBank statements and transactions. Provides automated downloading in multiple formats, email delivery, and JSON transaction reporting with built-in API rate limiting.
Includes three tools: fiobank-statement-downloader for saving statements to disk, fiobank-statement-mailer for emailing statements, and fiobank-transaction-report for generating JSON transaction summaries.
A comprehensive suite of PHP tools for working with FioBank statements and transactions. This toolset provides automated downloading, emailing, and reporting capabilities for FioBank account data.
This package includes three main tools:
fiobank-statement-downloader [save/to/directory] [format] [path/to/.env]
Example output when EASE_LOGGER=console
01/16/2024 16:46:11 ⚙ ❲FioBank Statement Downloader⦒SpojeNet\FioApi\Downloader❳ FioBank Statement Downloader EaseCore dev-main (PHP 8.3.1)
01/16/2024 16:46:12 🌼 ❲FioBank Statement Downloader⦒SpojeNet\FioApi\Downloader❳ Výpis z účtu FIO - 12/01/23 to 12/31/23: hlavni_fio-2023_12.pdf saved
All tools use environment variables for configuration. You can either set them in your environment or create a .env file.
Required Configuration:
FIO_TOKEN - Your FioBank API token with read permissions (e.g., 'KitMuWyajissajPishtuwolth8ojyukMaldryavAcsOotuhuaksaf')FIO_TOKEN_NAME - Descriptive name for your token (e.g., 'Fio Main')ACCOUNT_NUMBER - Your FioBank account number (e.g., 666666666)Optional Configuration:
STATEMENTS_DIR - Directory to save statements (default: current directory)STATEMENTS_FORMAT - Statement format: pdf, csv, gpc, html, json, ofx, xml (default: pdf)APP_DEBUG - Enable debug mode (True/False)EASE_LOGGER - Logging method: syslog, eventlog, or consoleLANG - Application locale: cs_CZ or en_US (default: cs_CZ)2024-08-05>2024-08-11 - custom scope2024-10-11 - only specific dayDownloads FioBank statements and sends them via email to specified recipients.
fiobank-statement-mailer [path/to/.env]
Shares basic configuration with the downloader and uses additional email-specific environment variables:
Email Configuration:
STATEMENTS_TO - Recipient's email address (required)STATEMENTS_FROM - Sender's email addressSTATEMENTS_REPLYTO - Reply-To email addressSTATEMENTS_CC - CC email addressSTATEMENTS_DIR - Temporary folder for downloaded statements (default: /tmp/)EASE_SMTP - Optional SMTP configuration as JSON string:
{
"port": "587",
"starttls": true,
"auth": true,
"host": "smtp.office365.com",
"username": "your@email.com",
"password": "your_password"
}
Generates a comprehensive JSON report of FioBank transactions, providing detailed insights into account activity.
fiobank-transaction-report [path/to/.env]
{
"source": "SpojeNet\\FioApi\\Downloader",
"account": "4678357887",
"in": {
"26824841497": 605,
"26824888581": 400,
"26824925635": 400,
"26824931682": 400,
"26824932722": 639,
"26824933226": 500,
"26824934478": 500,
"26824936675": 700,
"26824937278": 400,
"26824937528": 600,
"26824961116": 400,
"26824973216": 400,
"26824973399": 400,
"26825089436": 784,
"26825089826": 190,
"26825096119": 600,
"26825100170": 500,
"26825108688": 400,
"26825326207": 530,
"26825342736": 590,
"26825354034": 400,
"26825391533": 400,
"26825421760": 500,
"26825440250": 400,
"26825445534": 500,
"26825451244": 400,
"26825485629": 400,
"26825534661": 400,
"26825535110": 400,
"26825536273": 400,
"26825711691": 2600,
"26825737686": 400,
"26825840759": 1742,
"26825906082": 500,
"26825921632": 6050,
"26825965281": 1876,
"26826064789": 300,
"26826480759": 500,
"26826623438": 400,
"26826651980": 700
},
"out": {
"26825356334": -22581
},
"in_total": 40,
"out_total": 1,
"in_sum_total": 29206,
"out_sum_total": -22581,
"from": "2024-12-11",
"to": "2024-12-11",
"iban": "CZ8545635664567300043347"
}
The Fio API enforces a 30-second cooldown between requests using the same token (HTTP 409 on violation).
The SpojeNet\FioApi\Downloader automatically configures a shared rate limiter (/tmp/fio-ratelimit.json) so concurrent processes (e.g. multiple MultiFlexi jobs) coordinate API calls without hitting the limit.
No manual setup is needed — just use the downloader as usual:
$downloader = new \SpojeNet\FioApi\Downloader($token);
$transactions = $downloader->downloadSince(new \DateTimeImmutable('-1 day'));
You can also provide a custom rate limiter if needed:
$store = new \FioApi\RateLimit\JsonRateLimitStore('/path/to/store.json');
$limiter = new \FioApi\RateLimit\RateLimiter($store, true); // true = wait mode
$downloader = new \SpojeNet\FioApi\Downloader($token, null, $limiter);
See php-mhujer-fio-api Rate Limiting for details on wait/throw modes and custom store backends.
Run all tests:
composer test
Run only integration tests (requires .env with FIO_TOKEN):
vendor/bin/phpunit --testsuite Integration
Created using the library fio-api-php (Spoje-NET fork with rate limiting support)
These FioBank statement tools are fully compatible with MultiFlexi - a powerful application management platform. MultiFlexi allows you to:
All three tools (fiobank-statement-downloader, fiobank-statement-mailer, fiobank-transaction-report) are available as ready-to-run MultiFlexi applications.
See the full list of ready-to-run applications within the MultiFlexi platform on the application list page.
For Linux distributions based on Debian/Ubuntu, .deb packages are available through the VitexSoftware repository:
# Add the repository
echo "deb http://repo.vitexsoftware.com $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list
# Add the GPG key
sudo wget -O /etc/apt/trusted.gpg.d/vitexsoftware.gpg http://repo.vitexsoftware.cz/keyring.gpg
# Update package list and install
sudo apt update
sudo apt install fiobank-statement-tools
For other systems or development purposes, you can install via Composer:
composer require spojenet/fiobank-statement-tools
Docker images are available:
# Download statements
docker run spojenet/fiobank-statement-downloader
# Send statements via email
docker run spojenet/fiobank-statement-mailer
# Generate transaction reports
docker run spojenet/fiobank-transaction-report
After installation, the following commands are available:
Applications in this package use the following exit codes:
0: Success1: General error404: Not found - resource does not exist409: Conflict - request conflicts with server state500: Internal server error