# AI Web Scraper - Any Website to JSON & Markdown (`helenisapi/ai-web-scraper-json-markdown`) Actor

Scrape 🤖 Any Website to JSON with AI: list your fields, get clean data from product pages, listings & articles. ✅ Verified on page. 📦 No API key.

- **URL**: https://apify.com/helenisapi/ai-web-scraper-json-markdown.md
- **Developed by:** [Helenis API](https://apify.com/helenisapi) (community)
- **Categories:** AI, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 page extractions

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 Web Scraper - Any Website to JSON & Markdown

**Name the data you want, get it as clean JSON.** Paste URLs, list your fields (`title`, `price:number`, `link:url`...) and the AI reads each page for you: **one row per page**, or **one row per item** on listings, product grids, job boards and search results. No selectors, no code, nothing to maintain when the site changes.

Every text value is **checked against the page**: if it is not there, you get `null`, never an invented answer. Need the raw content instead? Switch to **Page to Markdown** for LLM-ready text.

No API key, no prompt to write: paste URLs, name your fields and hit **Run**.

***

### ⚡ Why this actor?

- 🧩 **Your schema:** up to 30 typed fields (string, number, integer, boolean, url, date, list).
- 📋 **Lists in one go:** up to 100 items per page, in page order.
- ✅ **No hallucinations:** text that is not on the page is dropped.
- 🔗 **Absolute links** and **ISO dates** out of the box.
- 🧠 **Reads schema.org JSON-LD** too, where prices and dates often hide.
- 📝 **Markdown mode:** headings, lists, tables and links, plus the page's JSON-LD. No AI, cheaper.
- 🛠️ **Zero maintenance:** no CSS selectors to fix when the layout changes.

***

### 🏆 How it compares

| Feature | This actor | Selector scrapers | Generic LLM scrapers |
|---|:---:|:---:|:---:|
| 🧩 Fields in plain words | ✅ | ❌ Code | ✅ |
| ✅ Values checked against the page | ✅ | ✅ | ❌ |
| 📋 Every item of a list | ✅ | ✅ | ⚠️ |
| 🛠️ Survives layout changes | ✅ | ❌ | ✅ |
| 📝 Markdown mode | ✅ | ❌ | ⚠️ |

***

### 📊 What data do you get?

**Your field names become the columns.** Each row also carries page metadata:

| Field | Description | Example |
|---|---|---|
| `sourceUrl` | The URL you gave | `https://books.toscrape.com/` |
| `finalUrl` | The URL after redirects | `https://books.toscrape.com/` |
| `pageTitle` | The page's title | `All products \| Books to Scrape - Sandbox` |
| `success` | `true` when the page was read, `false` when it failed | `true` |
| `pageTruncated` | The page was longer than what the AI reads (~30,000 characters of content) | `false` |
| `position` | Item rank on the page, with **Every item on the page** | `1` |
| `error` | Failed pages only: `code` and `message` | — |
| *your fields* | One column per field, `null` when the value is not on the page | `"price": 51.77` |

If one of your fields has the same name as a metadata column, your field wins.

#### 🧩 Field types

| Type | You get |
|---|---|
| `string` | Short text copied from the page, checked against it |
| `number` | A plain number, without currency symbol or thousands separator |
| `integer` | A whole number |
| `boolean` | `true` or `false` |
| `url` | An absolute link that appears on the page |
| `date` | `YYYY-MM-DD` (`YYYY-MM` or `YYYY` when the day is not given) |
| `list` | A list of short strings (up to 50), each checked against the page |

#### 📝 Page to Markdown mode

| Field | Description | Example |
|---|---|---|
| `markdown` | The page as clean Markdown (up to 200,000 characters) | — |
| `characters` | Length of that Markdown | — |
| `jsonLd` | The page's schema.org JSON-LD blocks | — |

Plus `sourceUrl`, `finalUrl`, `pageTitle` and `success`.

***

### 🚀 How to use it

1. Paste **URLs**.
2. List your **fields** (name, type, optional description).
3. Turn on **Every item on the page** for listings.
4. Click **Run**, then export the table.

Field names use letters, digits and underscores, start with a letter, and must be unique. The **description** says where to look ("price in GBP, without the symbol"), up to 200 characters. Short strings work too: `"price:number"`.

#### ⚙️ Input

| Option | Default | Description |
|---|:---:|---|
| 🌐 **URLs** | — | One page per line: product pages, listings, job boards, articles... |
| **What to get** | 🤖 Extract my fields (AI) | AI extraction of your fields, or 📝 Page to Markdown (no AI, cheaper). |
| 🧩 **Fields to extract** | — | Objects `{"name", "type", "description"}`, or short strings like `"price:number"`. |
| 📋 **Every item on the page** | Off | On: one row per repeated item (products, jobs, results...). Off: one row per page. |
| **Max items per page** | `50` | With **Every item on the page** (100 max). |

#### Input example

```json
{
  "urls": ["https://books.toscrape.com/"],
  "mode": "extract",
  "fields": [
    { "name": "title", "type": "string", "description": "full book title" },
    { "name": "price", "type": "number", "description": "price in GBP" },
    { "name": "in_stock", "type": "boolean" },
    { "name": "link", "type": "url", "description": "book page" }
  ],
  "everyItem": true,
  "maxItemsPerPage": 50
}
```

#### Output example (books.toscrape.com, every item)

```json
{
  "sourceUrl": "https://books.toscrape.com/",
  "pageTitle": "All products | Books to Scrape - Sandbox",
  "success": true,
  "position": 1,
  "title": "A Light in the Attic",
  "price": 51.77,
  "in_stock": true,
  "link": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
}
```

*From a real run, shortened: `finalUrl` and `pageTruncated` omitted. Your field names become the columns, next to `sourceUrl`, `pageTitle` and `position`.*

Available as **JSON**, **CSV**, **Excel**, or via the **Apify API** and **dataset exports**.

***

### 💰 Pricing

| Event | When |
|---|---|
| 🤖 Page extraction | Each page read by the AI |
| 📋 Item | Each item returned with "Every item on the page" |
| 📝 Markdown page | Each page converted to Markdown |

Failed pages are free.

> 🆓 On the Apify **free plan**, each run scrapes up to 10 pages.

The run stops cleanly when your spending limit is reached.

***

### 💡 Use cases

- 🏷️ **Price monitoring:** products, prices and stock from any shop.
- 📇 **Lead lists:** directories and member pages to rows.
- 💼 **Job aggregation:** titles, locations and links from career pages.
- 📰 **Content tracking:** article titles, dates and authors from blogs and news pages.
- 🏠 **Listings:** property, car or marketplace results into a spreadsheet.
- 🧠 **RAG & AI agents:** Page to Markdown for clean, LLM-ready context.
- 🔁 **Replace brittle scrapers:** one field list instead of selectors that break with each redesign.

***

### ❓ FAQ

**How does it avoid invented values?**
Every value is checked after the AI answers. Text must appear on the page (word for word, or at least 80 % of its words; all of them up to 3 words), links must appear on the page, dates must be ISO. Anything else becomes `null`. On python.org job listings, all 105 legitimate values passed this check.

**Can I ask it to summarise or translate?**
No: it extracts what is on the page, and anything else comes back `null`. Descriptions only say where to look. In our tests, a poem, an answer to a question and a translation requested through descriptions all came back `null`.

**Does it run JavaScript?**
No: it reads the HTML the server sends. Pages that only render in the browser are reported as `page_empty` and are free.

**How long can a page be?**
The first ~30,000 characters of content are read; `pageTruncated` tells you when a page was longer. In Markdown mode you get up to 200,000 characters.

**What do failed pages cost?**
Nothing. A page that cannot be fetched, is not HTML, is empty without JavaScript, or hits an AI error gets a row with `success: false` and the error, and is not charged. Network and AI errors are retried once first. A page that was read but had no matching item counts as one page extraction, with no item charges.

**What does Markdown mode keep?**
Headings, paragraphs, lists, tables, absolute links and image alt text. Navigation, footers, scripts, forms and hidden elements are removed. The page's JSON-LD comes in its own column.

**How many fields and items can I ask for?**
Up to 30 fields per run and up to 100 items per page.

**What formats can I export?**
JSON, CSV, Excel, or straight from the Apify API and dataset exports.

***

### 🔌 Integrations

Connect results to your existing workflow:

- 📗 **Google Sheets**: Auto-export results to a spreadsheet
- 🪝 **Webhooks**: Trigger downstream actions when a run completes
- ⚡ **Zapier / Make**: Plug into 1000+ apps
- 🛠️ **API**: Fetch results programmatically from any language
- 🔄 **Scheduled runs**: Track prices, jobs or listings over time with recurring runs
- 🤖 **AI agents**: call it from Claude, Cursor or any MCP client through Apify's MCP server

***

### 🌐 Also available as an API

The same engine is sold as a REST API on RapidAPI as **AI Web Scraper - Extract Structured Data to JSON** by **Helenis API**, with the same fields, list mode and Markdown endpoint.

***

### 🔒 Privacy

Pages are processed in memory and never stored or logged.

# Actor input Schema

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

One page per line: product pages, listings, job boards, articles...

## `mode` (type: `string`):

AI extraction of your fields, or the page as clean Markdown (no AI, cheaper).

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

Objects {"name", "type", "description"}, or short strings like "price:number".

## `everyItem` (type: `boolean`):

On: one row per repeated item (products, jobs, results...). Off: one row per page.

## `maxItemsPerPage` (type: `integer`):

With "Every item on the page" (100 max).

## Actor input object example

```json
{
  "urls": [
    "https://books.toscrape.com/"
  ],
  "mode": "extract",
  "fields": [
    {
      "name": "title",
      "type": "string",
      "description": "full book title"
    },
    {
      "name": "price",
      "type": "number",
      "description": "price in GBP"
    },
    {
      "name": "in_stock",
      "type": "boolean"
    },
    {
      "name": "link",
      "type": "url",
      "description": "book page"
    }
  ],
  "everyItem": true,
  "maxItemsPerPage": 50
}
```

# 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": [
        "https://books.toscrape.com/"
    ],
    "fields": [
        {
            "name": "title",
            "type": "string",
            "description": "full book title"
        },
        {
            "name": "price",
            "type": "number",
            "description": "price in GBP"
        },
        {
            "name": "in_stock",
            "type": "boolean"
        },
        {
            "name": "link",
            "type": "url",
            "description": "book page"
        }
    ],
    "everyItem": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("helenisapi/ai-web-scraper-json-markdown").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/"],
    "fields": [
        {
            "name": "title",
            "type": "string",
            "description": "full book title",
        },
        {
            "name": "price",
            "type": "number",
            "description": "price in GBP",
        },
        {
            "name": "in_stock",
            "type": "boolean",
        },
        {
            "name": "link",
            "type": "url",
            "description": "book page",
        },
    ],
    "everyItem": True,
}

# Run the Actor and wait for it to finish
run = client.actor("helenisapi/ai-web-scraper-json-markdown").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/"
  ],
  "fields": [
    {
      "name": "title",
      "type": "string",
      "description": "full book title"
    },
    {
      "name": "price",
      "type": "number",
      "description": "price in GBP"
    },
    {
      "name": "in_stock",
      "type": "boolean"
    },
    {
      "name": "link",
      "type": "url",
      "description": "book page"
    }
  ],
  "everyItem": true
}' |
apify call helenisapi/ai-web-scraper-json-markdown --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,helenisapi/ai-web-scraper-json-markdown"
        }
    }
}
```

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/gqQdZln2DAxI8eLJy/builds/X1ZETeXdA0foPQnkY/openapi.json
