# Schema.org / Structured Data Extractor (`luck777/schema-extractor`) Actor

Extracts JSON-LD, Microdata, and RDFa structured data from any list of URLs. Ideal for SEO audits and structured data validation.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## Schema Extractor

Extract all structured data from any list of web pages — JSON-LD, Microdata, and RDFa — in a single lightweight crawl. No browser required.

### What it does

The actor fetches each URL you provide using an HTTP crawler (CheerioCrawler) and parses three structured data formats:

| Format | How it works |
|--------|--------------|
| **JSON-LD** | Parses every `<script type="application/ld+json">` block; validates that each entry has at least `@type` or `@context` |
| **Microdata** | Finds all `[itemscope]` elements; extracts `itemtype` and all `[itemprop]` name/value pairs |
| **RDFa** | Finds all `[typeof]` elements; extracts `vocab` and all `[property]` name/value pairs |

Each URL produces one output record. Schema types are normalised (URL prefixes like `https://schema.org/` are stripped) and deduplicated across all three sources.

### Who should use this

- **SEO professionals** auditing structured data coverage across a site
- **Dev teams** validating JSON-LD before submitting to Google's Rich Results Test
- **Data teams** doing competitive intelligence on how competitors mark up Products, Reviews, FAQs, etc.
- **Content teams** verifying that CMS templates emit correct schema on every page type

### Input

```json
{
  "urls": [
    "https://example.com/product/widget",
    "https://competitor.com/faq"
  ],
  "maxPagesPerDomain": 10,
  "requestTimeoutSecs": 30,
  "maxConcurrency": 5
}
```

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `urls` | `string[]` | Yes | — | Pages to scan |
| `maxPagesPerDomain` | `integer` | No | `10` | Cap on pages per domain to prevent runaway runs |
| `requestTimeoutSecs` | `integer` | No | `30` | Per-request timeout in seconds |
| `maxConcurrency` | `integer` | No | `5` | Parallel requests |

### Output

One dataset record per URL:

```json
{
  "url": "https://example.com/product/widget",
  "jsonLd": [
    {
      "@context": "https://schema.org",
      "@type": "Product",
      "name": "Widget Pro",
      "offers": { "@type": "Offer", "price": "29.99" }
    }
  ],
  "microdata": [],
  "rdfa": [],
  "schemaTypes": ["Offer", "Product"],
  "totalSchemas": 1,
  "hasJsonLd": true,
  "hasMicrodata": false,
  "hasRdfa": false,
  "scannedAt": "2026-11-18T10:00:00.000Z"
}
```

If a page fails to load, the record will contain an `error` field with the reason and all schema arrays will be empty — so your downstream pipeline never has missing rows.

### Schema types recognised

The actor surfaces all types it finds, including but not limited to:

`Article` · `BreadcrumbList` · `Event` · `FAQPage` · `HowTo` · `ImageObject` · `JobPosting` · `LocalBusiness` · `NewsArticle` · `Organization` · `Person` · `Product` · `ProductGroup` · `Recipe` · `Review` · `SearchAction` · `VideoObject` · `WebPage` · `WebSite`

### Limitations

- JavaScript-rendered structured data is **not** supported. The actor uses an HTTP crawler, not a headless browser. If a site injects JSON-LD via client-side JS, use the [Puppeteer Scraper](https://apify.com/apify/puppeteer-scraper) instead.
- RDFa extraction is simplified: it handles the most common patterns (`typeof` + `property`) but does not implement the full RDFa 1.1 processing algorithm.
- Microdata nested scopes are flattened: each `[itemscope]` element is emitted as a top-level record regardless of nesting depth.

### Running locally

```bash
npm install
npm run start:dev
```

Place your input in `storage/key_value_stores/default/INPUT.json`:

```json
{
  "urls": ["https://schema.org/Product"]
}
```

Results appear in `storage/datasets/default/`.

### Pricing

This actor uses **Pay-Per-Event** pricing. You are charged one `url-extracted` event for each URL that is successfully crawled and pushed to the dataset. Failed URLs are not charged.

# Actor input Schema

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

List of page URLs to extract structured data from. Each URL is fetched once.

## `maxPagesPerDomain` (type: `integer`):

Maximum number of pages to process from the same domain. Prevents runaway crawls when many URLs share a domain.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for each page response before aborting.

## `maxConcurrency` (type: `integer`):

Maximum number of parallel requests.

## Actor input object example

```json
{
  "urls": [
    "https://schema.org/",
    "https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data"
  ],
  "maxPagesPerDomain": 10,
  "requestTimeoutSecs": 30,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

All structured data found on each page including JSON-LD, Microdata, and RDFa.

# 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://schema.org/",
        "https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("luck777/schema-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://schema.org/",
        "https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("luck777/schema-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://schema.org/",
    "https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data"
  ]
}' |
apify call luck777/schema-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,luck777/schema-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/Rpe0soHyhRiSfcXMG/builds/PlW2Y3xA5jgaybPrI/openapi.json
