# Schema.org Extractor — All Structured Data, Flattened (`xtracto/schema-org-extractor`) Actor

Pull every schema.org entity out of any page — Product, Offer, Review, Recipe, Article, FAQ, Event, JobPosting — flattened to one row each, with @id references resolved. Keyless, HTTP-only.

- **URL**: https://apify.com/xtracto/schema-org-extractor.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** 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 $0.33 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Schema.org Extractor — All Structured Data, Flattened

Pull every schema.org entity out of any web page (Product, Offer, Review, Recipe, Article, FAQPage, Event, JobPosting, Organization) as one clean row each, wherever it sits on the page.

### Why use this actor

- **No account, no login, no API key.** Paste page URLs and run.
- **One row per entity.** Deeply nested data is flattened, so a price buried nine levels deep becomes its own row instead of a path you have to guess per site.
- **Knows exactly where each entity came from.** Every row carries its parent type and its position in the page's data.
- **Linked entities are filled in.** References such as `"publisher": {"@id": "…#organization"}` are replaced with the real Organization from the same page.
- **Filter by type.** Ask only for `Product` and `Offer`, or `Recipe`, or `JobPosting`.
- **Stable JSON output** ready for pipelines, databases or spreadsheets. Export to JSON, CSV or Excel.

### How it works

1. You give it page URLs (a bare domain works too).
2. The actor downloads each page and reads every schema.org JSON-LD block on it.
3. Every typed entity is turned into its own row, with its parent, position and a readable summary of its properties.
4. Optional filters keep only the types you want and cap the number of rows per page.

No scrapers or browsers to manage. Pair it with **Sitemap Crawler** to sweep a whole site.

### Input

```json
{
  "urls": ["https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/"],
  "types": ["Product", "Offer"],
  "resolveReferences": true,
  "includeRawEntity": true,
  "maxEntitiesPerPage": 3,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

| Field | Type | Description |
|---|---|---|
| `urls` | array of strings | Pages to read. Required. |
| `types` | array of strings | Optional, case-insensitive filter such as `Product`, `Offer`, `Recipe`, `JobPosting`. Leave empty for every entity. |
| `resolveReferences` | boolean | Replace bare `@id` references with the real entity from the same page. Default `true`. |
| `includeRawEntity` | boolean | Include the full entity JSON in `raw`. Turn off for smaller rows. Default `true`. |
| `maxEntitiesPerPage` | integer | `0` = no limit. A category page can carry hundreds. |
| `proxyConfiguration` | object | Proxy settings. Recommended for retail and travel sites. |

### Output

Real output for the input above (the first 2 of 3 rows; the IKEA link opened the BILLY category page):

```json
[
  {
    "_input": "https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/",
    "_source": "S1-jsonld",
    "_scrapedAt": "2026-11-11T13:14:00Z",
    "rank": 1,
    "url": "https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/",
    "finalUrl": "https://www.ikea.com/us/en/cat/billy-bookcases-58288/",
    "type": "Product",
    "types": ["Product"],
    "schemaId": "https://www.ikea.com/us/en/p/billy-bookcase-white-20522046/#product",
    "parentType": "ListItem",
    "jsonPath": "$.@graph[2].mainEntity.itemListElement[0].item",
    "depth": 6,
    "blockIndex": 0,
    "name": "BILLY, Bookcase, white, 31 1/2x11x79 1/2 \"",
    "headline": null,
    "description": null,
    "properties": {
      "name": "BILLY, Bookcase, white, 31 1/2x11x79 1/2 \"",
      "url": "https://www.ikea.com/us/en/p/billy-bookcase-white-20522046/",
      "image": "https://www.ikea.com/us/en/images/products/billy-bookcase-white__1590272_pe1038911_s5.jpg",
      "offers": "Offer",
      "aggregateRating": "AggregateRating"
    },
    "raw": {
      "@type": "Product",
      "@id": "https://www.ikea.com/us/en/p/billy-bookcase-white-20522046/#product",
      "name": "BILLY, Bookcase, white, 31 1/2x11x79 1/2 \"",
      "url": "https://www.ikea.com/us/en/p/billy-bookcase-white-20522046/",
      "image": "https://www.ikea.com/us/en/images/products/billy-bookcase-white__1590272_pe1038911_s5.jpg",
      "offers": {
        "@type": "Offer",
        "priceSpecification": [
          { "@type": "UnitPriceSpecification", "price": 79, "priceCurrency": "USD" }
        ]
      },
      "aggregateRating": { "@type": "AggregateRating", "ratingValue": 4.5, "reviewCount": 2124 }
    }
  },
  {
    "_input": "https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/",
    "_source": "S1-jsonld",
    "_scrapedAt": "2026-11-11T13:14:00Z",
    "rank": 2,
    "url": "https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/",
    "finalUrl": "https://www.ikea.com/us/en/cat/billy-bookcases-58288/",
    "type": "Offer",
    "types": ["Offer"],
    "schemaId": null,
    "parentType": "Product",
    "jsonPath": "$.@graph[2].mainEntity.itemListElement[0].item.offers",
    "depth": 7,
    "blockIndex": 0,
    "name": null,
    "headline": null,
    "description": null,
    "properties": { "priceSpecification": ["UnitPriceSpecification"] },
    "raw": {
      "@type": "Offer",
      "priceSpecification": [
        { "@type": "UnitPriceSpecification", "price": 79, "priceCurrency": "USD" }
      ]
    }
  }
]
```

| Field | Type | Description |
|---|---|---|
| `url`, `finalUrl` | string | The URL requested and the page it ended on after redirects |
| `rank` | integer | Order of the entity on the page |
| `type`, `types` | string, array | The entity's `@type`; `types` keeps all of them when there are several |
| `schemaId` | string | The entity's `@id`, when it has one |
| `parentType` | string | The entity it is nested in (an `Offer`'s parent is a `Product`) |
| `jsonPath`, `depth`, `blockIndex` | string, integer | Exactly where on the page it was found |
| `name`, `headline`, `description` | string | Filled only when the entity has them |
| `properties` | object | Readable summary; nested entities appear as their type name |
| `raw` | object | The full entity (omitted when `includeRawEntity` is off) |
| `_input`, `_source`, `_scrapedAt` | string | The input URL, data source and time of extraction |

### Error rows

When a page yields nothing, you get one row with an `_error` code instead of silence:

| `_error` | Meaning |
|---|---|
| `no_structured_data` | No JSON-LD on the page; the detail says how many microdata or RDFa elements it has instead |
| `no_types_matched` | Structured data exists, but not of the requested types; the detail lists what the page does carry |
| `not_found`, `not_html`, `too_large` | The URL could not be read as a page |
| `blocked`, `network_error` | The site refused the request, or could not be reached |

### Notes

- **All common layouts are handled**: a single object, a list of objects, and an `@graph` wrapper.
- **Microdata and RDFa are detected but not extracted.** They are much rarer than JSON-LD (3 of 26 pages tested used microdata).
- **One broken block does not cost you the others.** Invalid data in one block is logged, and the rest of the page is still read.
- **Category pages are large.** A single IKEA category page yields over 100 entities; use `types` or `maxEntitiesPerPage` to keep runs small.
- For retail and travel sites, keep the proxy on.
- Use **Website Content Extractor** when you want the article text instead of structured data.

# Actor input Schema

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

Pages to read. A bare domain works. Pair this with Sitemap Crawler to sweep a whole site.

## `types` (type: `array`):

Optional filter, case-insensitive — e.g. Product, Offer, Recipe, JobPosting. Leave empty to return every entity found.

## `resolveReferences` (type: `boolean`):

In a @graph, entities point at each other with bare {"@id": ...} stubs that carry no data. On, those are replaced with the real entity from the same page.

## `includeRawEntity` (type: `boolean`):

Off keeps rows small — you still get type, name, path and a readable property summary.

## `maxEntitiesPerPage` (type: `integer`):

0 = no limit. A category page can carry hundreds.

## `proxyConfiguration` (type: `object`):

Recommended for retail and travel sites, which often refuse datacentre addresses.

## Actor input object example

```json
{
  "urls": [
    "https://www.ikea.com/us/en/p/billy-bookcase-white-00263850/"
  ],
  "types": [],
  "resolveReferences": true,
  "includeRawEntity": true,
  "maxEntitiesPerPage": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per scraped record, stored in the run's default dataset.

# 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.ikea.com/us/en/p/billy-bookcase-white-00263850/"
    ],
    "types": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/schema-org-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.ikea.com/us/en/p/billy-bookcase-white-00263850/"],
    "types": [],
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/schema-org-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.ikea.com/us/en/p/billy-bookcase-white-00263850/"
  ],
  "types": []
}' |
apify call xtracto/schema-org-extractor --silent --output-dataset

```

## MCP server setup

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