A web application that allows you to scan receipts and automatically create transactions in Firefly III.
Check out the demo video below to see the Receipt Scanner in action:
output_compressed.mp4
- Upload and scan receipts using Google's Gemini AI
- Extract key information: date, amount, store name, category, and budget
- Review and edit extracted data before creating transactions
- Create transactions in Firefly III with a single click
- Automatically adds an
#automatedtag to all created transactions - Mobile-friendly interface for scanning receipts on the go
- Docker and Docker Compose
- A Firefly III instance
- A Google AI API key
-
Clone this repository:
git clone https://github.com/yourusername/receipt-scanner.git cd receipt-scanner -
Create a
.envfile based on the.env.example:cp .env.example .env -
Edit the
.envfile with your configuration:# Firefly III API Configuration FIREFLY_III_URL=https://your-firefly-iii-instance.com FIREFLY_III_TOKEN=your-personal-access-token # Google AI API Configuration GOOGLE_AI_API_KEY=your-google-ai-api-key GEMINI_MODEL=gemini-2.5-flash
To use this application, you'll need a personal access token for Firefly III. Follow the instructions in the official documentation to generate one: Firefly III API - Personal Access Tokens
To use Google's Gemini AI, you'll need an API key. Visit the following URL to request one: https://aistudio.google.com/apikey
You will be asked to enter a credit card for verification purposes, but personal usage will most likely fall within the free tier.
The GEMINI_MODEL environment variable controls which Gemini model is used for receipt scanning. The recommended default is gemini-2.5-flash, which offers a good balance of speed and accuracy. You can change this to any supported Gemini model (e.g. gemini-2.5-pro for higher accuracy). See the full list of available models at Google AI models.
This application does not include built-in authentication. It is recommended to deploy it within your local network, ideally alongside your Firefly III instance. To securely access the application remotely, consider using a VPN to connect to your local network.
-
Build and start the application:
docker-compose up -d -
Access the application at http://localhost:8000
-
Install the required dependencies:
pip install -r requirements.txt -
Run the application:
uvicorn app.app:app --host 0.0.0.0 --port 8000
- Open the application in your web browser
- Select a source account from the dropdown menu
- Use the camera to take a photo of your receipt
- Review and edit the extracted data
- Click "Create Transaction" to create the transaction in Firefly III
If you're using a phone, consider adding a bookmark of the app to your home screen for easier access.

To update to the latest version:
-
Pull the latest changes:
cd firefly-receipt-scanner git pull -
Check
.env.examplefor any new environment variables and add them to your.envfile if needed. -
Rebuild and restart the containers:
docker-compose up -d --build
Your .env file will not be affected by the update.
- Image Processing Timeout: If you receive a timeout error when processing an image, try using a clearer image with better lighting and less glare.
- Transaction Creation Failed: If transaction creation fails, check your Firefly III connection and ensure your API token has the necessary permissions.
- Camera Not Working: Ensure your browser has permission to access your camera. For mobile devices, you may need to use HTTPS.
app/- Application codeapp.py- FastAPI application and routesfirefly.py- Firefly III API integrationreceipt_processing.py- Receipt data extraction and processingimage_utils.py- Image processing utilitiesmodels.py- Data modelstemplates/- HTML templatesstatic/- Static assets (CSS, JavaScript)
Contributions are welcome! Please feel free to submit a Pull Request.
MIT