URL to Structured Rows - LLM Extraction with Your JSON Schema avatar

URL to Structured Rows - LLM Extraction with Your JSON Schema

Pricing

$2.00 / 1,000 valid rows

Go to Apify Store
URL to Structured Rows - LLM Extraction with Your JSON Schema

URL to Structured Rows - LLM Extraction with Your JSON Schema

Give a list of URLs and a JSON Schema. Get one schema-valid row per URL, filled by an LLM (your own Claude, Gemini or OpenAI key) from the page text. Off-schema output is never returned and never charged.

Pricing

$2.00 / 1,000 valid rows

Rating

0.0

(0)

Developer

Omar Nassar

Omar Nassar

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

14 days ago

Last modified

Categories

Features

Limited permissions

Share

URL to Structured Rows: LLM Extraction with Your JSON Schema

Give a list of URLs and a JSON Schema. The actor returns one row per URL that is valid against your schema. An LLM fills the schema from the page text, with your own Claude, Gemini or OpenAI API key.

How it works

  1. The actor fetches each URL with a plain HTTP request. It does not use a browser.
  2. It extracts the visible text and any JSON-LD structured data (schema.org Product, Person, Organization).
  3. It sends the text, your schema and your instructions to the model. The model uses constrained JSON output where the provider supports it.
  4. It validates the answer against your full schema with Ajv (draft-07 or 2020-12, formats included).
  5. If the answer is not valid, the actor asks the model once more and tells it what failed.
  6. If the second answer is also not valid, the row is dropped. Off-schema data is never returned and never charged.

Input

{
"urls": [
"https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
"https://www.scrapingcourse.com/ecommerce/product/abominable-hoodie/"
],
"schema": {
"type": "object",
"properties": {
"name": { "type": "string" },
"price": { "type": "number", "minimum": 0 },
"currency": { "type": "string", "pattern": "^[A-Z]{3}$" },
"sku": { "type": ["string", "null"] },
"in_stock": { "type": "boolean" }
},
"required": ["name", "price", "currency", "sku", "in_stock"]
},
"instructions": "price is the main selling price. currency is the ISO 4217 code.",
"provider": "anthropic",
"apiKey": "<your Anthropic API key>"
}
FieldRequiredDescription
urlsyesPage URLs. One row per URL. Duplicates are removed. Up to 5,000 per run.
schemayesJSON Schema for one row.
apiKeyyesYour own API key for provider. Secret input, stored encrypted by Apify.
instructionsnoPlain-language instructions for the model.
providernoanthropic (default), gemini or openai.
modelnoModel ID. Defaults: claude-haiku-5-5, gemini-2.5-flash-lite, gpt-4.1-mini.
maxCharsnoPage text is cut at this length (default 30,000). Lower means fewer tokens.
concurrencynoURLs in parallel (default 5, max 20).

Output

This row is from the local test run, where the model was mocked:

{
"url": "https://sandbox.oxylabs.io/products/1",
"data": {
"name": "The Legend of Zelda: Ocarina of Time",
"price": 91.99,
"currency": "EUR",
"sku": null,
"in_stock": true
},
"final_url": "https://sandbox.oxylabs.io/products/1",
"title": "The Legend of Zelda: Ocarina of Time | Oxylabs Scraping Sandbox",
"text_chars": 2019,
"truncated": false,
"model": "mock/mock",
"attempts": 2,
"tokens": { "input": 1810, "output": 55 },
"error": null,
"checked_at": "2026-11-09T20:29:59.659Z"
}

data always matches your schema. tokens shows what your provider bills for the row, including the retry.

Failed URLs are returned with error set and are not charged. Causes: HTTP 4xx or 5xx, timeout, a page with almost no text in its HTML (rendered by JavaScript), or model output that failed the schema twice.

Pricing

$0.002 per valid row (pay per event row). Failed and dropped rows are not charged.

Your model provider bills you for tokens directly. A typical page (about 6,000 characters of text) costs about $0.0005 with claude-haiku-5-5 and about $0.0003 with gemini-2.5-flash-lite.

A hosted-key option, where you do not need your own model key, can come later at a higher per-row price.

Limits

  • No browser. Pages that render their content with JavaScript and have no JSON-LD fail with an error and are not charged.
  • Each URL has a hard timeout of 180 seconds.
  • Provider-side constrained decoding does not support every JSON Schema keyword (for example minimum, pattern, minItems). The actor removes those keywords from the copy sent to the provider. Ajv still enforces them on the answer.
  • Page text is untrusted. The model is told to treat it as data and to ignore instructions inside it.
  • The actor stops starting new URLs when your Max cost per run is reached.

Local test

bash test/mock-test.sh runs both test inputs with real page fetches, real schema validation, pay-per-event test mode and a mocked model (test/mock-replies.json, enabled by the URL_ROWS_MOCK environment variable). scripts/test-all.sh needs a real key in test/input.json for this actor.