# Structured Data Validator (JSON-LD, schema.org) (`nitsuahlabs/structured-data-validator`) Actor

Crawl a site, parse every JSON-LD block and list missing required and recommended schema.org properties per page.

- **URL**: https://apify.com/nitsuahlabs/structured-data-validator.md
- **Developed by:** [Austin Hardy](https://apify.com/nitsuahlabs) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 page validateds

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

## Structured Data Validator (JSON-LD, schema.org)

Crawl a site and get one row per page showing which schema.org types it declares and which properties are missing. Use it before a launch, after a template change, or monthly to catch broken markup that quietly removes rich results from search.

### What it checks

- Every `script type="application/ld+json"` block is parsed. Invalid JSON is reported.
- Entities are found at the top level, inside `@graph`, and nested (offers, questions, list items).
- Required and recommended properties are checked for: Product and Offer, Article (also NewsArticle, BlogPosting), LocalBusiness (and common subtypes such as Restaurant), Organization, FAQPage and Question, BreadcrumbList and ListItem, Event, Recipe, WebSite, Person, JobPosting.
- Pages with no JSON-LD are flagged, and the number of microdata items is reported.
- Pages that return an HTTP error or cannot be fetched are flagged.

### Scoring

Each issue takes points off 100: required missing 12, recommended missing 2, no JSON-LD 8. A page with no structured data at all is not an error for every site, so treat the score as a review aid.

### Output

One row per page: url, status, score, types found, number of JSON-LD blocks, microdata items and an issues list (type, rule, property, severity, detail).

### Limits

The property lists are a practical subset of Google's guidance, not the full schema.org vocabulary and not a replacement for Google's Rich Results Test. Markup added by JavaScript after page load is not seen because pages are fetched as plain HTML. Pages behind a login are not supported.

Pricing is per validated page (pay per event).

# Actor input Schema

## `startUrls` (type: `array`):

Pages to start from (up to 20). The Actor follows links on the same site.

## `maxPages` (type: `integer`):

Upper limit of pages checked (1 to 500).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://example.com/"
    }
  ],
  "maxPages": 30
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "startUrls": [
        {
            "url": "https://example.com/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nitsuahlabs/structured-data-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 = { "startUrls": [{ "url": "https://example.com/" }] }

# Run the Actor and wait for it to finish
run = client.actor("nitsuahlabs/structured-data-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 '{
  "startUrls": [
    {
      "url": "https://example.com/"
    }
  ]
}' |
apify call nitsuahlabs/structured-data-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nitsuahlabs/structured-data-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/fuc4sZSbaU7SGDbUe/builds/DJ4jQv9sbaLQLMkBI/openapi.json
