Backblaze Invoice Downloader
Download Backblaze invoices as PDF using browser automation.
Backblaze only provides invoices via a web page that must be printed — this tool automates that process using Playwright, filling in configurable fields (VAT ID, document type, company, notes) and exporting each invoice to PDF.
Setup
pip install -r requirements.txt
playwright install chromium
Or with Nix:
nix develop
Configuration
Create a .env file (see .env.example):
BACKBLAZE_EMAIL=you@example.com
BACKBLAZE_PASSWORD=your_password
INVOICE_VAT_ID=DE123456789
INVOICE_DOCUMENT_TYPE=Invoice
INVOICE_COMPANY=My Company GmbH
INVOICE_NOTES=Internal ref: 12345\nLine 2\nLine 3
OUTPUT_DIR=./invoices
BROWSER_HEADLESS=true
DOWNLOAD_ALL_YEARS=false
Notes can include literal \n to create line breaks in the invoice “Other” field.
Usage
python main.py
Options
-o, --output DIR Output directory (default: ./invoices)
--headless Run browser headless
--no-headless Show browser window (useful for debugging)
--vat-id ID VAT ID to fill on invoices
--document-type TYPE Document type to select
--company NAME Company name to fill
--notes TEXT Notes to fill on invoices
--all-years Download invoices for all years (default: first year only)
-v, --verbose Verbose logging
CLI arguments override .env values.
How it works
- Logs in to
secure.backblaze.com - Navigates to the billing page
- Iterates over all billing groups and the selected year(s) (first year by default)
- For each invoice, opens the invoice page, fills the configured fields, and exports to PDF
- Skips already-downloaded invoices
Description
Languages
Python
95.2%
Nix
4.8%