# AI Web Data Extractor: Extract Structured Data from Any Website (`datatools-ai/ai-web-data-extractor`) Actor

No-code AI web scraper. Paste public page URLs, describe the fields in plain language, and extract structured JSON — no CSS selectors, no OpenAI key. Respects robots.txt, skips login walls, not for personal data. $0.008 per extracted page (100 pages = $0.80).

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

## Pricing

from $8.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 Web Data Extractor: Extract Structured Data from Any Website

| You give | You get | Cost |
|---|---|---|
| Public page URLs + the fields you want, described in plain language (or a JSON Schema) | One structured JSON item per page: your fields + `url` + `status` | **$0.008 per successfully extracted page** + $0.001 start (100 pages = **$0.80** + start). Failed, robots-blocked or login-walled pages are free. |

👉 Press **Start** to try the prefilled example (a public catalog page and a product page, **≈ $0.017**).

**A no-code AI web scraper for pages you already have the right to read.** Paste public URLs, describe each field in plain English (or Spanish), and extract structured data from any website into clean JSON — titles, prices, categories, ratings, stock, lists of items, booleans, numbers. The model is OpenAI GPT-4o mini. No OpenAI key is needed on your side. No CSS selectors, no browser login, no third-party Actors.

This Actor only fetches **public http(s) pages** with a polite HTTP client. It **respects robots.txt**, uses a clear crawler User-Agent, waits between requests, and **skips pages that look like a login wall**. It is **not for collecting personal data** about private individuals.

Built for **developers, data teams, analysts, no-code users and AI agents** who already know which public pages they want and need a schema, not a site-specific scraper.

### Use cases

- **Product pages and catalogs** — extract title, price, stock, rating and category from public product pages, without writing CSS selectors.
- **Lists and directories** — pull a list of item names from a public listing page into a JSON array.
- **Articles, docs and help centers** — turn a public article into structured fields (title, summary, key facts).
- **URL lists to spreadsheets** — feed a list of public URLs and download CSV or Excel, with no code.
- **AI agents** — give an agent structured JSON from pages the user already identified, via the Apify API or MCP server.

### How to use

1. Press **Start** on the prefilled example (a public catalog page and a product page on [Books to Scrape](https://books.toscrape.com/), a site published for this kind of test).
2. Replace the URLs with the public pages you have the right to read.
3. Edit **Fields to extract**: one object per field (`name`, `instruction`, `type` = `text` | `enum` | `number` | `boolean` | `list`).
4. Download the dataset as JSON, CSV or Excel, or call the Actor from the Apify API / MCP server.

### Input example

```json
{
  "urls": [
    "https://books.toscrape.com/",
    "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
  ],
  "fields": [
    { "name": "title", "instruction": "The main page or product title (full text, not truncated).", "type": "text" },
    { "name": "price", "instruction": "Product price including the currency symbol as shown on the page. Null if this is not a product page.", "type": "text" },
    { "name": "rating", "instruction": "Star rating as a number from 1 to 5 if shown. Null if this is not a product page.", "type": "number" },
    { "name": "in_stock", "instruction": "True if the product is in stock, false if out of stock, null otherwise.", "type": "boolean" },
    { "name": "stock_count", "instruction": "Number of items in stock if a count is shown, otherwise null.", "type": "number" },
    { "name": "listed_items", "instruction": "Up to 8 full product titles from a catalog page. Empty list on a single product page.", "type": "list" }
  ]
}
```

You can pass a `jsonSchema` object instead of `fields` if you already have a schema. The live prefill also asks for `description` and `category`.

### Output example (real run)

One dataset item per URL. These are real results from the prefilled Books to Scrape example (a catalog page and a product page):

```json
[
  {
    "url": "https://books.toscrape.com/",
    "finalUrl": "https://books.toscrape.com/",
    "status": "ok",
    "httpStatus": 200,
    "title": "All products | Books to Scrape - Sandbox",
    "description": null,
    "price": null,
    "category": "Books",
    "rating": null,
    "in_stock": null,
    "stock_count": null,
    "listed_items": [
      "A Light in the Attic",
      "Tipping the Velvet",
      "Soumission",
      "Sharp Objects",
      "Sapiens: A Brief History of Humankind",
      "The Requiem Red",
      "The Dirty Little Secrets of Getting Your Dream Job",
      "The Coming Woman: A Novel Based on the Life of the Infamous Feminist, Victoria Woodhull"
    ]
  },
  {
    "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
    "finalUrl": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
    "status": "ok",
    "httpStatus": 200,
    "title": "A Light in the Attic | Books to Scrape - Sandbox",
    "description": "It's hard to imagine a world without A Light in the Attic. This now-classic collection of poetry and drawings from Shel Silverstein celebrates its 20th anniversary with this special edition. Silverstein's humorous and creative verse can amuse the dowdiest of readers. Lemon-faced adults and fidgety kids sit still and read these rhythmic words and laugh and smile and love that Silverstein. Need proof of his genius? RockabyeRockabye baby, in the treetopDon't you know a treetopIs no safe place to rock?And who put you up there,And your cradle, too?Baby, I think someone down here'sGot it in for you. Shel, you never sounded so good.",
    "price": "£51.77",
    "category": "Poetry",
    "rating": 3,
    "in_stock": true,
    "stock_count": 22,
    "listed_items": []
  }
]
```

Possible `status` values: `ok` (charged), `blocked-by-robots-txt`, `login-required`, `http-404` (or other HTTP codes), `unsupported-content-type`, `too-little-content`, `ai-failed`, `unreachable`. Only `ok` is charged.

### Pricing

Pay per result. Model costs are included — no OpenAI key needed. Set a maximum cost per run in the run options.

| What you run | You pay |
|---|---|
| Actor start (once per run) | $0.001 |
| 1 successfully extracted page | $0.008 |
| **100 extracted pages** | **$0.80 + $0.001 start = $0.801** |
| Prefill example (2 pages) | **$0.017** |

Blocked, login-walled and failed pages are **not** charged.

### For AI agents (Apify MCP)

**Purpose:** Fetch public web pages the user already identified and extract a structured JSON object per URL from visible text. Use this as a small AI web scraper when the user wants to extract structured data from any website without writing selectors.

**Call when:** The user provides public http(s) URLs and a list of fields (or a JSON Schema). Do not use it to log into sites, bypass paywalls, or collect personal data about private people.

**Inputs:** `urls` (array of http(s) URLs). Either `fields` as `[{name, instruction, type, options?}]` with type = text, enum, number, boolean or list, or `jsonSchema` (object schema). Optional: `extraInstructions`, `maxPages` (default 20), `requestDelayMs` (default 1000).

**Output fields:** Always `url`, `finalUrl`, `status`, `httpStatus`, `fetchedAt`. On `status: "ok"`, also every requested field. A `RUN_SUMMARY` key-value record has counts and token usage.

**Cost:** $0.008 × successful pages + $0.001 start.

### What it will not do

- It does not log in, fill forms, solve CAPTCHAs or bypass paywalls.
- It does not run a headless browser, so pages that are empty without JavaScript return `too-little-content`.
- It does not crawl a whole site — only the URLs you list (up to `maxPages`).
- It does not call other Apify Store Actors.
- **Do not use it to collect personal data** about private individuals (names, personal emails, phone numbers, home addresses, government IDs). Those values are instructed to be returned as null. You are responsible for having the right to process the pages you submit.

### Tips

- Test field instructions on 1–2 URLs (`maxPages`) before a large batch.
- Be specific: "The price as shown, including the currency symbol" beats "price".
- Use `enum` or `boolean` when you need consistent labels.
- If robots.txt disallows a path, the item is returned with `blocked-by-robots-txt` and is not charged.
- LLM output can be wrong — spot-check important fields.

### Is it legal? Data & privacy

The Actor only requests **public URLs you provide**, with a clearly identified crawler User-Agent, and honors **robots.txt** (including Crawl-delay when present). It skips obvious login walls. Page text is sent to the **OpenAI API** for extraction; OpenAI does not train on API data by default. Do not submit pages you are not allowed to access or process, and do not use the output to build personal-data databases.

### More AI tools from DataTools AI

- [AI Table Enricher](https://apify.com/datatools-ai/ai-table-enricher) – add AI columns (classify, extract, summarize, translate) to a CSV, Sheet or dataset you already have.
- [Review Insights AI](https://apify.com/datatools-ai/review-insights-ai) – AI analysis of reviews you already have: sentiment, complaints, praise and reply templates.
- [App Store Official Feeds](https://apify.com/datatools-ai/app-store-official-feeds) – iOS app details, recent reviews and top charts from Apple's official feeds, with no HTML scraping.
- [Career Site Jobs API + AI Hiring Signals](https://apify.com/datatools-ai/career-site-jobs-hiring-signals) – official ATS APIs (Greenhouse, Lever, Ashby and more) plus AI hiring-signals summaries.
- [AI Ad Strategy Report from Meta Ad Library Ads](https://apify.com/datatools-ai/ad-library-ai-strategy-report) – AI strategy report from Meta Ad Library ads you provide (hooks, offers, 5 ideas).
- [Company Profile from Domain](https://apify.com/datatools-ai/company-profile-from-domain) – structured firmographics from a company's own public website (industry, products, HQ, socials and tech stack).

***

### 🇪🇸 En español

**Extractor de datos web con IA, sin código.** Pega las URLs públicas y describe en español o inglés los campos que quieres (título, precio, categoría, valoración, stock, listas, booleanos…). Convierte páginas web públicas en JSON estructurado. Respeta robots.txt, no inicia sesión y **no está pensado para recoger datos personales de particulares**. **$0.008 por página extraída con éxito** + $0.001 de arranque (100 páginas = **$0.80**). Las páginas bloqueadas o con muro de login no se cobran.

# Actor input Schema

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

http(s) URLs of public pages to extract structured data from. Example: \["https://books.toscrape.com/", "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"]. Do not send login-only pages, and do not use this Actor to collect personal data about private individuals. One output item is written per URL.

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

One object per field to extract, described in plain language: {"name":"price","instruction":"Product price including currency, or null","type":"text|enum|number|boolean|list","options":\["A","B"]}. 'options' is only for type enum. 'list' returns an array of strings. Use this or jsonSchema (fields wins if both are set).

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

Optional alternative to fields. A JSON Schema for one object (type: object, with named properties). Used only if fields is empty. Property names must be simple identifiers and cannot be url, status, finalUrl, httpStatus, fetchedAt, error, note or contentType.

## `extraInstructions` (type: `string`):

Global rules applied to every page, e.g. 'Answer in Spanish' or 'Prices should include the currency symbol'.

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

Cap on URLs processed (and potentially charged) in one run. Default 20. Use a small number while testing your field instructions.

## `requestDelayMs` (type: `integer`):

Polite delay between HTTP requests to the same origin. Also respects Crawl-delay in robots.txt when it is larger. Default 1000 ms.

## `concurrency` (type: `integer`):

How many pages are processed at once (each origin is still rate-limited). Keep this low to stay polite. Default 2.

## `maxTextChars` (type: `integer`):

Characters of visible text kept after HTML is stripped. Long pages are truncated to protect cost and latency. Default 12,000.

## `model` (type: `string`):

OpenAI model used for extraction. GPT-4o mini is the default and is included in the per-page price. The price per extracted page is the same for either option.

## Actor input object example

```json
{
  "urls": [
    "https://books.toscrape.com/",
    "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
  ],
  "fields": [
    {
      "name": "title",
      "instruction": "The main page or product title (full text, not truncated).",
      "type": "text"
    },
    {
      "name": "description",
      "instruction": "The unique product or page description, written once, without a trailing '...more'. Null if none is given.",
      "type": "text"
    },
    {
      "name": "price",
      "instruction": "Product price including the currency symbol as shown on the page. Null if this is not a product page.",
      "type": "text"
    },
    {
      "name": "category",
      "instruction": "Product category or section name, if shown.",
      "type": "text"
    },
    {
      "name": "rating",
      "instruction": "Star rating as a number from 1 to 5 if shown (for example 'star rating: 3/5' means 3). Null if this is not a product page or no rating is shown.",
      "type": "number"
    },
    {
      "name": "in_stock",
      "instruction": "True if the product is in stock, false if out of stock, null if this is not a product page.",
      "type": "boolean"
    },
    {
      "name": "stock_count",
      "instruction": "The number of items available in stock if a count is shown (for example 'In stock (22 available)' means 22). Null if not shown or not a product page.",
      "type": "number"
    },
    {
      "name": "listed_items",
      "instruction": "Up to 8 full product titles from a catalog or listing page. Use the complete title (for example from each product link's title attribute), never a truncated label that ends with an ellipsis. Empty list if this is a single product page.",
      "type": "list"
    }
  ],
  "maxPages": 20,
  "requestDelayMs": 1000,
  "concurrency": 2,
  "maxTextChars": 12000,
  "model": "gpt-4o-mini"
}
```

# Actor output Schema

## `pages` (type: `string`):

One item per URL, with status and the requested fields when extraction succeeded.

## `runSummary` (type: `string`):

JSON with pages processed, charged, skipped, model and token usage.

# 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/",
        "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
    ],
    "fields": [
        {
            "name": "title",
            "instruction": "The main page or product title (full text, not truncated).",
            "type": "text"
        },
        {
            "name": "description",
            "instruction": "The unique product or page description, written once, without a trailing '...more'. Null if none is given.",
            "type": "text"
        },
        {
            "name": "price",
            "instruction": "Product price including the currency symbol as shown on the page. Null if this is not a product page.",
            "type": "text"
        },
        {
            "name": "category",
            "instruction": "Product category or section name, if shown.",
            "type": "text"
        },
        {
            "name": "rating",
            "instruction": "Star rating as a number from 1 to 5 if shown (for example 'star rating: 3/5' means 3). Null if this is not a product page or no rating is shown.",
            "type": "number"
        },
        {
            "name": "in_stock",
            "instruction": "True if the product is in stock, false if out of stock, null if this is not a product page.",
            "type": "boolean"
        },
        {
            "name": "stock_count",
            "instruction": "The number of items available in stock if a count is shown (for example 'In stock (22 available)' means 22). Null if not shown or not a product page.",
            "type": "number"
        },
        {
            "name": "listed_items",
            "instruction": "Up to 8 full product titles from a catalog or listing page. Use the complete title (for example from each product link's title attribute), never a truncated label that ends with an ellipsis. Empty list if this is a single product page.",
            "type": "list"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datatools-ai/ai-web-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": [
        "https://books.toscrape.com/",
        "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
    ],
    "fields": [
        {
            "name": "title",
            "instruction": "The main page or product title (full text, not truncated).",
            "type": "text",
        },
        {
            "name": "description",
            "instruction": "The unique product or page description, written once, without a trailing '...more'. Null if none is given.",
            "type": "text",
        },
        {
            "name": "price",
            "instruction": "Product price including the currency symbol as shown on the page. Null if this is not a product page.",
            "type": "text",
        },
        {
            "name": "category",
            "instruction": "Product category or section name, if shown.",
            "type": "text",
        },
        {
            "name": "rating",
            "instruction": "Star rating as a number from 1 to 5 if shown (for example 'star rating: 3/5' means 3). Null if this is not a product page or no rating is shown.",
            "type": "number",
        },
        {
            "name": "in_stock",
            "instruction": "True if the product is in stock, false if out of stock, null if this is not a product page.",
            "type": "boolean",
        },
        {
            "name": "stock_count",
            "instruction": "The number of items available in stock if a count is shown (for example 'In stock (22 available)' means 22). Null if not shown or not a product page.",
            "type": "number",
        },
        {
            "name": "listed_items",
            "instruction": "Up to 8 full product titles from a catalog or listing page. Use the complete title (for example from each product link's title attribute), never a truncated label that ends with an ellipsis. Empty list if this is a single product page.",
            "type": "list",
        },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("datatools-ai/ai-web-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": [
    "https://books.toscrape.com/",
    "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html"
  ],
  "fields": [
    {
      "name": "title",
      "instruction": "The main page or product title (full text, not truncated).",
      "type": "text"
    },
    {
      "name": "description",
      "instruction": "The unique product or page description, written once, without a trailing '\''...more'\''. Null if none is given.",
      "type": "text"
    },
    {
      "name": "price",
      "instruction": "Product price including the currency symbol as shown on the page. Null if this is not a product page.",
      "type": "text"
    },
    {
      "name": "category",
      "instruction": "Product category or section name, if shown.",
      "type": "text"
    },
    {
      "name": "rating",
      "instruction": "Star rating as a number from 1 to 5 if shown (for example '\''star rating: 3/5'\'' means 3). Null if this is not a product page or no rating is shown.",
      "type": "number"
    },
    {
      "name": "in_stock",
      "instruction": "True if the product is in stock, false if out of stock, null if this is not a product page.",
      "type": "boolean"
    },
    {
      "name": "stock_count",
      "instruction": "The number of items available in stock if a count is shown (for example '\''In stock (22 available)'\'' means 22). Null if not shown or not a product page.",
      "type": "number"
    },
    {
      "name": "listed_items",
      "instruction": "Up to 8 full product titles from a catalog or listing page. Use the complete title (for example from each product link'\''s title attribute), never a truncated label that ends with an ellipsis. Empty list if this is a single product page.",
      "type": "list"
    }
  ]
}' |
apify call datatools-ai/ai-web-data-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datatools-ai/ai-web-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/CDLZG24vsoSQkFQfn/builds/UNaMu523UCVe4wGMw/openapi.json
