Kansoku
English日本語简体中文

Quickstart

Create a key, extract one page, read the result. The last step shows you how to check the number you just received. Currently early access.

Early access. The API is opened to people who ask for it, one at a time; public sign-up is not open yet. The commands on this page work once we have issued you a key — run them today and they will not. We say so plainly because otherwise a failing command reads as your mistake rather than our door being shut. Get in touch if you want in.

1. Get a key

Create one in the console. It is shown once and stored only as a hash — if you lose it, issue another rather than asking us to recover it, because we cannot.

Test keys begin wi_test_ and live keys wi_live_. Test-mode usage is metered but never billed, so an integration can be exercised properly before anything costs money.

2. Extract a page

curl -X POST https://api.kansoku.ai/v1/extract \
  -H "Authorization: Bearer $WI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/category/cameras",
    "country": "JP",
    "levels": ["css", "structured_data"],
    "schema": {
      "listings": {
        "type": "list",
        "item": { "name": "string", "price": "number", "currency": "string" }
      }
    }
  }'

levels is the ladder, cheapest first. Leaving out llm is how you guarantee a request costs nothing in model tokens — most commerce pages never need it.

3. Or use the SDK

import { WebIntelligence } from "@wi/sdk";

const wi = new WebIntelligence({ apiKey: process.env.WI_API_KEY! });

const { data, metadata } = await wi.extract.run({
  url: "https://example.com/category/cameras",
  country: "JP",
  levels: ["css", "structured_data"],
  schema: {
    listings: {
      type: "list",
      item: { name: "string", price: "number", currency: "string" },
    },
  } as const,
});

The as const matters: it is what makes data.listings typed as a list of records instead of unknown.

4. Read the record

{
  "data": { "listings": [ { "name": "…", "price": 1444300, "currency": "JPY" } ] },
  "metadata": {
    "country": "JP",
    "retrieved_at": "2026-08-21T02:20:04.756Z",
    "request_id": "req_…",
    "level": "structured_data",
    "attempts": [
      { "level": "css", "matched_fields": 0, "duration_ms": 5, "error": null },
      { "level": "structured_data", "matched_fields": 1, "duration_ms": 12, "error": null }
    ],
    "http_status": 200,
    "duration_ms": 1436
  }
}

attempts is worth reading even when the call succeeds. A page that used to be satisfied by css and now falls through to structured_data has been redesigned, and the day it stops matching either is the day your numbers go quiet rather than wrong.

Last updated