ForHosting KIT · Web Scraping & Monitoring

Scrape to a schema

Define the exact shape you need, with required details, value types and nested lists, and get page data checked against it before delivery: a product comes back with each variant's price and size in place. Built for data that feeds a database. You pay per use, with no subscription.

● StablePer request + per URL$0.046
Use it from WebAPIEmailTelegramApp soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

give a JSON Schema, get valid data

When scraped data has to fit a system

A quick one-off extraction can live with loose results. The moment scraped data starts feeding a database column, an import job or another program, it cannot. A price that arrives as text when the database expects a number, or a detail that is missing when the code assumes it exists, is the kind of fault that only shows up much later, far from where it started. Here you describe the exact shape you need before anything is read: which details are required, what kind of value each one is, which values are allowed and how groups nest inside each other.

Checked before it reaches you

The page is fetched and read with that structure as the target, and the result is checked against the very same structure before it is delivered. What lands in your system matches the contract you wrote, not something close to it, so a malformed result is stopped at the extraction step rather than discovered inside your database. Nested data works in one pass: a product with a list of variants, each with its own price and size, comes back as a complete tree that has already been checked. You can also add an extra instruction to guide how the page is read.

Extracting nested, multi-level data

Pull a product with a nested array of variants, each with its own price and size, in one call that returns the whole tree already validated.

Is there a free version of the structured web scraping api?

There's no free tier — free tiers get abused and slow everyone down. No subscription, no tokens, no invented credits, and a failed task is never charged.

Why define the structure in advance instead of describing the data in words?

Because once scraped data feeds a database or another program, a value in the wrong form or a missing detail breaks things later. A fixed structure lets the extraction itself catch that, since every result is checked against it before delivery.

Can it extract nested data, such as a product with several variants?

Yes. Describe a product with a list of variants, each with its own price and size, and the whole tree comes back in one pass, already checked against the structure you wrote.

What can I set in the structure?

Which details are required, what kind of value each one must be, such as text or a whole number, which values are allowed from a fixed list, and how groups of details nest inside each other.

Is every result guaranteed to match my structure?

Yes. The result is checked against the same structure you supplied before it is delivered, so what reaches you matches the contract you wrote rather than something close to it. A malformed result is caught at this step, not inside your system.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/web/scrape-schema

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/web/scrape-schema \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
{
  "url": "https://example.com"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "web.scrape_schema",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.046
Per URL$0.0145

Published price — no tokens, no invented credits. A failed task is never charged.

timeout_sec30
max_crawl_pages25
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
422task_failedThe task failed after 3 retries. You are never charged for it.

You supply a JSON Schema describing exactly the shape you need — required fields, types, enums, nested objects — and the page gets read against that contract instead of a loose wish-list. It's built for the moment scraped data stops being a one-off pull and starts feeding a database column, an API response or a downstream system that will reject anything malformed.

For data that has to be right, not just present

A field coming back as a string when your database expects an integer, or missing entirely when your code assumes it exists, is the kind of bug that surfaces three deployments later at 2am. This endpoint is for teams who have already been burned by that and want the extraction step itself to enforce the contract, catching a malformed result before it ever reaches their system rather than after.

How the schema shapes the extraction

You call POST /web/scrape-schema with a URL and a JSON Schema object — the standard kind, with types, required arrays, enum constraints and nested properties — and the task_id returns immediately. Internally, the page is fetched and read, and the extraction is driven to fill exactly the structure your schema defines; the result is validated against that same schema before it's ever delivered, so what lands in your webhook is guaranteed to match the contract you wrote, not merely close to it.

JSON Schema: a spec built for exactly this handshake

JSON Schema has been the de facto way to describe and validate the shape of JSON since the mid-2010s, adopted across API tooling, form generators and validators precisely because it lets two systems that have never met agree on a contract without either one guessing. Using it here means the schema you already maintain for your database or API can be reused as-is to drive extraction, instead of writing a second, informal description of the same fields.

What a validated result looks like, and what happens on a mismatch

If the source page truly cannot supply a required field, extraction is retried automatically up to three times against fresh reads before the task returns a clear error explaining what couldn't be satisfied, and a task that never validates is never billed. A successful task returns data that satisfies your schema outright — correct types, all required fields present, enum values honored.

Fitting a strict contract into a larger system

This endpoint pairs naturally with pipelines where the extracted JSON is inserted straight into a typed database table, forwarded to another API with its own validation, or consumed by strongly-typed application code — anywhere a loosely-shaped result would either crash downstream or need a manual cleanup pass. Compared to describing fields in plain language, writing the schema once up front trades a little setup time for extraction results you can trust without a second look.

Populating a typed database table

Define a schema matching your products table's columns exactly, and insert the validated JSON without a transformation step in between.

Feeding a downstream API with its own validation

Extract data pre-shaped to match a partner API's required payload, avoiding rejected requests caused by type mismatches.

Enforcing enums on categorical fields

Constrain a status field to a fixed set of values like in_stock, low_stock or out_of_stock so the extraction can never return an unexpected string.

What is JSON Schema and why does this endpoint need it?

JSON Schema is a standard way to describe the shape, types and constraints of JSON data; supplying one here lets the extraction be validated against it before delivery instead of trusting a loose guess.

How much does web.scrape_schema cost?

$0.046 per request plus $0.0145 per URL, billed only when the task returns data that actually validates against your schema.

What happens if the page can't satisfy a required field?

Extraction retries automatically up to three times, and if it still can't satisfy the schema you get a clear error instead of a partial or malformed result, with no charge for that task.

Can I reuse the same schema I use for my database or API?

Yes, any standard JSON Schema works, so the contract you already maintain elsewhere can be reused directly to drive extraction.

Does it support nested objects and arrays in the schema?

Yes, nested objects, arrays and enum constraints are all supported, which is where this endpoint outperforms a flat selector map.

How is this different from scrape_ai?

scrape_ai accepts a plain-language description of fields; scrape_schema requires and enforces a formal JSON Schema, guaranteeing types and required fields rather than approximating them.

How do I get the results?

By signed webhook when the task completes, or via a signed link valid for 24 hours if you'd rather retrieve it yourself.

Read the full KIT documentation →