Desktop app that scans used books in under 30 seconds, extracts data via Gemini vision, live-prices, and lists on eBay, +400% throughput via computer vision and GenAI.
The challenge
In the used-book trade the bottleneck isn't sales, it's data entry. Per book, staff used to spend 3 to 5 minutes photographing, transcribing (title, author, ISBN), researching prices, SEO-optimising, and uploading. At thousands of books per month that's enormous labour cost, before a single euro is earned.
The solution: hardware meets AI
An end-to-end pipeline that ties the physical scan process to multimodal AI and live APIs:
- Smart scanning. The book sits on a mat calibrated with ArUco markers. The webcam corrects perspective in real time, physically measures dimensions (for automatic shipping classes) and scans the barcode.
-
AI data extraction. Two high-resolution scans (cover + back) go to
Gemini 2.5 Flash. A strict JSON schema extracts title, author, publisher, year. - Automatic pricing. Cross-checks against the Google Books API, queries the eBay Browse API for live competitor listings, and calculates a competitive price with profit-margin protection.
- Background upload. One operator click, a background worker pushes the listing live via the eBay Trading API while the next book is already being scanned.
Engineering highlights & fail-safe architecture
Absolute reliability was the core focus, the app runs in warehouse operations; downtime directly costs money:
-
Trust-but-verify on AI data. Since LLMs occasionally hallucinate ISBNs, the architecture treats AI output as a hypothesis only. The ISBN is forcibly validated against the hardware barcode scan and a Google Books fuzzy match (
thefuzz). Bad data is blocked before it corrupts the listing. -
Hybrid computer vision. Dual barcode-decoding system (
ZBarfor clean,zxing-cppfor damaged codes), maximum recognition rates even on old, scratched books. -
Thread-safe capture pipeline. To prevent Windows
STATUS_HEAP_CORRUPTIONcrashes from competing camera restarts: strict VideoCapture ownership inside a dedicated, watchdog-monitored capture thread. -
Zero-touch database migrations. SQLite in WAL mode with automatic schema migration at app start. Every migration locked in by an explicit
pytestsuite. Updates roll without customer intervention.
The result
- +400% throughput. From 3–5 minutes per book to under 30 seconds.
- Cold start → first frame: 2–4 seconds.
- Scan → price: 4–6 seconds.
- ~6,450 LOC production code, locked in by ~2,720 LOC of unit tests (260+ pytest tests) + GitHub Actions CI.
- Deployment: 165 MB monolithic PyInstaller executable, double-click, done.

Top comments (0)