Extract SERP features through the documented contract of the selected provider. Organic results, ads and rich features are different collections, and some will be absent in a valid response. Do not invent an ads field for a provider because another provider documents one.
Maintain a provider-specific field inventory
| Provider/feature | Contract boundary |
|---|---|
| SearchCans organic results | data.organic with link and observed position |
| SerpApi Google organic results | organic_results in the native response |
| SerpApi ads | Use its current Google ads documentation and returned field shape |
| Optional rich feature | Validate only the documented field actually observed |
| Missing feature | Record absence; do not fill a fabricated list |
Keep ads positions separate from organic positions
An ad observation is not an organic ranking. Preserve its feature type and source record before passing it downstream. Check optional list/object shapes explicitly, because an absent feature and a malformed feature are different cases.
SearchCans’ reviewed SERP documentation does not establish an ads output field. This article therefore does not show a fabricated SearchCans ads parameter or parser. If ads are required, choose a provider contract that documents them and test that contract.
Test feature absence before adding a dashboard
A successful fixture is not evidence that ads will appear for every query or future request. Avoid undocumented scraping-success percentages and claims that a fixed delay guarantees access or compliance.
- Create an organic-only fixture and require a valid no-ads outcome.
- Create a documented feature fixture and retain its native type and values.
- Create a changed or malformed shape and require a validation failure.
- Store the market, time and provider beside the feature.
Reference documentation: serpapi.com — /search-api; serpapi.com — /google-ads; www.searchcans.com — /google-search-api.