You're staring at a green dashboard. Every price row passed the not-null check, the pass rate reads 100%, and a product has sat at 0.00 for three days. The parser did its job. The decision that follows will not.
That's the usual trap with scraped data. A row can be present, typed, and still useless for the price you publish, the rank you report, or the training set you ship. Data validation methods exist to ask a harder question: is this record fit for the decision it feeds?
What follows is the order a patient engineer would walk a colleague through. Cheap structural checks run on every batch. Relationship and time checks come next. Costly cross-source comparisons run on a sample. Each method catches a different defect, and no single method is enough.
Data Validation Methods by Defect Caught
A validation method is defined by the defect it catches. If you only know that a check "passed," you don't know which failure it was even able to see. The catalogue below follows pipeline order, from cheap structure to costly comparison with an independent source.
| Method | What It Catches | Scraped-Data Example | Relative Cost |
|---|---|---|---|
| Type check | Wrong data type | Price arrives as text such as N/A | Low |
| Format and pattern | Malformed values | Date not matching YYYY-MM-DD | Low |
| Range and plausibility | Impossible values | Listed product price of 0.00 | Low |
| Completeness rate | Missing required fields | Product title empty in 15% of rows | Low |
| Uniqueness | Duplicate keys | Same product URL appearing in two rows | Medium |
| Referential integrity | Broken links between tables | Review rows pointing to deleted product IDs | Medium |
| Freshness | Stale records | Cached page serving a three-day-old price | Low |
| Distribution drift | Silent shifts in value patterns | Average price moves sharply after a page redesign | Medium |
| Cross-source comparison | Values that disagree with independent sources | Price differs from the retailer's own feed | High |
Read the cost column as a scheduling rule. Low-cost checks run on every batch. Medium checks run on all records when volume allows, or on a partition when it doesn't. High-cost checks run on a sample. No row in the table covers every defect, which is why a single green rate is a weak signal.
Two jobs that get mixed up
Verification checks values against rules inside your system: required fields, date formats, approved country codes. Validation compares the data with external evidence, a benchmark, or an independent source, and asks whether the record represents reality. A 2020 review of national data-quality practice separated those jobs clearly, and it listed 12 commonly assessed dimensions, including currency, accuracy, plausibility, completeness, concordance, and conformance. The same review catalogued seven assessment methods: gold-standard comparison, data-element agreement, element-presence checks, data-source agreement, distribution comparison, validity checks, and log review.
That framework treats quality as a multi-method process, not one pass/fail rule. On a web pipeline, schema and type checks are verification. Comparing prices, inventory, or search results across independent sources is validation. Teams that only do the first job will certify well-formed fiction.
Take a scraped price of 19.99 with currency USD. Verification passes: the value is a number, the code is on the approved list, and the field isn't empty. Validation asks whether the shop really charges 19.99 today. A second retailer, the merchant's own feed, or a fresh page fetch is the evidence. The zero-price row fails a different test entirely. It is a number, so the type check is happy, and it is present, so the not-null check is happy. Only a range or plausibility rule, something like "a listed product price must be above zero," sees the defect.
A record can be well formed and still wrong.
Before the next crawl, name the method that would have caught the zero price. That's range and plausibility. Name the one behind the three-day-old page. That's freshness. Then confirm the pipeline has at least one verification check and one validation check. If both aren't there, the 100% rate is only telling you the parser returned something.
Structural Checks for Extracted Fields
Structural checks are the cheapest line of defence, and they should run on every batch before anything joins, aggregates, or trains. Think of them as the door check at a warehouse: wrong shape, wrong label, or an empty box, and the pallet doesn't go inside.
Take one product record after you turn a page into parsed fields. Five checks cover the core:
- Schema: required columns are present and the names haven't drifted. If
price_amountis renamed toprice, later code reads a missing column as success. - Type:
price_amountparses as a decimal. The textN/Afails here, before anyone averages it. - Pattern: the SKU matches the retailer's format, such as two letters, a hyphen, and six digits.
- Range: the price is above zero and under a ceiling you set from that category's history, not from a guess.
- Completeness: the title is present in, for example, at least 98% of rows. A single empty title is a row problem. A spike is a selector problem.
A sound design combines schema, semantic, integrity, completeness, freshness, and distribution checks rather than one rule type, which is how checkpoint-style validation is meant to be used. Schema confirms fields, names, types, and structural change before downstream work. Range and pattern checks catch malformed values.
How to write the first suite
- List the required fields for that dataset only. A price feed doesn't need the same columns as a review table.
- Declare a type and a pattern for each field, using the format the source publishes.
- Set ranges from observed history. A ceiling copied from another category will either block real luxury prices or let junk through.
- Add conditional rules for page variants. A sale template carries two price fields. A rule that demands exactly one price will fail every promotion.
- Run the expectations at ingestion and again after each transformation. A cast, a join, or a currency conversion can break a value that was fine on arrival.
- Store each pass or fail with the batch identifier. Without that id, you can't replay the failure next week.
Validating only at the end is how bad rows contaminate joins, aggregations, and model features. Checkpoint-based workflows pair the batch with an expectation suite, validate it, save the result, and trigger an alert or a pipeline failure. For web data, keep schema checks strict, variant rules conditional, and uniqueness on the product or URL key.
Once those six steps exist for one dataset, you have a first suite. It won't prove the shop charged that price. It will stop the zero, the text, and the missing title from looking like a clean extract.
Integrity, Freshness and Drift Checks
A site redesign moves the price into a new element. The old selector starts reading the was-price. Every row is still a decimal, so the type check stays green, and the average falls off a cliff. That is why single-record rules aren't the end of the job.
A 2023 systematic overview found accuracy, completeness, timeliness, consistency, and relevance among the most emphasized dimensions in the literature. Earlier work by Wang and Strong started from 179 candidate dimensions, reduced them to 20, and grouped them as intrinsic, contextual, representational, and accessibility. Intrinsic quality includes accuracy and objectivity. Contextual quality includes relevance and timeliness. A dataset can be complete and inaccurate, or accurate and outdated. Nonempty fields don't cover that.
Relationships between records
Integrity looks across rows, not inside one cell.
- Uniqueness uses a natural key, such as product URL plus variant id. The same URL in two rows usually means a crawl overlap, not two products.
- Referential consistency checks that every review points at a product that still exists. Orphan reviews inflate counts and break joins.
- Duplicate detection across crawl runs compares today's key set with yesterday's. A sudden doubling often means the spider walked the same listing twice.
On a price monitoring pipeline, a duplicated URL doesn't just waste storage. It double-counts a discount and moves the average you alert on.
Time and shape
Freshness is a timestamp threshold tied to the decision, not a universal "recent enough." Stock levels might need to be under an hour old. Search rankings might tolerate 24 hours. A competitor catalogue might be fine at seven days. A cached page that still parses is a freshness failure, even when the HTML looks perfect.
Distribution drift compares the new batch with a baseline you can defend, such as a rolling 30-day median. Flag the batch when the share of null prices, or the average price, leaves an agreed band. In the redesign example, the type check cannot see that the selector changed jobs. The shift in the average can.
Choose a baseline from a period you already trust, freeze the window in the rule, and write down why that window matches the decision. A baseline taken from a broken week will teach the suite to accept the next break.
Cross-Source and Sampled Checks Where Cost Matters
A batch of product pages can parse cleanly and still be unfit for a pricing decision: prices may be zero, stale, or inconsistent across sources. Validation should test whether the data can support the decision, not only whether extraction succeeded. Scanning every record for every rule can catch more defects, but repeated full-table scans use more compute time and memory. A tiered design directs expensive checks where they are most useful.

Run inexpensive structure and null checks on every batch. Check primary-key uniqueness on every batch too, and fail fast if it breaks. Apply range and referential checks to all records when volume allows; for very large tables, run distribution checks on samples or partitions. For a cross-source price comparison, re-fetch a random sample of product pages from a second source. If those results disagree, expand the check to the affected partition rather than rescanning everything.
Fail fast or quarantine
Stop ingestion when schema compatibility, required-field completeness, or primary-key uniqueness fails. Fixing those problems after joins and aggregation can cost more than pausing the pipeline. For a small shift in an optional field, soft-fail instead: quarantine or annotate the batch for review. A minor change in an unused badge field need not block a price feed. A duplicated primary key should.
| Check | Usual Run Scope | Failure Mode | Action on Failure |
|---|---|---|---|
| Schema compatibility | Every batch | Fail fast | Stop ingestion and alert |
| Required-field completeness | Every batch | Fail fast | Stop ingestion and alert |
| Primary-key uniqueness | Every batch | Fail fast | Stop ingestion and alert |
| Range and pattern rules | All records when volume allows | Soft fail | Quarantine invalid rows |
| Optional-field distribution | Sampled or partition level | Soft fail | Annotate batch and review |
| Cross-source price comparison | Random sample | Soft fail | Flag records for re-fetch |
Record the rule version, source batch, execution time, failure count, and representative invalid records. This audit trail helps an engineer reproduce a failure and identify whether it reflects bad data, a source change, or a rule that needs review.
The data quality use cases describe ways to apply expectations to data checks. In practice, a layered suite runs against each batch and preserves its result, so teams can see which checks passed and what needs escalation.
Watch the video on YouTubeTesting Validation Rules Before Trusting Them
A validation rule is code. It needs tests of its own, or a bad threshold will certify the zero price you wrote the rule to catch.
- Build a golden set of known-bad records. Include a zero price, a was-price captured by a redesigned selector, a three-day-old cached page, a duplicated product URL, and a block page that still returned HTTP 200.
- Write one unit test per expectation. It must fail on its bad record and pass on a clean one. A test that only uses clean rows never proves the rule bites.
- Replay recent batches, for example the last 30 days, and count how many failures a reviewer accepts as real defects. The rejected share is your false-positive rate. Track it per check, not as one blended number.
- Set a ceiling for false positives on each check. Change a threshold only with a recorded reason, so a noisy week doesn't loosen the rule unnoticed.
- Version the suite next to the selectors and rerun the golden set after every site change. A selector edit without a replay is how the was-price bug returns.
One expectation in plain text
Price field. Type decimal. Digits with an optional two decimal places. Range 0.01 to 5000, taken from the last 90 days of observed prices for that category. Null rate below 2%. Hard fail on a breach.
Those bounds are an example you derive from your own history, not a universal retail law. A parts catalogue and a luxury catalogue should not share them.
Five defective records, one clean control, and a replay you can explain are enough to start. If the zero price doesn't fail its test, the suite isn't ready for the dashboard.
Checking AI Output and Bot-Contaminated Pages
An extraction model can return tidy JSON that still invents a price, carries a stale one, duplicates an entity, or drops a whole category. Field-level checks pass all four. The output is well formed. It isn't fit for the decision.
Recent methodological work describes validation of LLM-generated tabular data as unstructured, mapping 19 approaches across analysis granularities and data sources, in Microsoft's review of synthetic data across the AI pipeline. There is no single standard method. Synthetic-data teams also struggle to control auxiliary-model outputs, to represent smaller groups accurately, and to scale checks that depend mainly on human review.

Four checks that schema won't do
- Benchmark comparison: match generated records to a set of pages a person already verified. Disagreement is a defect even when the JSON parses.
- Subgroup coverage: confirm every category in the catalogue appears. A missing category is a systematic omission, not a null in one row.
- Source re-fetch: pull a sample of the original pages again and compare the semantic values, not just the keys.
- Confidence routing: send low-confidence fields to a person. Don't auto-accept them because the type was right.
Block pages and injected challenges can return a success status and a structure that looks valid. Check the page template signature, compare repeated fetches over time, and keep the timestamp plus the source context on every record. A challenge page that parses as a product is contamination, not a thin catalogue.
A higher pass rate isn't proof of quality. Overly permissive checks can certify plausible but biased data.
We don't warrant the accuracy, completeness, legality, quality, or fitness of data scraped or obtained through the service. Validation stays the buyer's job, and a green schema check doesn't transfer that job to the tool that fetched the page.
Choosing Validation Methods Before Your Next Crawl
A price-monitoring crawl and a research dataset need different checks. Choose them by asking what decision the records will support, then test whether each record is fit for that decision. A parser can succeed while returning zero prices, stale pages, or fabricated AI output. A 100% pass rate can conceal all three.
| Use Case | Must-Have Checks | Add When Stakes Rise | Fail Mode |
|---|---|---|---|
| Price monitoring | Type, range, and completeness of price and currency | Compare prices across sources in a sample | Hard fail on missing price; quarantine on drift |
| SERP tracking | Schema, crawl-timestamp freshness, and unique query and position | Repeat fetches to detect cached or blocked pages | Hard fail on blocked page; annotate stale ranks |
| Inventory and availability | Freshness under one hour and complete stock status | Re-fetch a sample of product pages | Hard fail on stale snapshot |
| Research and journalism datasets | Schema, uniqueness, and referential integrity | Re-fetch sources and review a human sample | Quarantine until reviewed |
| AI training or LLM-ready data | Schema, duplicate detection, and subgroup coverage | Compare with a benchmark and review low-confidence fields | Route to review; never auto-pass |
For high-impact decisions, an independent recheck and human review of a sample can catch problems that broad automated coverage misses. The checks for AI output and bot-contaminated pages described above help identify fabricated records and pages that only appear to contain the expected content. For a wider view of the workflow, see how to automate data extraction in scalable pipelines.
A first week you can actually run
- Confirm the data is publicly available and your use is permitted. Scrappey supports scraping publicly available data only. You remain responsible for following applicable laws and each site's terms.
- Define the required fields and keys, including the natural key used to check uniqueness.
- Set structural and freshness expectations based on the decision each dataset supports, rather than a generic service-level target.
- Test the rules on a sample of about 100 pages and inspect every failure by hand. Use this pass to learn how the site behaves, not to chase a high pass rate.
- Set hard-fail and soft-fail thresholds for each check, based on the consequences of its failure mode.
- Schedule the checks and record the audit details so each crawl stores its rule version, batch ID, and examples of failed rows.
When a system returns JSON in a structure you define, apply the same structural checks to its output. If the records will train a model or support a published claim, add benchmark comparison and send uncertain fields for human review.
You can start with one dataset, five known-bad rows, and the checks its use case requires. A pass rate you can explain is more useful than a perfect rate that hides unsuitable data.
Scrappey provides AI-powered extraction with GPT-4 and can return JSON in the fields you describe. That output still needs structural, freshness, and cross-source checks before a price, rank, or training set leaves your pipeline. Scrappey is designed for accessing publicly available web data and powering automation workflows. Visit Scrappey to run a sample crawl and test your first validation rules on a batch you control.



