# Structured Data to JSON — JSON-LD & Schema.org (`dropin-apis/structured-data-to-json`) Actor

Extract Product, Article, Event, Organization, LocalBusiness or documentation pages into fixed validated JSON. Every value includes source evidence; missing fields stay null. Public HTML only, robots.txt respected.

- **URL**: https://apify.com/dropin-apis/structured-data-to-json.md
- **Developed by:** [drop-in apis](https://apify.com/dropin-apis) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.00 / 1,000 validated 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

## Structured Data to JSON — JSON-LD & Schema.org extractor

Turn public product, article, event, organization, local-business or documentation pages into **validated JSON with evidence for every field**. Unlike a raw JSON-LD dump or a prompt-based scraper, this Actor publishes six fixed contracts, keeps unsupported values `null`, and explains where every returned value came from.

It is built for AI agents, RAG pipelines, monitoring jobs and data workflows that need predictable output without invented values.

**At a glance:** **$0.009 per successfully validated page** (nothing is charged for invalid, blocked, login or empty pages) · 1–20 public HTML URLs of one type per run · six fixed schemas, evidence for every field, no LLM. Try it: click **Start** with the prefilled example page and the `product` schema.

### What it extracts

| `schemaType` | Fixed fields |
|---|---|
| `product` | `name`, `price`, `currency`, `availability` |
| `article` | `headline`, `datePublished`, `description`, `section` |
| `event` | `name`, `startDate`, `endDate`, `location` |
| `organization` | `name`, `description`, `organizationType`, `location` |
| `localBusiness` | `name`, `category`, `city`, `openingHours` |
| `documentation` | `title`, `description`, `product`, `language` |

The deterministic pipeline checks JSON-LD first, then microdata, OpenGraph/meta tags, semantic HTML and restrained page-text rules. It does not call an LLM.

### Input

```json
{
  "urls": [
    "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
  ],
  "schemaType": "product"
}
```

Send 1–20 public HTML URLs of the same type per run.

### Output

```json
{
  "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
  "finalUrl": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
  "schemaType": "product",
  "data": {
    "name": "A Light in the Attic",
    "price": "£51.77",
    "currency": "GBP",
    "availability": "In stock"
  },
  "evidence": {
    "name": {
      "method": "html",
      "pointer": "article h1, main h1, h1",
      "snippet": "A Light in the Attic"
    }
  },
  "absentFields": [],
  "source": {
    "contentType": "text/html; charset=utf-8",
    "bytes": 6812,
    "sha256": "..."
  }
}
```

The real item includes one evidence record for **every** field. A missing field is returned as `null` with:

```json
{ "method": "absent", "pointer": null, "snippet": null }
```

Evidence proves which publisher text or metadata produced the value; it does not independently prove the publisher's claim is true.

If a copied value or evidence snippet contains an email address, a phone-like number or an obvious social/profile URL, that contact is replaced with `[redacted contact]`. Its evidence record includes `"redactedContact": true`. Version 1 has no contact fields, so this rule applies to both personal and business contacts wherever they occur inside otherwise supported text.

### Pricing

**$0.009 per successfully validated page.** A page is charged only when a dataset item with a grounded identity field and schema-valid output is written. Invalid URLs, private destinations, robots denials, login/challenge pages, HTTP failures and empty results produce no paid dataset item. Apify also adds its small platform Actor-start event.

That is 70% below Apify's general AI Web Scraper price of $0.03/page on the FREE tier. This Actor is narrower: it does not accept arbitrary prompts or arbitrary schemas.

### Safety and limits

- Respects `robots.txt`; policy fetch errors fail closed.
- Resolves DNS before connecting, refuses private/reserved addresses, pins the approved addresses for the connection, and rechecks every redirect.
- Accepts only public HTML/XHTML, up to 2 MiB after decompression.
- Uses no cookies, login, form submission, CAPTCHA solving, Cloudflare bypass or browser fingerprinting.
- Parses the returned HTML and rejects password controls regardless of tag/attribute case, quoting or form action; it also rejects login-form and common challenge markers. These pages produce no paid dataset item.
- Defines no email, phone or profile fields. Contact fragments found inside any copied field or evidence snippet are replaced with `[redacted contact]` and marked with `redactedContact: true`; this includes business contacts because none of the six version-1 schemas permits contact data.
- Does not render JavaScript. If facts exist only after client-side rendering, they remain `null` or the page can fail its identity check.
- A single run accepts one schema type. Split mixed page types into separate runs.

### For AI agents

Through Apify's MCP server, an agent can find and call this Actor, then inspect `data`, `evidence` and `absentFields` before using a value. The fixed contracts are intentionally easier to validate than prompt-generated JSON.

### Why not a universal AI scraper?

The public 20-page gate measured 97.5% field accuracy with deterministic extraction alone. A local quantized model added no correct fields and only increased latency, so it is not included in version 1. See [`VERIFY.md`](./VERIFY.md) for the measured gate, market comparison, economics and live checks.

### FAQ

#### Does it extract any field I describe in a prompt?

No. It supports the six documented schemas only. Use a general AI scraper for arbitrary prompts.

#### Does it copy all JSON-LD from a page?

No. It selects and normalizes only the documented fields, supplements them from grounded page metadata, validates the final object and attaches evidence.

#### What happens when a value is missing?

The value is `null`, its evidence method is `absent`, and the field is listed in `absentFields`. The Actor does not guess.

#### Can it scrape private or logged-in pages?

No. Public pages only; no credentials, cookies or login flows are accepted.

#### Is it affiliated with Schema.org or the sites it reads?

No. Schema.org names describe public vocabulary types. This is an independent Apify Actor.

# Actor input Schema

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

One to twenty public HTTP(S) HTML page URLs. Use pages of the same schema type in one run. Private networks, credentials, custom ports, login walls and robots-disallowed pages are rejected.

## `schemaType` (type: `string`):

Choose the fixed field set to extract. The Actor does not infer arbitrary schemas or accept extraction prompts.

## Actor input object example

```json
{
  "urls": [
    "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
  ],
  "schemaType": "product"
}
```

# Actor output Schema

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

Dataset items containing fixed-schema data, per-field evidence, absent fields and source metadata.

# 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://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
    ],
    "schemaType": "product"
};

// Run the Actor and wait for it to finish
const run = await client.actor("dropin-apis/structured-data-to-json").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://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"],
    "schemaType": "product",
}

# Run the Actor and wait for it to finish
run = client.actor("dropin-apis/structured-data-to-json").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://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
  ],
  "schemaType": "product"
}' |
apify call dropin-apis/structured-data-to-json --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dropin-apis/structured-data-to-json"
        }
    }
}
```

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/GzDYamBRV4BJqTG2g/builds/lU2palGNVtKxhMJx6/openapi.json
