How to Validate a Web Scraping API Response
Design a small acceptance test for a web scraping API. Compare response success, field coverage, duplicate records, and evidence against authorized pages.

Define a correct response before sending a request
A web scraping API can return a successfully processed request without returning the records your project needs. Decide in advance which pages you are authorized to use, what a record represents, which fields are required and how you will recognize an unavailable source. The acceptance test should check the response and the delivered data separately.
Start with three authorized fixtures
Use one page with a complete record, one with a deliberately absent optional field, and one that represents an unavailable input in your own test environment. Use stable copies so repeated runs can be compared. Give the reviewer expected data, not just the address of each fixture.
| Fixture | Expected outcome | Fail the test if |
|---|---|---|
| Complete product fixture | One record with stable ID, name and source reference | It returns a header, menu item or unrelated row as the record |
| Absent optional field | One record and the agreed empty state | The response invents the value or removes a required field |
| Unavailable fixture | A distinguishable error or documented no-record state | The response is counted as a complete record |
Test different layers independently
First record the request and application status without including secrets in the evidence. Then inspect the documented response envelope: where do you find the result, an error, or a job reference if the API is asynchronous? Read a small parsed result and confirm it matches the expected fields and types.
Finally return to the source fixture. A syntactically valid JSON response may still have the wrong extraction. Check source references, required field coverage and repeatability before handing on the records.
Check whether the JSON result has the root type and record fields specified in the acceptance sheet.
Work through one success count
Suppose three fixtures receive completed responses. Two return records with the expected source and fields; the third returns readable JSON for an unavailable input but no usable record. Report “3 completed responses; 2 usable records; 1 recognized unavailable input.” Don't report three usable extracts just because three requests completed. For repeated IDs, distinguish expected references from duplicate records.
Decide which workflow to use for the next run
Use an API when the project calls for documented application integration and automation over authorized inputs. Use a console when you need to inspect a small approved task and review output before defining a repeatable contract. In both cases, keep the expected fields, test set and final acceptance criteria the same so the comparison is meaningful.
Explore Crawler Console for a product overview.
Questions about response validation
Does an HTTP success status prove extraction quality? No. Check the documented result, record counts and field evidence separately.
Can I replay every failed request? Follow the service's documented retry policy, usage limits and the source's authorization requirements. Don't repeatedly send a denied or malformed input.
Bring the acceptance sheet to the workflow
Prepare a three-row fixture sheet and run one approved trial. Review the outputs against the expected evidence and decide which record or interface issue needs fixing before scaling up the workflow.

