# AI Data Extractor: web page or PDF to JSON by your schema (`ochinimus/ai-data-extractor`) Actor

Give a URL and the fields you want, get structured JSON from any web page or PDF with AI. A field the page does not state comes back null, never invented. Up to 20 fields: text, number, true/false, date or list.

- **URL**: https://apify.com/ochinimus/ai-data-extractor.md
- **Developed by:** [ochinimus](https://apify.com/ochinimus) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 extracted pages

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 Data Extractor: web page or PDF to JSON by your schema

**Extract structured data from any web page or PDF with AI. You name the fields you want; you get one clean JSON object per URL. A field the page does not state comes back as `null`, never as a guess.**

Paste public page or PDF links and a small schema such as `{"price": "number", "in_stock": "boolean"}`. The actor fetches each document once, has a language model read it, and returns exactly those fields. No browser to run, no selectors to maintain, no prompt to write: the schema is the prompt.

### What you get, per URL

- **data:** one entry for every field in your schema, in your order: the value the page states, or `null` when it does not.
- **fields_found** and **fields_requested**, **null_fields** (which fields the page does not state) and **verbatim_fields** (which values were found word for word in the text).
- **kind** (`html` or `pdf`), **page_title**, **url** (what you supplied) and **final_url** (after redirects).
- **truncated** and **pct_read:** a long document is read up to about 20,000 tokens (roughly 70,000 characters); `truncated: true` and the share read tell you when only the first part was seen.
- **source** and **fetched_at**.

### Fields and types

| Type | Returns |
|---|---|
| `string` | text |
| `number` | a number, such as a price or a year |
| `boolean` | true or false |
| `date` | a date as `YYYY-MM-DD` |
| `string[]` | a list of text values, such as authors or tags |

One schema per run, 1 to 20 fields, the same for every URL.

### Use cases

- Pull the same facts (name, price, contact, date) from a list of product, company or news pages without writing selectors.
- Extract title, authors, abstract and year from a list of paper or report PDFs.
- Turn filings, spec sheets or invoices published as PDF into rows for a spreadsheet or a database.
- Give an AI agent a dependable way to read one page into typed fields.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `urls` | array of strings | prefill: the Solana article on Wikipedia | Public http or https links to web pages or PDFs (up to 50). |
| `schema` | object | prefill: five fields for that article | Field names mapped to `string`, `number`, `boolean`, `date` or `string[]`, 1 to 20 fields. |

With no input at all, the actor runs that example page and schema, so the default run always returns data. If you give URLs without a schema, a schema without URLs, or an invalid schema, the run stops with a clear message before any request is made, and nothing is charged.

### How to run it

**In the Apify Console:** open the Actor, paste your links into the Input tab, edit the schema and click Start. The dataset has an **Overview** table (one row per URL, with the extracted data) and exports as JSON, CSV or Excel.

**Through the API:** one request starts a run and returns the items (replace `YOUR_API_TOKEN` with your Apify API token):

```bash
curl -X POST "https://api.apify.com/v2/acts/ochinimus~ai-data-extractor/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://bitcoin.org/bitcoin.pdf"], "schema": {"title": "string", "author": "string", "abstract": "string"}}'
```

The answer is a JSON array with one item per URL that returned at least one of your fields.

### Sample output

A real result for the default input (the Solana article on Wikipedia), captured live on 15 Oct 2026:

```json
{
  "url": "https://en.wikipedia.org/wiki/Solana_(blockchain_platform)",
  "final_url": "https://en.wikipedia.org/wiki/Solana_(blockchain_platform)",
  "kind": "html",
  "page_title": "Solana (blockchain platform)",
  "data": {
    "name": "Solana",
    "original_author": "Anatoly Yakovenko, Raj Gokal",
    "initial_release_year": 2020,
    "consensus_mechanism": "proof-of-stake",
    "native_token": "SOL"
  },
  "fields_requested": 5,
  "fields_found": 5,
  "null_fields": [],
  "verbatim_fields": [
    "name",
    "original_author",
    "consensus_mechanism",
    "native_token"
  ],
  "truncated": false,
  "pct_read": 100,
  "source": "AgentFeed, page or PDF fetched once from the URL you supplied",
  "fetched_at": "2026-10-15T09:58:50.000Z"
}
```

### Pricing

Pay per event: **$0.02 per page or PDF extracted** (event `extracted-page`), plus Apify's tiny per-run start fee.

You are charged only for a URL that returns at least one of your fields. A link that cannot be fetched, a site whose robots.txt forbids it, a private or blocked address, a file that is not a web page or a PDF, a document over 10 MB, a page that states none of your fields, and any data-source error return nothing and cost nothing. A schema that is invalid stops the run before any request.

### Data source and its limits

- **Source: AgentFeed, our own data service.** It fetches the one URL you supply, once, on your request, and has a language model (currently Gemini 3.1 Flash-Lite) read it against your schema. The document is not stored.
- **One URL, one result.** It reads the page you give it and does not crawl links or follow pagination.
- **Plain fetch, no browser.** Only http and https links on ports 80 and 443 are fetched, redirects are followed, as HTML or PDF. Content a site builds only with JavaScript after the page loads may be missing, and pages behind a login or a bot wall cannot be read.
- **Up to 10 MB per document, and about the first 20,000 tokens are read.** `truncated` and `pct_read` say how much.
- **robots.txt is honoured.** If the site forbids automated fetching, the link returns nothing.
- **Private, local and reserved addresses are refused.**
- **A model reads the page, so check the values that matter.** `verbatim_fields` lists the values found word for word in the text; a value you need exact should be one of them, or checked against the page.
- The content belongs to its publisher, and you are responsible for how you use it.

### Source code

[github.com/seekdaseek/agentfeed-apify/tree/main/ai-data-extractor](https://github.com/seekdaseek/agentfeed-apify/tree/main/ai-data-extractor) (MIT).

# Actor input Schema

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

Links to the web pages or PDFs to read, one per line (up to 50). Each must be a public http or https URL (ports 80 and 443) that serves a web page or a PDF of at most 10 MB, on a site whose robots.txt allows automated fetching. Every page that yields at least one of your fields is one result. A link that cannot be fetched, or a page that states none of your fields, returns nothing and is not charged.

## `schema` (type: `object`):

A JSON object that names each field you want and its type: string, number, boolean, date or string\[] (a list of text). 1 to 20 fields, the same for every URL. A value the page does not state comes back as null, never as a guess.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Solana_(blockchain_platform)"
  ],
  "schema": {
    "name": "string",
    "original_author": "string",
    "initial_release_year": "number",
    "consensus_mechanism": "string",
    "native_token": "string"
  }
}
```

# 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 = {
    "urls": [
        "https://en.wikipedia.org/wiki/Solana_(blockchain_platform)"
    ],
    "schema": {
        "name": "string",
        "original_author": "string",
        "initial_release_year": "number",
        "consensus_mechanism": "string",
        "native_token": "string"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ochinimus/ai-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://en.wikipedia.org/wiki/Solana_(blockchain_platform)"],
    "schema": {
        "name": "string",
        "original_author": "string",
        "initial_release_year": "number",
        "consensus_mechanism": "string",
        "native_token": "string",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("ochinimus/ai-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://en.wikipedia.org/wiki/Solana_(blockchain_platform)"
  ],
  "schema": {
    "name": "string",
    "original_author": "string",
    "initial_release_year": "number",
    "consensus_mechanism": "string",
    "native_token": "string"
  }
}' |
apify call ochinimus/ai-data-extractor --silent --output-dataset

```

## MCP server setup

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