A sourcing engine for a book arbitrage seller · Node + Express · vanilla JS · Chrome DevTools Protocol
The Book Sourcing Engine.
Two thousand listings in, seven verified books out. Every margin is computed from what the listing actually says today, not what an index said last week.
An indexed price, and nothing else.
The client buys used books cheap and resells them on Amazon FBA. He was choosing books by hand from a paid research tool that gave him an indexed price and nothing more. So he was buying copies that had already sold, copies in unsellable condition, and copies from overseas sellers whose postage ate the entire margin. He found all of this himself, checking one list by hand.
A sourcing engine and a morning control panel.
Node and Express on the back; plain HTML, CSS, and vanilla JavaScript on the front. No framework, no build step, no bundler, no database: JSON files on disk are the store. Four dependencies across both halves. About 7,700 lines.
The narrowing is the product. Each surviving book is opened on the shop that actually sells it, and the last stage (real Amazon fees, per book) is what cuts seven hundred candidates down to single figures.
Four shops, read politely.
One shop serves plain HTML, so a fetch is enough. Three sit behind bot protection, so those go through a real browser driven over the Chrome DevTools Protocol with a throwaway profile. Nothing defeats a challenge: the engine waits for the ones that clear on their own, and reports the ones that do not.
Five bugs that never threw an error.
Every one of these produced confident, wrong numbers. Finding them is most of what the client paid for.
230 checks before any change ships.
The checks pin behaviour, not implementation. A few of them:
- →Postage is inside the money, on every path that spends it.
- →The fee constants have not silently drifted.
- →The spreadsheet export still carries the byte order mark Excel needs.
- →A row that could not be verified is dropped, not shown.
One gate fails on purpose until changes to the scraping engine are committed deliberately, so the engine can never be edited casually.
An antiquarian bindery, not a dashboard.
One non-technical person reads this once each morning. The visual identity is bottle-green leather, gold tooling, and aged paper, because it is a book business. After the theme change, every text-and-background pair was measured for WCAG AA contrast; the lowest ratio on the page is 4.67:1.
Each row shows the profit subtraction written out in full, so the client can check the arithmetic himself; the condition and the town the copy ships from; and the sales rank expressed as a rough waiting time rather than a raw number.
What I deliberately did not build.
Seven books, to the cent.
Every figure on a saved list recomputes to the cent from the engine’s own functions. A typical morning: 7 books, $196.98 of a $200 budget, $67.78 of estimated profit. Every copy was verified live before it reached the screen.
Stated plainly: no book has sold through yet, so the profit figures are estimates and are described that way. What the engine has already removed are the silent losses (the sold copies, the unsellable conditions, the overseas postage) that used to be discovered by hand, after the money was spent.
Running an Amazon operation on hand-checking?
Tell me what you verify by hand every morning. I’ll tell you which parts a system can verify for you, and which parts it honestly can’t.