Complete guide for FioFetch, the transaction fetcher and manager for Czech Fio Bank.
FioFetch is a self-hosted web application for fetching, storing, and managing transactions from Fio Bank. It provides a modern web interface and REST API for accessing your transaction data.
Key Features:
Fio Bank API Token:
System Requirements:
1. Build the image:
./d10_build.sh
2. Run the container:
FIO_FETCH_TOKEN=your_token ./d20_run.sh
3. Access the app: Open http://localhost:3000 in your browser
4. Configure (if token not set):
Backend:
cd fio_fetch_py
uv sync
export FIO_FETCH_TOKEN=your_token
fiofetch
Frontend:
cd fio_fetch_webui
yarn install
yarn dev
Access backend at http://localhost:3000, frontend at http://localhost:5174
FioFetch supports multiple configuration sources (in priority order):
~/.config/fio_fetch/config.yaml)| Option | CLI | Environment | Config File | Default |
|---|---|---|---|---|
| Host | --host |
FIO_FETCH_HOST |
host |
0.0.0.0 |
| Port | --port |
FIO_FETCH_PORT |
port |
3000 |
| Token | --fio-token |
FIO_FETCH_TOKEN |
fio-token |
(none) |
| DB Path | --db-path |
FIO_FETCH_DB_PATH |
db-path |
~/.config/fio_fetch/fio.db |
| Static Dir | --static-dir |
FIO_FETCH_STATIC_DIR |
static-dir |
static |
| API URL | --fio-api-url |
FIO_FETCH_API_URL |
fio-api-url |
https://fioapi.fio.cz/v1/rest |
| History Limit | --back-date-days |
FIO_FETCH_BACK_DATE_DAYS |
back-date-days |
3 |
Command Line:
fiofetch --host 0.0.0.0 --port 8080 --fio-token YOUR_TOKEN
Environment Variables:
export FIO_FETCH_TOKEN=your_token
export FIO_FETCH_PORT=8080
export FIO_FETCH_BACK_DATE_DAYS=7
fiofetch
Configuration File (~/.config/fio_fetch/config.yaml):
host: 0.0.0.0
port: 3000
fio-token: YOUR_FIO_BANK_TOKEN
db-path: ~/.config/fio_fetch/fio.db
static-dir: /app/static
fio-api-url: https://fioapi.fio.cz/v1/rest
back-date-days: 7
Docker with Environment Variables:
docker run -d \
-p 3000:3000 \
-e FIO_FETCH_TOKEN=your_token \
-e FIO_FETCH_BACK_DATE_DAYS=7 \
-v ~/.config/fio_fetch:/root/.config/fio_fetch \
fiofetch:latest
Overview page showing:
Manual Fetch:
Set History Limit:
What is History Limit?
Features:
Columns:
Actions:
Settings:
Actions:
Zárazka (Czech for “stopper” or “checkpoint”) is a date marker in Fio Bank that limits how far back the API searches for transactions.
Purpose:
Use when:
Don’t use when:
Method 1: Web UI
Method 2: API
curl -X POST http://localhost:3000/api/v1/set-last-date \
-H "Content-Type: application/json" \
-d '{"days_back": 7}'
Method 3: Configuration
# config.yaml
back-date-days: 7
| Scenario | Recommended Days | Reason |
|---|---|---|
| First setup | 7-30 days | Safe starting point |
| Regular use | 3-7 days | Daily/weekly fetching |
| Monthly check | 30-60 days | Monthly reconciliation |
| Full history | Don’t set | Fetch all available |
| Troubleshooting | 1-3 days | Minimal data for testing |
Initial Setup:
# 1. Set history limit to 7 days
curl -X POST http://localhost:3000/api/v1/set-last-date \
-d '{"days_back": 7}'
# 2. Fetch transactions
curl -X POST http://localhost:3000/api/v1/fetch
# 3. Gradually increase if needed
curl -X POST http://localhost:3000/api/v1/set-last-date \
-d '{"days_back": 30}'
curl -X POST http://localhost:3000/api/v1/fetch
What happens behind the scenes:
POST /rest/set-last-date/{token}/{date}/API Rate Limits:
Get Configuration:
curl http://localhost:3000/api/v1/config
Fetch Transactions:
curl -X POST http://localhost:3000/api/v1/fetch
Get Transactions:
curl http://localhost:3000/api/v1/transactions?limit=50&offset=0
Set History Limit:
curl -X POST http://localhost:3000/api/v1/set-last-date \
-H "Content-Type: application/json" \
-d '{"days_back": 7}'
Export JSON:
curl http://localhost:3000/api/v1/export/json > transactions.json
Export CSV:
curl http://localhost:3000/api/v1/export/csv > transactions.csv
Swagger UI: http://localhost:3000/docs
ReDoc: http://localhost:3000/redoc
See API.md for complete API reference.
Build and run:
./d10_build.sh && ./d20_run.sh
With custom settings:
FIO_FETCH_PORT=8080 FIO_FETCH_TOKEN=your_token ./d20_run.sh
View logs:
./d40_logs.sh
# or
docker logs -f fiofetch
Stop container:
./d30_stop.sh
# or
docker stop fiofetch
Restart:
docker restart fiofetch
Access shell:
docker exec -it fiofetch /bin/bash
Volume Mapping:
~/.config/fio_fetch//root/.config/fio_fetch/Persisted Files:
config.yaml: Configurationfio.db: SQLite databaseBackup:
cp -r ~/.config/fio_fetch ~/backups/fio_fetch-$(date +%Y%m%d)
Restore:
cp -r ~/backups/fio_fetch-20251130 ~/.config/fio_fetch
docker restart fiofetch
For production, add:
See DOCKER.md for complete deployment guide.
Transactions Table:
CREATE TABLE transactions (
id INTEGER PRIMARY KEY,
date TEXT NOT NULL,
amount REAL NOT NULL,
currency TEXT NOT NULL,
counterparty TEXT,
description TEXT,
type TEXT NOT NULL,
variable_symbol TEXT,
specific_symbol TEXT,
constant_symbol TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Method 1: File Backup
# Backup database file
cp ~/.config/fio_fetch/fio.db ~/backups/fio.db.$(date +%Y%m%d)
Method 2: SQL Dump
sqlite3 ~/.config/fio_fetch/fio.db .dump > backup.sql
Method 3: Export API
curl http://localhost:3000/api/v1/export/json > transactions-backup.json
From Backup:
# Stop FioFetch
docker stop fiofetch
# Restore database
cp ~/backups/fio.db.20251130 ~/.config/fio_fetch/fio.db
# Restart
docker start fiofetch
From SQL Dump:
sqlite3 ~/.config/fio_fetch/fio.db < backup.sql
Check database size:
ls -lh ~/.config/fio_fetch/fio.db
Vacuum database:
sqlite3 ~/.config/fio_fetch/fio.db "VACUUM;"
Count transactions:
sqlite3 ~/.config/fio_fetch/fio.db "SELECT COUNT(*) FROM transactions;"
Cannot fetch transactions:
Problem: 401 Unauthorized Solution:
Problem: 422 Unprocessable Entity Solution:
Problem: 429 Too Many Requests Solution:
Problem: 503 Service Unavailable Solution:
Problem: 504 Gateway Timeout Solution:
Container won’t start:
# Check logs
docker logs fiofetch
# Common causes:
# - Port already in use
# - Volume permissions
# - Invalid configuration
Port conflict:
# Use different port
FIO_FETCH_PORT=8080 ./d20_run.sh
Permission denied:
# Fix volume permissions
chmod -R 755 ~/.config/fio_fetch
Database locked:
# Stop all FioFetch instances
docker stop fiofetch
# Wait a moment
docker start fiofetch
Corrupted database:
# Restore from backup
cp ~/backups/fio.db.20251130 ~/.config/fio_fetch/fio.db
docker restart fiofetch
Connection refused:
docker ps | grep fiofetchdocker port fiofetchcurl http://localhost:3000/Slow responses:
Enable detailed logging:
# Local
fiofetch --debug
# Docker
docker run -d \
-e LOG_LEVEL=DEBUG \
-p 3000:3000 \
-v ~/.config/fio_fetch:/root/.config/fio_fetch \
fiofetch:latest
View logs:
docker logs -f fiofetch
Token Security:
Network Security:
Data Security:
Container Security:
Using cron:
# Add to crontab
0 * * * * curl -X POST http://localhost:3000/api/v1/fetch
Using systemd timer:
# /etc/systemd/system/fiofetch.timer
[Unit]
Description=FioFetch Hourly
[Timer]
OnCalendar=hourly
Persistent=true
[Install]
WantedBy=timers.target
Python:
import requests
BASE_URL = "http://localhost:3000/api/v1"
# Fetch transactions
response = requests.post(f"{BASE_URL}/fetch")
print(response.json())
# Get transactions
response = requests.get(f"{BASE_URL}/transactions?limit=100")
transactions = response.json()
for tx in transactions["transactions"]:
print(f"{tx['date']}: {tx['amount']} {tx['currency']} - {tx['description']}")
Bash:
#!/bin/bash
# fetch-and-backup.sh
# Fetch latest transactions
curl -X POST http://localhost:3000/api/v1/fetch
# Wait a moment
sleep 5
# Export to JSON
curl http://localhost:3000/api/v1/export/json > \
~/backups/transactions-$(date +%Y%m%d).json
echo "Backup completed"
JavaScript:
const ws = new WebSocket("ws://localhost:3000/ws");
ws.onopen = () => console.log("Connected");
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === "fetch_completed") {
console.log(`Fetched ${data.count} transactions`);
}
};
For additional help, see the documentation or check the GitHub repository.