Build a free receipt scanner that lives inside your Google Sheets budget. You photograph a paper receipt on your phone and Gemini reads the store, date, total and category, then adds a row to your Transactions table. You need a Google account and a free Gemini API key from Google AI Studio.
YouTube video: Google Apps Script Web App with Gemini (Free): Receipt Scanner for Google Sheets
Caption availability is unknown. Check the CC control in the YouTube player.
Choose a chapter (11)
- Video length
- 10 min 29 s
- Time to do it
- 45 minutes
- Difficulty
- Medium
- Steps
- 9
What you need
Steps
Open your budget spreadsheet and make a Transactions sheet with a table using the columns Date, Description, Category and Amount, header in row 1. Use Format, then Convert to table.
Add a Categories sheet with category names in column A and their type (Income, Expense or Savings) in column B, starting in row 2.
Go to Google AI Studio and create a free API key for the gemini-3.5-flash-lite model. Copy the key somewhere safe for now.
In gemini.google.com, start a new chat and paste a detailed prompt describing the app: the two files Code.gs and Index.html, the sheet layout, the model name, JSON-only answers and the duplicate check.
In your spreadsheet open Extensions, then Apps Script. Paste the generated Code.gs, add an HTML file called Index.html with the page code, and click Save.
Open Project Settings, then Script Properties, and add a property named GEMINI_API_KEY with your key as the value. Never paste the key into the code itself.
Click Deploy, then New deployment, choose Web app, set Execute as Me and Who has access to Only myself, then click Authorize access and allow the permissions.
Open the web app link on your phone, tap Scan receipt, take a photo and wait for the status message. Check the new row in your sheet.
Add the page to your phone home screen from the browser menu so you can scan receipts in one tap.
Tips and common mistakes
If you get a 404 model error, open Code.gs and make sure the model name is exactly gemini-3.5-flash-lite.
If the app still behaves the old way after a code change, go to Deploy, Manage deployments, click the pencil, pick New version and deploy. The link stays the same.
If the page shows an empty card with NaN, close the app fully and open it again.
Keep the API key in Script Properties only. A key pasted into the code can leak if you share the sheet.
Questions
Do I need to pay for the Gemini API?
No. The free API key from Google AI Studio covers a limited number of requests per day, which is plenty for personal receipt scanning.
What happens if I scan the same receipt twice?
The app checks for a row with the same date, amount and store name. If it finds one, it asks whether to add anyway or cancel.
Can someone else open my web app?
No, as long as you set Who has access to Only myself when you deploy. The app runs under your Google account.
The notes are drafted automatically from video details and general task knowledge. How the guide was prepared
Report a correction


