# JSON-LD Schema Extractor — Types & Broken Blocks (`kadro/jsonld-extractor`) Actor

Extract JSON-LD (schema.org) from the pages you give: block count, types found, invalid blocks and optional raw data. Respects robots.txt.

- **URL**: https://apify.com/kadro/jsonld-extractor.md
- **Developed by:** [Kadro Tools](https://apify.com/kadro) (community)
- **Categories:** SEO tools, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 page json-ld extracteds

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 Extractor

See which schema.org types each page declares and catch broken JSON-LD (a trailing comma is enough for Google to ignore it).

### What you get

| Field | What it tells you |
|---|---|
| `page, finalUrl` | Page you gave and its final address after redirects |
| `statusCode, error` | HTTP status and any request error |
| `blocks` | JSON-LD scripts found |
| `validBlocks` | Blocks that parse as valid JSON |
| `types` | Every `@type` found, including nested ones |
| `issues` | List of problems, or `ok` when nothing is wrong |
| `jsonld` | Parsed JSON-LD as text (only with `includeRaw`) |

### How to use it in 3 steps

1. Paste page URLs, one per line (up to 500).
2. Turn on `includeRaw` if you also want the parsed JSON-LD of each page.
3. Press Start and look at `types` and `issues`.

### Pricing

**$2 per 1,000 pages checked.** Example: 300 pages = $0.60. Pages with errors or blocked by robots.txt are free; pages without JSON-LD are charged because they were checked. Set a maximum cost per run and the robot stops when it is reached.

### Integrations

- **Apify API and webhooks**: start a run and read the dataset from any language.
- **Make, n8n and Zapier**: use the Apify module or node, run this robot and pass the dataset on.
- **Google Sheets**: export the dataset or use the Apify integration to fill a sheet on a schedule.
- **Claude, Cursor and other agents (MCP)**: Use the Apify MCP server (`https://mcp.apify.com?actors=kadro/jsonld-extractor`) from Claude or Cursor and ask: "Which schema.org types do the product pages of example.com declare? Flag broken JSON-LD"

### FAQ

**Does it validate Google rich-result rules?**
No. It checks that the JSON is valid and lists the declared types; it does not check required properties for rich results.

**Does it read Microdata or RDFa?**
No, only `<script type="application/ld+json">`.

**Does it respect robots.txt?**
Yes. Blocked pages return "Blocked by robots.txt" and are not charged.

**Can an AI agent use the output?**
Yes. `types` is a compact summary of each page, and `includeRaw` adds the full data.

**Is it legal?**
It reads only public pages you list, one request each.

### Limitations

- JSON-LD only: Microdata and RDFa are ignored.
- No validation against Google's rich-result requirements.
- Up to 500 URLs per run.
- Only public URLs: private and local addresses are blocked.

### Other Kadro tools

Part of the **Kadro SEO toolkit**: find the structured data here, audit the rest of the page with the tools below.

- [SEO On-Page Audit Crawler](https://apify.com/kadro/seo-onpage-audit): crawls a whole site and gives every page a 0-100 SEO score.
- [Hreflang & Canonical Checker](https://apify.com/kadro/hreflang-canonical-checker): finds canonical and hreflang errors on multilingual sites.
- [Website Links Extractor](https://apify.com/kadro/url-links-extractor): lists every internal and external link of a page with anchor and nofollow.
- [Sitemap URL Extractor](https://apify.com/kadro/sitemap-url-extractor): exports every URL from a sitemap or sitemap index.
- [Robots.txt Validator](https://apify.com/kadro/robots-txt-validator): validates robots.txt rules, sitemaps and blocked bots.

Found it useful? Please leave a review ⭐ — it helps a lot. Bugs or feature ideas: open an issue, I answer within 24 h.

# Actor input Schema

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

Pages to check, one per line, up to 500 (public URLs only).

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

Add the parsed JSON-LD data of each page as text in the `jsonld` column. Off by default to keep rows small.

## `followRedirects` (type: `boolean`):

Read the final page after redirects (on by default).

## Actor input object example

```json
{
  "urls": [
    "https://www.python.org/"
  ],
  "includeRaw": false,
  "followRedirects": true
}
```

# 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 = {
    "urls": [
        "https://www.python.org/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kadro/jsonld-extractor").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.python.org/"] }

# Run the Actor and wait for it to finish
run = client.actor("kadro/jsonld-extractor").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.python.org/"
  ]
}' |
apify call kadro/jsonld-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kadro/jsonld-extractor"
        }
    }
}
```

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/56nCIKjzpkuti58gf/builds/CbtR8h4nRIyt1XNwu/openapi.json
