# JSON-LD Extractor – Schema.org Data & Rich Snippets (`ninhothedev/json-ld-extractor`) Actor

Extract Schema.org JSON-LD and microdata from any URLs: Product, Article, Recipe, Event, Organization & more, one row per entity with full data. For SEO audits, e-commerce & RAG.

- **URL**: https://apify.com/ninhothedev/json-ld-extractor.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 9 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

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 Extractor – Schema.org Structured Data & Rich Snippets Scraper

**JSON-LD Extractor** pulls the **Schema.org structured data** that websites publish in `<script type="application/ld+json">` blocks – **Product, Offer, Article, NewsArticle, Recipe, Event, Organization, LocalBusiness, FAQPage, BreadcrumbList, WebSite** and every other type – from any list of URLs. Each entity becomes one clean row with its **`@type`**, **name** and the **full original JSON-LD object**; `@graph` containers and arrays are flattened automatically, and legacy **HTML microdata** (`itemscope` / `itemprop`) can be extracted too. Export structured data to JSON, CSV, Excel or Google Sheets – no API key, no browser, pay only per extracted entity.

Built for SEO specialists auditing rich-snippet markup, agencies comparing competitors' schema, e-commerce teams collecting product and price data from structured markup, and developers feeding clean, typed page data into RAG pipelines, knowledge graphs or databases.

### What data can you extract?

| Field | Example | Description |
|---|---|---|
| `url` | `https://www.bbc.com/news` | Page the entity was found on (normalized input URL) |
| `schema_type` | `WebPage` | Schema.org `@type` as published (string, or array for multi-typed entities) |
| `name` | `BBC News - Breaking news, video and …` | First of `name`, `headline` or `title` (`null` if none) |
| `data` | `{"@type": "WebPage", "publisher": {…}}` | Complete original JSON-LD / microdata object with all nested properties |
| `source` | `json-ld` | `json-ld` or `microdata` |
| `entity_id` | `c7dd25dc4371…` | Stable SHA-256 ID of page URL + source + entity content (for dedupe and change tracking) |
| `scraped_at` | `2026-10-15T18:04:56+00:00` | UTC timestamp of extraction |

Whatever the site publishes inside `data` is kept as-is – e.g. `offers.price`, `aggregateRating`, `author`, `datePublished`, `recipeIngredient`, `address`, `geo` or `sameAs` social profiles.

### How to use the JSON-LD Extractor

1. Open the actor and paste page URLs into **Page URLs** – full URLs or bare domains (`example.com`, HTTPS is assumed). Duplicates are removed.
2. Set **Max entities** (default 5 – raise it to e.g. 500 for real jobs) and enable **Include microdata** if the site uses `itemscope` / `itemprop` markup. Click **Start**.
3. Download the entities as JSON (best for nested `data`), CSV or Excel, or send them to Google Sheets, Make, Zapier or n8n.

Example input:

```json
{
  "urls": ["https://www.python.org/", "https://www.bbc.com/news"],
  "maxItems": 100,
  "includeMicrodata": false
}
```

If a page has no JSON-LD at all, microdata is used as an automatic fallback even when **Include microdata** is off.

### Output example

Real output from local test runs (default input `https://www.python.org/`, plus `https://www.bbc.com/news`; `entity_id` shortened):

```json
[
  {
    "url": "https://www.python.org/",
    "schema_type": "WebSite",
    "name": null,
    "data": {
      "@context": "https://schema.org",
      "@type": "WebSite",
      "url": "https://www.python.org/",
      "potentialAction": {
        "@type": "SearchAction",
        "target": "https://www.python.org/search/?q={search_term_string}",
        "query-input": "required name=search_term_string"
      }
    },
    "source": "json-ld",
    "scraped_at": "2026-10-15T18:04:47.144982+00:00",
    "entity_id": "f69d62ecbeaef5af..."
  },
  {
    "url": "https://www.bbc.com/news",
    "schema_type": "WebPage",
    "name": "BBC News - Breaking news, video and the latest top stories from the U.S. and around the world",
    "data": {
      "@context": "https://schema.org",
      "@type": "WebPage",
      "url": "https://www.bbc.com/news",
      "publisher": {
        "@type": "NewsMediaOrganization",
        "name": "BBC News",
        "sameAs": ["https://www.facebook.com/BBCGlobalFB/", "https://twitter.com/bbc"]
      }
    },
    "source": "json-ld",
    "scraped_at": "2026-10-15T18:04:56.464269+00:00",
    "entity_id": "c7dd25dc4371cb53..."
  }
]
```

Every run also stores a `RUN_SUMMARY` record in the key-value store with per-URL coverage (`complete`, `empty`, `limited`, `fetch_error`, `parse_error`) and the number of entities found on each page.

### Pricing

This actor uses **pay-per-event** pricing – you pay per extracted entity (dataset row), not per page:

- **$0.50 per 1,000 entities** ($0.0005 per result)
- **$0.00005 per actor start** (per GB of memory)

Examples:

| Scenario | Cost |
|---|---:|
| Default test run (up to 5 entities) | ≈ $0.003 |
| 100 product pages × ~3 entities each | ≈ $0.15 |
| 1,000 entities from a site audit | ≈ $0.50 |
| 1,000 pages × ~1 entity, re-checked monthly | ≈ $0.50 / month |

Use **Max entities** to cap spending precisely. No proxies or third-party APIs are used, so there are no hidden costs.

### Use cases

- **SEO schema audits** – inventory which Schema.org types every page publishes and spot pages missing Product, Article, FAQPage or BreadcrumbList markup.
- **Competitor structured data analysis** – compare how competitors mark up products, reviews and FAQs to win rich snippets.
- **E-commerce data collection** – read product names, prices, availability and ratings straight from `Product` / `Offer` JSON-LD.
- **Local business and company data** – extract `Organization` and `LocalBusiness` addresses, phone numbers, logos and social profiles.
- **RAG and AI pipelines** – feed clean, typed entities instead of noisy HTML into LLMs, vector stores or knowledge graphs.
- **Markup change monitoring** – schedule runs and compare `entity_id` values to detect when structured data changes.

### Integrations and API

Run the structured data extractor from the Apify API, CLI or any integration: **Make**, **Zapier**, **n8n**, **Google Sheets**, **Slack**, **Airbyte** or **webhooks**.

Python example with the official `apify-client`:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("ninhothedev/json-ld-extractor").call(
    run_input={"urls": ["https://www.python.org/", "https://www.bbc.com/news"], "maxItems": 100}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["url"], item["schema_type"], item["name"])
```

### FAQ

**Is it legal to extract JSON-LD?**
JSON-LD is public markup that websites publish specifically so search engines and other machines can read it. The actor only reads publicly accessible HTML pages. Respect each site's terms and applicable data-protection rules when you reuse the data.

**Does it validate my schema for Google rich results?**
No. It extracts the structured data exactly as published so you can audit it; it does not run Google's Rich Results Test or Schema.org validation.

**What are the limits?**
Up to 1,000 URLs and 1,000 entities per run. Pages are fetched sequentially with a 20-second timeout, up to 3 redirects and a 2 MB size limit. Only public HTML pages on standard ports are supported.

**Does it render JavaScript?**
No. It reads the server-delivered HTML, which is where almost all sites put their JSON-LD. Markup injected only by client-side JavaScript is not seen.

**What if a site blocks the request or a page fails?**
No proxies are used. If any page cannot be fetched or contains malformed JSON-LD, all entities from the other pages are still saved, but the run is marked as failed so you notice – check `RUN_SUMMARY` for the affected URLs.

**Can I schedule it?**
Yes – create an Apify Schedule and connect the dataset to Google Sheets or a webhook to monitor structured data over time.

**Something does not work?**
Open an issue on the actor's **Issues** tab with the run ID and an example URL – we usually respond within a day.

### Related actors

- [Website Link Extractor](https://apify.com/ninhothedev/website-link-extractor) – collect all page URLs of a site, then extract their JSON-LD here.
- [Website Contact & Email Extractor](https://apify.com/ninhothedev/website-contact-extractor) – find emails, phones and social profiles on websites.
- [Shopify Store Scraper](https://apify.com/ninhothedev/shopify-store-scraper) – products, prices and variants from any Shopify store.
- [Redirect Chain Tracer](https://apify.com/ninhothedev/redirect-chain-tracer) – every redirect hop with status codes up to the final URL.
- [HTTP Security Headers Checker](https://apify.com/ninhothedev/security-headers-checker) – grade HSTS, CSP and other security headers A–F.
- [Website Uptime & Status Checker](https://apify.com/ninhothedev/website-uptime-monitor) – bulk HTTP status, response time and SSL validity check.

# Actor input Schema

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

Pages to extract Schema.org structured data from, one per line (1–1,000). Full URLs or bare domains (https:// is added). Duplicates and #fragments are removed. Server-delivered HTML only – JavaScript is not rendered.

## `maxItems` (type: `integer`):

Maximum number of structured-data entities (rows) to output across all URLs – you pay per entity. The default 5 is for a quick test; raise it (up to 1,000) for real jobs.

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

Also extract legacy HTML microdata (itemscope / itemprop) in addition to JSON-LD. When off, microdata is still used automatically for pages that publish no JSON-LD.

## `mode` (type: `string`):

Keep 'Extract structured data' – fetches each URL and returns one row per top-level Schema.org entity (arrays and @graph are flattened).

## Actor input object example

```json
{
  "urls": [
    "https://www.python.org/"
  ],
  "maxItems": 5,
  "includeMicrodata": false,
  "mode": "extract"
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (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("ninhothedev/json-ld-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("ninhothedev/json-ld-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 ninhothedev/json-ld-extractor --silent --output-dataset

```

## MCP server setup

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