Schema-Guided Extraction: Getting the Same Shape Every Time
By NextRows Team · · 2 min read

Language models are good at reading messy text. They are less good at being consistent. Ask the same question twice and field names, ordering, or number formats can drift. If the output feeds a spreadsheet or a database, drift is a bug.
NextRows addresses this with schema-guided extraction.
How it works
An extract request accepts an optional schema field containing a JSON schema. The extraction step runs through a model provider layer built on the Vercel AI SDK, and the schema tells the model what shape the answer must take. The schema describes the extracted data itself, and the result comes back in the data field of the response. If you leave the schema out, the system can generate one from your prompt.
A small example
Say you want product listings as rows with a name, a price, and an availability flag:
{
"type": "object",
"properties": {
"products": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"price": { "type": "number" },
"in_stock": { "type": "boolean" }
},
"required": ["name", "price"]
}
}
},
"required": ["products"]
}With this schema, price is a number rather than a string like "$99.99", and in_stock is a boolean rather than the words "Available" or "Sold out". Downstream code can rely on that.
When to pass a schema
- Recurring jobs. If you run the same extraction every day, fix the schema so columns never change.
- Feeding other systems. Databases and spreadsheets want stable types.
- Combining sources. When several pages feed one table, a shared schema keeps rows comparable.
When to skip it
For one-off exploration, let the system generate a schema. Look at what it produced, then copy the useful parts into your own schema for later runs.
Tips for writing schemas
- Mark only truly required fields as required, so a missing value does not fail the whole row.
- Use specific types such as
numberandbooleanwhere you can. - Keep names short and descriptive. The model reads them as hints.
Schema-guided output is one of the reasons the same prompt can be reused across many pages without hand-cleaning the results.
Want Clean Tables With Zero Stress?
NextRows makes scraping and cleaning data simple. Our powerful AI Agent helps you save hours every week on repetitive tasks.
No credit card required • Free trial available
Related articles
October Killed the Chatbot: AI Stopped Answering and Started Operating
GPT-6 reached every tier, with an interface that builds itself around your task, the ChatGPT Chrome extension started reading your tabs, and Gemini became a universal agent across Google products. October 2026, revisited.

From URL to Table: How a NextRows Extract Request Works
A walk through the five stages behind every extraction: input, render, normalize, extract, and deliver.
Agents Logged Into Your Life: September's Big Three Went Personal
Meta shipped a consumer agent that acts across apps, OpenAI put a Data agent inside ChatGPT and launched always-on agents at DevDay, and Siri AI began an opt-in beta rollout on eligible devices. September 2026, revisited.