# Structured Data Crawler (`tempting_district/structured-data-crawler`) Actor

Crawl public web pages and convert unstructured content into clean, deterministic, schema-first structured records.

- **URL**: https://apify.com/tempting_district/structured-data-crawler.md
- **Developed by:** [Lone](https://apify.com/tempting_district) (community)
- **Categories:** Developer tools, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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

## Structured Data Crawler

Crawl public web pages and convert unstructured HTML content into clean, deterministic, schema-first structured records.

This Actor is designed for teams that need **reliable, reusable data**, not raw pages. It extracts declared fields from public web pages and emits normalized records suitable for analytics, indexing, or downstream automation.

***

### What This Actor Does

- Crawls public, accessible HTML pages
- Extracts predefined structured fields
- Normalizes outputs into a stable schema
- Deduplicates records deterministically
- Produces one record per page

This Actor is **schema-first**, not exploratory.

***

### Core Guarantees

- Same input → same output (deterministic)
- Fields are never omitted (nullable allowed)
- No hidden defaults or inference
- No external services or APIs
- No LLM usage

If a value cannot be extracted, it is explicitly set to `null`.

***

### Input Parameters

#### Preset (Optional)

- **preset**
  - `none` (default)
  - `articles-v0.1`

Built-in presets allow regression testing and validation.

***

#### Seed URLs

- **seedUrlsText**\
  One URL per line to crawl. Required when `preset` is `none`.

***

#### Crawl Options

- **maxPages**\
  Maximum number of pages to process (default: 10)

- **dedupe**\
  Enable deterministic deduplication using content hash (default: true)

***

### Link Discovery (Depth = 1)

When enabled implicitly:

- Links are extracted from seed pages only
- Only same-domain URLs are followed
- Crawl depth is strictly limited to 1
- No recursion or infinite crawling

This increases coverage while preserving determinism.

***

### Output Schema

Each dataset row contains:

- **title** — Page title (or `null`)
- **url** — Page URL
- **domain** — Source domain
- **publishedDate** — ISO date or `null`
- **author** — Author name or `null`
- **entityType** — `article`
- **summaryText** — Meta description or `null`
- **sourceHash** — SHA-256 content hash
- **extractedAt** — ISO timestamp

All fields are always present.

***

### Supported Content

- Public articles
- Case study pages
- Documentation pages
- Reports hosted as HTML

***

### What This Actor Does NOT Do

- No JavaScript rendering
- No authenticated or paywalled access
- No LLM enrichment or summarization
- No classification or inference
- No infinite crawling

This Actor prioritizes **trust and stability** over breadth.

***

### Legal & Compliance

- Only public, accessible pages are processed
- No personal data intentionally stored
- No cookies, sessions, or tracking
- GDPR-friendly by design

***

### Performance

- Typical runtime: under 2 minutes for small crawls
- Memory usage: under 4 GB
- Deterministic and unattended execution
- Suitable for scheduled and automated runs

***

### Versioning

- **v0.1** — Single-page structured extraction
- **v0.2** — Same-domain link discovery (depth = 1)

Future changes will be versioned explicitly to preserve schema trust.

***

### Final Note

Most crawlers extract pages.\
This Actor extracts **records**.

It exists to create data surfaces reliable enough to build systems on — without needing to re-scrape or reinterpret the source content.

# Actor input Schema

## `preset` (type: `string`):

Optional built-in test presets for validation

## `seedUrlsText` (type: `string`):

One URL per line to crawl

## `maxPages` (type: `integer`):

Maximum number of pages to crawl

## `dedupe` (type: `boolean`):

Deduplicate records using content hash

## Actor input object example

```json
{
  "preset": "none",
  "seedUrlsText": "",
  "maxPages": 10,
  "dedupe": true
}
```

# Actor output Schema

## `overview` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("tempting_district/structured-data-crawler").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("tempting_district/structured-data-crawler").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 '{}' |
apify call tempting_district/structured-data-crawler --silent --output-dataset

```

## MCP server setup

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

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/FJKj9ZEqoeC8NK0Xk/builds/8V3gzbgb2TngPIZnE/openapi.json
