The problem
The brands sell on Shopify, WooCommerce, PrestaShop, Magento and custom shops. Some pages render everything in JavaScript. Some hide the nutrition table behind a tab. They are written in English, Italian, Spanish, French, Dutch and German, and state values per serving, per 100 g or per litre of prepared drink.
A rule-based scraper per site breaks every time a shop redesigns. Manual data entry for more than 1,600 products goes out of date within weeks.
What we did
Let the model read, let the code decide. Each product page goes to Claude Haiku with a fixed schema through tool use, so the answer is always valid JSON with the same fields: name, flavours, weight, price, calories, carbohydrates, sodium, caffeine, minerals, dietary flags. Free text is translated to English. Anything derived, like price per kilo, is computed in code, and values outside sane bounds are dropped. A missing value is better than a wrong one, because the numbers feed a race-day fuelling calculator.
Wrote rules where the model was guessing. Hydration brands often state electrolytes per litre of prepared drink. The prompt only knew “per serving” and “per 100 g”, so one brand’s whole tablet range came back with no sodium, the one number those products are bought for. A per-litre rule that uses the dilution printed on the page fixed it: 250, 500 and 750 mg per tablet, exactly what the product names promise at 500 ml.
Kept junk out of the catalogue. Category pages, recipes and partner pages were being picked up as products, and seven of them reached the live site as empty cards. A rejection list in code plus a guard that drops any extraction without a name fixed it. Tested against all 138 hand-picked product URLs: zero real products rejected. When in doubt the filter lets a page through, because losing a real product costs more than catching a listing one step later.
Split the weekly run per brand. At 16 brands the run took five minutes. At 34 brands with more categories it hit the 30-minute limit and was cancelled two weeks in a row. Now each brand runs as its own job with its own 20-minute cap, so one slow or blocked shop fails alone and the rest still ship.
Made bad runs fail loudly. Three weekly runs showed green while the LLM calls were failing on account credits, and one of them produced zero products. Now a one-call preflight stops the run on billing or authentication errors, each brand job stops at the first fatal error, and a final gate turns the run red if the total drops below 200 products, below half of the best of the last four runs, or if more than two brands are unhealthy. Checked against the real outputs: the zero-product run and a 577-instead-of-1,643 run both fail, the healthy one passes. A red run is never imported.
Stopped paying twice for the same page. Each page is fingerprinted, and an unchanged page reuses last week’s extraction instead of calling the model again. The cache invalidates itself when the prompt, schema or model changes. We will report the saving once live runs measure it, not before.
Stayed polite. Each shop sees at most three requests at a time with a pause after every page. Only public product facts are collected: no reviews, no personal data.
What it shows
AI used for the part it is good at, reading messy pages, with ordinary code, tests and thresholds around it. This is how we approach applied data science: the model is one step in a pipeline that is run like production, and a quiet failure counts as an outage.