# JSON-LD Schema Validator: schema.org Errors & Warnings (`dataforgehq/json-ld-schema-validator`) Actor

Extract and validate JSON-LD (and optional microdata) against common schema.org / rich-result fields. Reports missing @type, required properties, errors and warnings. $0.50 per 1,000 pages; failed pages free.

- **URL**: https://apify.com/dataforgehq/json-ld-schema-validator.md
- **Developed by:** [Andrew Shamah](https://apify.com/dataforgehq) (community)
- **Categories:** SEO tools, Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## JSON-LD Schema Validator – schema.org errors & warnings

Fetch any list of pages, extract **JSON-LD** (`script[type=application/ld+json]`, including `@graph`) and optional **HTML microdata**, then check `@type` and the properties that schema.org / Google rich results commonly require.

This is a **validator**, not just an extractor. Our [Website Metadata Extractor](https://apify.com/dataforgehq/website-metadata-extractor) returns raw JSON-LD; this Actor tells you what is missing or malformed.

It is **not** Google's official Rich Results Test. It checks well-known required and recommended fields locally, with no Google API key.

### Types with required / recommended checks

Organization, LocalBusiness, WebSite, WebPage, Article / NewsArticle / BlogPosting, Product, Offer, BreadcrumbList, FAQPage, Question, HowTo, Person, Event, Recipe, VideoObject, ImageObject, Review, AggregateRating, JobPosting, SearchAction, ItemList, PostalAddress, SoftwareApplication, Book, Movie.

### Features

- Multiple JSON-LD blocks and nested `@graph` nodes
- Tolerant JSON parse (strips `/* */` comments and trailing commas used by some CMSs)
- Optional microdata (`itemscope` / `itemtype`)
- Missing `@type`, missing required fields (**errors**)
- Missing recommended rich-result fields, bad dates, non-URL `url`/`image` (**warnings**)
- `valid` flag plus per-node error/warning lists

### Input

```json
{
  "urls": ["https://www.apple.com/", "https://example.com"],
  "includeMicrodata": true
}
```

### Output (one item per page)

```json
{
  "url": "https://www.apple.com/",
  "hasStructuredData": true,
  "valid": false,
  "types": ["Organization", "WebSite"],
  "errorCount": 1,
  "warningCount": 2,
  "nodes": [
    { "source": "json-ld", "types": ["Organization"], "errors": [], "warnings": ["Organization missing recommended property \"url\""] }
  ],
  "issues": ["1 validation error(s)", "2 warning(s)"]
}
```

Pages with **no structured data** are still a useful result (`hasStructuredData: false`) and are charged.

### Pricing

**$0.0005 per page validated** ($0.50 per 1,000 pages) + a tiny start fee. Unreachable or non-HTML pages are **free**.

### Related Actors

- [Open Graph & Metadata Extractor](https://apify.com/dataforgehq/website-metadata-extractor)
- [Hreflang Reciprocity Checker](https://apify.com/dataforgehq/hreflang-checker)
- [SEO Audit Crawler](https://apify.com/dataforgehq/seo-audit-crawler)

# Actor input Schema

## `urls` (type: `array`):

Pages whose JSON-LD / schema.org markup should be extracted and validated.

## `includeMicrodata` (type: `boolean`):

Parse top-level itemscope/itemtype blocks in addition to JSON-LD.

## `includeRaw` (type: `boolean`):

Attach the parsed JSON-LD / microdata objects (can be large).

## `timeoutSecs` (type: `integer`):

Seconds to wait for each page.

## `concurrency` (type: `integer`):

Pages fetched at once.

## `maxUrls` (type: `integer`):

Validate at most this many URLs (0 = all).

## Actor input object example

```json
{
  "urls": [
    "https://www.apple.com/",
    "https://example.com"
  ],
  "includeMicrodata": true,
  "includeRaw": false,
  "timeoutSecs": 20,
  "concurrency": 6,
  "maxUrls": 0
}
```

# Actor output Schema

## `overview` (type: `string`):

All pages (overview table).

## `summary` (type: `string`):

Counts.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://www.apple.com/",
        "https://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dataforgehq/json-ld-schema-validator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": [
        "https://www.apple.com/",
        "https://example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("dataforgehq/json-ld-schema-validator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.apple.com/",
    "https://example.com"
  ]
}' |
apify call dataforgehq/json-ld-schema-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dataforgehq/json-ld-schema-validator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/SuOPusmzeYgG5IIRs/builds/MbXXsqr4sXoJ67iWe/openapi.json
