AI extractionPOST /v1/extract

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 prompt alone works too, for exploring a page. Add a schema when you know the shape you need.

  • A URL or your own HTML

    Pass url and Siftzo fetches the page with the Scraper API's proxies and rendering, or pass html you 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 usage and the split between scrape and model credits in credits_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 docs
curl 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"]
    }
  }'

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_msintegerdefault 30000
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

AI extraction credits
RequestCredits
AI extractionscrape 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.

See plans

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.

Try the AI extraction for free

Create an account, copy your key and send a request. No card needed for the Free plan.