# AI Page to JSON: URL + Schema Extractor (`steady-scrape/ai-page-to-json`) Actor

Fetch a public page and extract structured JSON with an LLM using your schema or field list. Schema validation, partial/failed statuses, refuse login walls. Successful extractions only.

- **URL**: https://apify.com/steady-scrape/ai-page-to-json.md
- **Developed by:** [SteadyScrape](https://apify.com/steady-scrape) (community)
- **Categories:** AI, Developer tools, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 page extracteds

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

## AI Page to JSON: URL + Schema Extractor

**Who it's for:** Developers and data teams who need structured JSON from public web pages without writing a custom scraper for every site.

**What you get:** One validated JSON object per URL, matched to your schema or field list. Clear `ok` / `partial` / `failed` statuses. Login walls, captchas and paywalls are refused and free.

**Price:** $0.010 per extracted page (`ok` or `partial`) + $0.001 once per run, charged only if at least one page was extracted. Failed, refused, blocked, JS-only and empty pages are free. 1,000 pages = about $10.

Give it **public page URLs** plus a **JSON Schema** (or a simple field list). The Actor fetches each page over plain HTTP (Chrome-like fingerprint, no browser), sends the page text to an LLM (`openai/gpt-6-luna` via OpenRouter, no web search), validates the result against your schema, and returns structured rows. **No login bypass. No captcha solving. No personal-data harvesting features.**

Made by **SteadyScrape (steady-scrape)**.

### What you can do with it

1. **Product / listing pages → JSON.** Extract title, price, availability, SKU into a stable schema across many sites.
2. **Docs / blog pages → structured facts.** Pull headings, publish date, summary fields for RAG or CMS pipelines.
3. **Schema-first extraction.** Pass a JSON Schema so downstream code always gets the same shape (with `partial` when required fields are missing).
4. **Batch public URLs.** Up to dozens of pages per run; duplicates removed; soft `maxUrls` cap.

### Input

- **urls** (required): public `http(s)` page URLs.
- **jsonSchema** and/or **fields**: schema object, or a list like `title`, `price: Product price in USD`.
- **instructions** (optional): extra guidance for the model.
- **mock** (optional): offline test mode with placeholder values; no real extraction.

Example:

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

### Output

One dataset row per URL:

| status | meaning | charged |
|---|---|---|
| `ok` | schema satisfied (fields not stated on the page come back `null` and are listed in `nullFields`) | yes (`page-extracted`) |
| `partial` | some required fields missing (listed in `missingFields`) | yes |
| `failed` | could not extract usable JSON, or every field was empty | no |
| `refused` | login / paywall signals | no |
| `blocked` | captcha / bot challenge / 429 | no |
| `js_required` | page needs a browser (v1 is HTTP-only) | no |
| `fetch_error` / `skipped` | network / daily LLM guard / max charge | no |

Rows also carry `truncated: true` when a very long page was cut to `maxInputChars` (later fields or list items may be missing).

The run `OUTPUT` record has counts and charged event names. **Internal LLM costs are never written to the dataset or OUTPUT.**

### Pricing

Pay per event: **`page-extracted` $0.010** for each `ok`/`partial` page + **`actor-start` $0.001** once per run (only when at least one page was extracted), plus Apify's standard tiny per-run start event. Empty, failed, refused, blocked and JS-only pages are free. Example: 100 pages in one run ≈ $1.00. Set **Maximum cost per run** in Apify run options.

### FAQ

**Is the extracted data always correct?** No AI extractor can promise that. Rows are validated against your schema (shape and required fields), not fact-checked. Spot-check important values such as prices and dates.
**What happens on login walls, captchas or JavaScript-only pages?** They come back as `refused`, `blocked` or `js_required` and are not charged. This version fetches over HTTP and doesn't run a browser.
**Fields or a JSON Schema?** A field list is fastest to start with. Use `jsonSchema` when downstream code needs strict types and required fields; missing required fields give a `partial` row with `missingFields`.
**Does it invent values a page doesn't state?** It is instructed not to. Unstated fields come back `null` and are listed in `nullFields`.

**Worked cost example:** a weekly run over 100 product pages = 100 × $0.010 + $0.001 ≈ **$1.00** per run.

### Integrations

- **Apify API and SDKs:** call it from Python, JavaScript or any HTTP client and read results from the run's dataset.
- **Schedules and webhooks:** run it on a schedule in Apify and trigger your own endpoint when a run finishes.
- **Make, Zapier, n8n:** use Apify's own integrations for these tools to start runs and pass dataset rows on.
- **AI agents (MCP):** agents can call it through the Apify MCP server.

### Limits (v1)

- HTTP fetch only (no Playwright). JS-heavy SPAs may return `js_required`.
- Bounded page text and output tokens; schema-repair retries capped.
- Free-plan / uncovered LLM spend is daily-capped per Apify account.
- Does not bypass logins, paywalls or captchas.

### More from SteadyScrape

- [PDF to Text Markdown Extractor (Digital, No OCR)](https://apify.com/steady-scrape/pdf-text-markdown): bulk-convert digital PDFs from URLs to clean text and Markdown with page counts; scanned files are flagged and free.
- [YouTube Transcript API: Captions with Timestamps](https://apify.com/steady-scrape/youtube-transcripts): existing YouTube captions with timestamped segments for up to 200 videos per run; videos without captions are free.
- [Company Data Enrichment by Domain: Logo & Socials](https://apify.com/steady-scrape/company-profile-by-domain): company name, logo, social profiles and industry from a list of domains.
- [SEO MCP Server: Keyword, SERP & Backlink Data](https://apify.com/steady-scrape/seo-data-mcp-server): keyword volume, Google SERPs, backlinks, Trends and YouTube data as MCP tools for Claude, Cursor or any MCP client.

See every **SteadyScrape (steady-scrape)** Actor on [our Apify profile](https://apify.com/steady-scrape).

# Actor input Schema

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

Public HTTP(S) page URLs to extract from. Login walls, captchas and paywalls are refused and not charged. Up to 50 per run (hard cap via env).

## `jsonSchema` (type: `object`):

A JSON Schema (draft-07 style object) describing the fields to extract. Either this or fields/instructions is required.

## `fields` (type: `array`):

Simple alternative to a full schema: list of field names (or name: description). Built into a basic object schema.

## `instructions` (type: `string`):

Optional natural-language guidance for the model (e.g. 'prefer the main product price in USD').

## `mock` (type: `boolean`):

Offline test mode: returns placeholder values without real extraction. Never charged.

## `maxUrls` (type: `integer`):

Soft cap for this run (harder env cap may be lower).

## `maxInputChars` (type: `integer`):

Pages longer than this are truncated before the LLM call.

## `maxOutputTokens` (type: `integer`):

Maximum LLM output tokens per page.

## `maxRepairRetries` (type: `integer`):

Extra LLM calls if the first JSON fails schema validation.

## Actor input object example

```json
{
  "urls": [
    "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
  ],
  "mock": false,
  "maxUrls": 20,
  "maxInputChars": 40000,
  "maxOutputTokens": 1500,
  "maxRepairRetries": 1
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("steady-scrape/ai-page-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"] }

# Run the Actor and wait for it to finish
run = client.actor("steady-scrape/ai-page-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"
  ]
}' |
apify call steady-scrape/ai-page-to-json --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steady-scrape/ai-page-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/zj9k84VT0w5nmYS8w/builds/qVafiwaGbTk8Nb77P/openapi.json
