# Structured Data Extractor: JSON-LD, Microdata, RDFa (`examsens.ai/structured-data-extractor`) Actor

Check the schema.org markup in your page source and find the JSON-LD that won't parse. It reads JSON-LD, Microdata and RDFa on a list of pages or pasted HTML, groups every item by schema.org type, gives the line and column of each JSON-LD error, and lists Open Graph tags.

- **URL**: https://apify.com/examsens.ai/structured-data-extractor.md
- **Developed by:** [Ed Rayyis](https://apify.com/examsens.ai) (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

from $4.50 / 1,000 page processeds

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 Extractor: JSON-LD, Microdata, RDFa

Give it a list of page URLs, or paste the HTML of a page, and it returns every structured data item on each page, grouped by schema.org type, with any broken JSON-LD reported down to the line and column.

### Use it for

- Checking that a product, article or event page carries the schema.org markup you expect.
- Finding JSON-LD blocks that don't parse, with the line and column of the fault.
- Reading the Open Graph and Twitter Card tags of a page in one pass.

### Sample

Input, one page:

```json
{ "urls": [{ "url": "https://en.wikipedia.org/wiki/Markdown" }] }
```

The run returned one row for the page. It found structured data in two formats: 1 JSON-LD item and 237 RDFa items, 238 items in all, with no Microdata. The JSON-LD item sits under `byType.Article`:

```json
{
  "format": "jsonLd",
  "data": {
    "@type": "Article",
    "name": "Markdown",
    "url": "https://en.wikipedia.org/wiki/Markdown",
    "publisher": { "@type": "Organization", "name": "Wikimedia Foundation, Inc." }
  },
  "block": 1
}
```

### What you get for each page

- Items grouped by type. Products, recipes, articles, breadcrumbs, organizations and every other type sit under their own key, with schema.org types shortened to their plain name (`Product`, not `https://schema.org/Product`). Each item says which format it came from and, for JSON-LD, which script block.
- Items in all three formats: JSON-LD (including `@graph` lists), Microdata and RDFa.
- Each JSON-LD block is parsed on its own, so one broken block does not hide the others. A block that is not valid JSON is reported with the parser message, line, column and the text around the fault. When the only faults are comments or trailing commas, the data is still returned and the error is marked as recovered.
- A type summary. `types` lists the top level types, `nestedTypes` lists types found inside them (such as `Offer` inside `Product`), and `counts` gives the number of items per format.
- Open Graph and Twitter Card tags, as plain key and value pairs.
- A type filter, to keep only the types you care about.

### Input

- Page URLs, HTML to check (with an optional base URL), or both
- Formats: JSON-LD, Microdata, RDFa, Open Graph, Twitter Card (default all)
- Only these types (optional), such as `Product` or `Recipe`
- Include RDFa without a type (default off)
- Pages at once (default 5) and page timeout (default 30 seconds)

### Output

Dataset: one item per page with `url`, `finalUrl`, `statusCode`, `ok`, `formatsFound`, `counts`, `types`, `nestedTypes`, `itemCount`, `byType`, `openGraph`, `twitterCard`, `errors`, `errorCount` and `warnings`. Pasted HTML gives an item with `source: "html input"`.

RDFa attributes that only describe the page itself (such as `role` and `vocab` declarations) are left out, and Open Graph tags are reported under `openGraph` instead of being repeated as RDFa. RDFa nodes with no type, such as those from `rel` attributes on ordinary links, are left out unless you turn on "Include RDFa without a type".

A page that cannot be read returns an item with `ok: false` and the reason, such as `HTTP 500` or an address that is not http or https. The rest of the run carries on.

Export as JSON, CSV or Excel, or read it over the API.

### Pricing

Pay per event: one event per page read. A page that fails is not charged. The run stops when it reaches the maximum charge you set.

### Scope and conduct

The actor downloads only the HTML of each URL you list, so it doesn't see markup that scripts add after the page loads. It follows no links and uses no login.

### Related actors

From the same account, for checking a website:

- [Site Audit: on page SEO and broken link checks](https://apify.com/examsens.ai/site-audit)
- [llms.txt Generator: crawl a site, write llms.txt and full text](https://apify.com/examsens.ai/llms-txt-generator)
- [Lighthouse Audit: bulk speed, SEO and accessibility scores](https://apify.com/examsens.ai/lighthouse-audit)

### Support

Questions and problems: the Issues tab on this page.

# Actor input Schema

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

Pages to read. Each URL is fetched once; links are not followed.

## `html` (type: `string`):

Paste the HTML of a page, for example one that is not published yet. It is read as one more input, next to any URLs.

## `htmlBaseUrl` (type: `string`):

Used to make relative addresses in the pasted HTML absolute.

## `formats` (type: `array`):

Which formats to read. Leave empty for all.

## `typeFilter` (type: `array`):

Keep only items of these types, such as Product or Recipe. A full schema.org address works too. Leave empty to keep every type.

## `includeUntypedRdfa` (type: `boolean`):

RDFa nodes with no typeof mostly come from rel attributes on ordinary links. They are left out unless you turn this on.

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

How many pages to fetch in parallel.

## `timeoutSecs` (type: `integer`):

Give up on a page after this many seconds.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://en.wikipedia.org/wiki/Markdown"
    },
    {
      "url": "https://github.com/apify/crawlee"
    }
  ],
  "formats": [
    "jsonLd",
    "microdata",
    "rdfa",
    "openGraph",
    "twitterCard"
  ],
  "includeUntypedRdfa": false,
  "maxConcurrency": 5,
  "timeoutSecs": 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 = {
    "urls": [
        {
            "url": "https://en.wikipedia.org/wiki/Markdown"
        },
        {
            "url": "https://github.com/apify/crawlee"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("examsens.ai/structured-data-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": [
        { "url": "https://en.wikipedia.org/wiki/Markdown" },
        { "url": "https://github.com/apify/crawlee" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("examsens.ai/structured-data-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": [
    {
      "url": "https://en.wikipedia.org/wiki/Markdown"
    },
    {
      "url": "https://github.com/apify/crawlee"
    }
  ]
}' |
apify call examsens.ai/structured-data-extractor --silent --output-dataset

```

## MCP server setup

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