Describe the data. Get JSON back.
AI extraction reads a page with a language model and returns JSON that matches the JSON Schema you send. Use it on pages without structured data, or when you want your own shape instead of ours.
What it does
Describe the data with a JSON Schema or a prompt and get JSON that matches.
Your schema, enforced
Send a JSON Schema and the answer is validated against it. Invalid output is repaired once; if it still does not match, you get
extraction_failed, not bad data.Or just ask
A
promptalone works too, for exploring a page. Add a schema when you know the shape you need.A URL or your own HTML
Pass
urland Siftzo fetches the page with the Scraper API's proxies and rendering, or passhtmlyou already have and pay no scrape.Structured data first
The page's JSON-LD is put in front of its content, because shops and publishers often state the exact values there.
Page text is data, not instructions
The page goes to the model as untrusted content. Instructions written into a page are not followed.
Transparent usage
Every answer has the input and output tokens in
usageand the split between scrape and model credits incredits_detail.
Example
One HTTP call
POST a URL with a schema, a prompt or both. Extraction is synchronous: the call returns when the data is ready.
Official SDKs are coming soon. Until then, any HTTP client works.
AI extraction docscurl https://api.siftzo.com/v1/extract \
-H "X-API-Key: $SIFTZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
"prompt": "The book on this page. Price as a number without currency.",
"schema": {
"type": "object",
"properties": {
"title": { "type": "string" },
"price": { "type": "number" },
"in_stock": { "type": "boolean" }
},
"required": ["title", "price", "in_stock"]
}
}'type Book = { title: string; price: number; in_stock: boolean };
const res = await fetch("https://api.siftzo.com/v1/extract", {
method: "POST",
headers: {
"X-API-Key": process.env.SIFTZO_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
prompt: "The book on this page. Price as a number without currency.",
schema: {
type: "object",
properties: {
title: { type: "string" },
price: { type: "number" },
in_stock: { type: "boolean" },
},
required: ["title", "price", "in_stock"],
},
}),
signal: AbortSignal.timeout(120_000),
});
const result = await res.json();
if (!res.ok) throw new Error(result.error.code);
const book = result.data as Book;
console.log(book.title, book.price, result.credits);import os
import requests
res = requests.post(
"https://api.siftzo.com/v1/extract",
headers={"X-API-Key": os.environ["SIFTZO_API_KEY"]},
json={
"url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
"prompt": "The book on this page. Price as a number without currency.",
"schema": {
"type": "object",
"properties": {
"title": {"type": "string"},
"price": {"type": "number"},
"in_stock": {"type": "boolean"},
},
"required": ["title", "price", "in_stock"],
},
},
timeout=120,
)
result = res.json()
res.raise_for_status()
print(result["data"], result["credits_detail"])Reference
Key parameters
url | htmlstringrequired- Exactly one: a page to fetch, or raw HTML (no scrape, request body up to 2 MB).
schemaJSON Schema- The root must be
"type": "object". At most 16 KB, 5 levels and 100 properties. promptstring- 1–4,000 characters. At least one of schema and prompt is required.
render, country, wait_for- As for the Scraper API, with url only.
timeout_msintegerdefault30000- 5,000–50,000 for the scrape. The model has its own time budget.
Every parameter and response field is in the AI extraction docs.
Credits
What it costs
| Request | Credits |
|---|---|
| AI extraction | scrape credits + LLM tokens: ⌈(input × 2 + output × 10) / 300⌉ with the default model |
| HTTP request (render=never) | 1 |
| Browser request (render=always, or auto when needed) | 10 |
If the model cannot produce valid JSON, the request fails with extraction_failed and only the scrape is billed. See AI extraction credits.
Questions
When should I use AI extraction instead of the Data API?
Use the Data API for products, articles and metadata on pages with structured data: it is deterministic and costs only the scrape. Use AI extraction for other kinds of data, pages without structured data, or when you need your own fields.
Which JSON Schema features are supported?
Types, properties, required, items, enum, const, anyOf, descriptions, common formats, number and length limits, patterns and additionalProperties: false. $ref, oneOf and conditionals are refused with a clear error. See the docs.
What happens with very long pages?
The page is converted to compact Markdown and cut to fit the model's input. When that happens the answer has content_truncated: true.
Where does the processing happen?
The scrape runs in the EU like every Siftzo request. See the trust center for the subprocessors involved.
More from Siftzo
- Scraper APIAny public page as HTML or Markdown, with proxies, rendering and retries handled.
- SERP APIGoogle, Bing and DuckDuckGo results as structured JSON.
- Browser APIA fresh cloud Chrome for your Playwright or Puppeteer code, over CDP.
- Crawl APIFollow the links of a site up to 10,000 pages, always within robots.txt.
- Data APIProducts, articles and page metadata as records with fixed fields.
- Proxy accessSiftzo's residential network in your own client, billed per MB.
Try the AI extraction for free
Create an account, copy your key and send a request. No card needed for the Free plan.