Enforce Minimum Schema Count

Require a minimum number of JSON-LD schema blocks per page.

The Problem

Rich pages often need multiple schema types: Product + BreadcrumbList + Organization. If your template only outputs one, you’re leaving rich-result features on the table. This assertion ensures every page meets a minimum schema count, catching template regressions where schema blocks are accidentally removed.

The Hard Way

Count the <script type="application/ld+json"> blocks in each page’s HTML. At scale, this requires a crawler + parser pipeline.

The SEODiff Way

One API call. Results in under 2 seconds.

POST https://seodiff.io/api/v1/agent/evaluate

{"urls": ["https://example.com/product/widget-a"], "assertions": [{"rule": "min_schema_count", "value": 2}]}
ParameterTypeExample
valueinteger2

Code Examples

Copy-paste examples in your preferred language:

cURL

See the full evaluation example in cURL →

Python

See the full evaluation example in Python →

Node.js

See the full evaluation example in Node.js →

Go

See the full evaluation example in Go →

PHP

See the full evaluation example in PHP →

Related Assertions

has_schema

Ensure every page has valid JSON-LD schema markup for rich results.

selector_exists

Verify critical DOM elements are present on every page.

Use in CI/CD

Add this assertion to your deployment pipeline. Works with any CI platform:

🐙 GitHub Actions

Block bad deployments with automated SEO checks in your GitHub Actions CI/CD pipeline.

🦊 GitLab CI

Add automated SEO quality gates to your GitLab CI/CD pipelines.

▲ Vercel

Automatically validate SEO on every Vercel preview deployment before promoting to production.

Start testing in 30 seconds

Get an API key and run your first evaluation with a single cURL command.

Get API Key or Read full API docs