Docs

Quickstart

This path uses the offline mock server. It does not need a browser, model key, or network access to the target site.

1. Install

sfw bun add @cuitty/scrape@0.1.0

2. Start the Dev Server

From this repo:

./run dev

The API listens on http://127.0.0.1:4340/api/scrape.

3. Send a Scrape Request

import { createScrapeClient } from "@cuitty/scrape/client";

const client = createScrapeClient({
  baseUrl: "http://127.0.0.1:4340",
});

const result = await client.run({
  url: "https://example.com/pricing",
  intent: "Extract plan names and prices as JSON",
  mode: "auto",
  emit: { artifact: true },
});

console.log(result.status);
console.log(result.answer);

4. Read the Result

result.answer contains extracted JSON or a free-form answer. result.provenance.steps shows the pipeline records. result.artifact is present unless emit.artifact is false.

if (result.artifact) {
  console.log(result.artifact.id);
  console.log(result.artifact.source.intent);
}

5. Replay the Artifact

Replay executes recorded steps against a BrowserSession. The content-mode mock artifact may have no browser actions, but the same API applies to interactive artifacts.

import { replayArtifact } from "@cuitty/scrape/artifact";
import { createMockBrowserSession } from "@cuitty/scrape/driver";

if (result.artifact) {
  const replay = await replayArtifact(result.artifact, createMockBrowserSession());
  console.log(replay.ok, replay.healCount);
}

Next: Client, Server, Embedding Guide.