The pipeline in daily stock checks at big-box retailers changed direction twice, which is the most useful thing about it. Neither scraping nor buying is a permanent answer.
What are you actually buying?
You are buying a schema, a coverage list, and an on-call rota. Five questions separate a data purchase that works from one that becomes a second scraper:
- Coverage. Does the vendor cover every retailer and every store you report on, or only the national average? A per-store stock report needs per-store data.
- Grain. Is the record one row per SKU per store per day, or one row per SKU? The grain decides what you can build on top.
- Schema stability. Are field names and value sets versioned, with a change log? A vendor that renames a field without notice is a scraper with a support desk.
- Freshness. How old is the data at the moment you read it? For stock, hours matter. For catalogue attributes, days do not.
- Exit. Can you export your history, and does the contract let you leave? A vendor you cannot leave is a dependency, not a supplier.
The vendor that answers all five in writing is rare. The one that answers three is normal, and the missing two tell you which parts of your pipeline still need a scraper.
What does a scraper actually cost?
A scraper costs build time, breakage time, and attention. The first is visible in a project plan, the second is a line in next year’s budget, and the third is the one that decides whether the system survives.
| Cost | What it looks like | Who pays |
|---|---|---|
| Build | selectors, waits, normalisers, evidence, reporting | the project that starts it |
| Breakage | a layout change, a renamed class, a new consent step | whoever is on call that week |
| Attention | checking that yesterday’s report is complete | the person who trusts the number |
| Coverage gaps | a store, a variant, or a field the page does not show | the decision the report was meant to support |
None of those costs show up in a scraping library’s documentation. They show up in the third month, when the report is quietly short a few hundred rows and nobody notices because the total still looks plausible.
That is the real case for buying: not that the vendor’s extraction is better, but that someone else owns the breakage. If the vendor’s coverage matches your report, that transfer is worth a lot.
Decision one: store-level stock at two retailers
The first version used stock Playwright against product pages. It worked, and it was the right way to learn what the pages actually expose.
The second version moved to a commercial retail data API. That is the correct move when the vendor covers your retailers and the fields you report on, because it removes the browser fleet, the profile handling, and most of the breakage.
The third version moved back to a hardened browser. The round trip is the interesting part: an API is a fixed contract, and a report that needs a field, a store, or a timing the contract does not carry puts the browser back in the path. That is a requirement change, not a pipeline failure.
The lesson is to design for the move. Keep the check record independent of the source — the same table with a source column — so swapping a browser for an API is a change of writer, not a change of schema. The post on hardened browsers covers the browser side of that swap.
Decision two: a login-gated brand portal
A wholesale brand portal had no public API, so the catalogue was read from its pages behind a login. Fifteen active brands sat behind that one login, and the naive plan was fifteen scripts.
The build that worked was one configurable engine: log in once, read the brand manifest, run the same extraction pipeline per brand, and store everything in one normalised database. Fifteen active brands plus five pending ones were recorded in a manifest. The whole change set was 2,411 lines across new and rewritten files (from the build summary).
The expensive part was not the scraping. It was identity. The portal has no SKU: a product is a style number plus a colour plus a size code, and each colour is its own row. Matching that to a storefront SKU required brand name plus a normalised product number, and the measured match rate across the first five brands ran from 79% to 100%. The unmatched tail was mostly discontinued styles, which meant the connector needed a reconciliation and override step rather than a clean join.
That is the pattern to budget for whenever you scrape a portal: the extraction is the visible work, and the identity mapping is the project.
Decision three: replacing a monitoring vendor
The third decision went the other way. A price-monitoring platform was built to replace an incumbent service, which is the buy-to-build direction and the harder one to justify.
The replacement had monitoring, imports, reporting, evidence storage, and a review workflow. What it did not have was parity, because the incumbent’s real behaviour had never been captured: no genuine export file, no sample of each report, no examples of how a violation was decided. The project’s own findings document says the import contract, report columns, scheduling model, and alert behaviour were based on assumptions and synthetic tests, not on production evidence.
That is the cost of leaving a vendor that nobody budgets for. The subscription is visible; the undocumented behaviour is not. A migration needs one real export, one sample of each report people actually use, and a written acceptance list before the first line of replacement code is written.
Scrape, buy, or something in between?
There are four options, and the middle two are where most teams should land.
| Scrape with a browser | Buy a data API | Buy a monitoring platform | Read the site’s own endpoint | |
|---|---|---|---|---|
| Coverage | whatever the page shows | the vendor’s retailer list | the vendor’s workflow | whatever the page’s front end uses |
| Grain | you define it | usually SKU × store | often SKU × retailer | whatever the page requests |
| Schema | yours | vendor’s, versioned if you are lucky | vendor’s, plus their UI | undocumented |
| Breakage owner | you | vendor | vendor | you |
| Best when | login-gated, unusual fields, small grid | standard fields at scale | you want the workflow, not just the rows | the page already has the data you need |
| Worst when | the grid is large and the site changes often | you need a field they do not sell | you need to change how a decision is made | the page changes its own API |
Which should you choose? Buy the data API when your report is made of standard fields at a scale you cannot check inside the window, and the vendor covers every store you report on. Buy the monitoring platform when the workflow around the data — cases, review, evidence, alerts — is most of the value, and you would rather not build it. Scrape when the data is behind a login, when the field you need is unusual, or when the grid is small enough that a fleet finishes in an hour. Reach for the site’s own endpoint when the page already fetches exactly what you need, and accept that you now own an undocumented contract.
What is the middle path?
The middle path is to keep the browser for the session and read the data the page itself requests. It is often more accurate than parsing the rendered widget, and it avoids buying a feed.
In one store checker, the rendered availability box was unreliable: it could stay empty on a valid page while the inventory response behind it returned data. Reading that response from inside the same authenticated page session removed a whole class of false negatives, and the browser’s only job became establishing and holding the session.
The trade-off is that you have adopted an undocumented contract. The response can change without notice, it is not covered by any compatibility promise, and it may differ by store or by experiment. Treat it as a recipe with a version and a validation set — the same discipline described in self-healing scrapers — rather than as an API.
What broke and what we changed
A vendor migration started without a single real export. The replacement’s importer expected one denormalised row with a client SKU, brand, product name, MAP price, retailer, and product URL. Nobody had a production export to check that against, and the only import tests used synthetic rows. The fix was to stop calling it parity and write an acceptance list: import one real export unmodified, reconcile totals, and match every report people use. The broader change was procedural — no migration starts until the source artifacts exist.
One scraper assumed fifteen brands shared one flow. Only three of the fifteen active brands went straight from the brand list to a product list. The other twelve landed on a brand home page first, and the product lists used more than one layout. The fix was a per-brand manifest with a route and an archetype, plus two list parsers, instead of a single hard-coded path.
The rendered widget was treated as the source of truth. A valid page with an uninitialised availability widget read as “out of stock”. The fix was to read the inventory response inside the page session and fall back to the widget only when that response is absent. The general rule: when the page has a data source, prefer it to the page’s rendering of it.
The join was assumed to be clean. The portal had no SKU, and matching on brand plus normalised style number left a tail of unmatched products. The first plan treated that tail as an error; the working plan treated it as a reconciliation queue with manual overrides. Discontinued styles are not a bug in the scraper.
Related
Frequently asked questions
Is it cheaper to scrape or to buy data?
It depends on volume and breakage, not on the unit price of either option. A small grid on a stable site is cheaper to scrape, because the build is small and the breakage is rare. A large grid on sites that redesign often is cheaper to buy, because the breakage lands on the vendor. Compare the two on total attention per year, not on the first month.
When should you stop scraping and buy the data?
Stop when the vendor covers every retailer and field you report on, the grain matches your decisions, and the breakage you currently absorb is more than the vendor relationship costs you. If any of those three is missing, keep the scraper for the gap and buy for the rest.
How do you evaluate a data API vendor?
Ask for the coverage list, the record grain, a schema change log, a freshness guarantee, and the export terms. Then test the vendor's hardest case: a store it may not cover and a field you report on. A demo built on clean national data says little about per-store coverage.
What is the hidden cost of scraping?
Attention. The build is visible and the breakage is intermittent, but the ongoing cost is the person who confirms that yesterday's report is complete. That cost grows with the number of sites rather than the number of rows, because each site has its own layout and release schedule.
Can you scrape a login-gated portal?
Yes, when the account is entitled to the data and the terms allow automated access. The engineering work is session persistence and identity mapping, not the login. Keep one profile per portal and expect the mapping from portal records to your own SKUs to take longer than the extraction.
What is the middle path between scraping and buying?
Keep a real browser for the session and read the structured response the page itself uses, instead of parsing the rendered HTML. It gives you the page's own data at the page's own freshness, without a vendor. The cost is an undocumented contract that you now have to version and validate.
How do you migrate off a data vendor?
Capture the vendor's output before you cancel: one real export, one sample of every report people use, and a record of how decisions were made from the data. Then build the replacement against those artifacts, not against your memory of them. The migration fails when the replacement is judged against an imagined version of the vendor.
