# Website Form Contract Crawler (`bread-kim/website-form-contract-crawler`) Actor

Crawl public website forms and capture their field structure without submitting them. Compare against a previous snapshot to detect added, removed, or changed inputs, then export contract reports and evidence-ready files.

- **URL**: https://apify.com/bread-kim/website-form-contract-crawler.md
- **Developed by:** [bread kim](https://apify.com/bread-kim) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Website Form Contract Crawler

A private Apify Actor that performs a bounded, sequential crawl of one caller-declared public HTTPS origin and produces normalized developer-facing HTML form contracts, small static reference/label findings, and caller-baseline structural changes.

It is deliberately narrow: it does not submit forms, request form actions, use a browser, render JavaScript, extract contacts, test functionality, certify WCAG compliance, audit security, promise conversion or lead outcomes, or claim full-site coverage. A browser/contact scraper may be a better fit for JavaScript-only forms.

### Input and operation

Production requires a query-free `startUrl` on public HTTPS port 443. `maxPages` is 1–20 (default 5); `maxDepth` is 0–3 (default 2). Only same-origin, query-free, non-side-effect-looking navigation links are queued. `previousContracts` accepts at most 100 caller-owned `{pageUrl, formKey, contractHash}` records.

`demoMode: true` uses a fixed three-page/two-form internal site with the same parser and BFS crawl algorithm and performs zero DNS/HTTP calls. It is for product evaluation, not the production canary.

The Actor observes static HTML. `INVENTORY_EMPTY` means no forms were found on successfully fetched static pages, not that the website has no forms. Challenge, consent, or access-blocked pages are `ACCESS_LIMITED`; browser-dependent detection remains `NOT_RENDERED` in the product's coverage model.

### Outputs

The authoritative `OUTPUT` object is written once to the default dataset and to KVS `OUTPUT`. KVS also receives `ZIP`, `REPORT.html`, `INVENTORY.json`, `CHANGES.json`, `FORMS.csv`, `QA.json`, `APPLY.md`, `LICENSES.txt`, and `MANIFEST.json`. The ZIP contains exactly the latter eight review files (with lowercase inventory/forms/changes filenames inside); its manifest hashes the seven non-manifest entries.

Ordinal form keys are stable for identical HTML but are best-effort identity: inserting a form earlier can cause apparent changes. Persist a reviewed current snapshot externally; the Actor does not schedule, webhook, or overwrite an owner database.

### Local verification

Use Node 22.23.3. Run `npm ci --ignore-scripts`, `npm run preflight`, and `npm audit --omit=dev --audit-level=high`. The deterministic container check is `docker run --rm -e AUTOMATON_CONTAINER_SMOKE=1 IMAGE`; it must print `AUTOMATON_CONTAINER_SMOKE_OK` only after parsing three pages, two forms, and building the artifact.

Free custom alternatives include Cheerio plus Node HTTPS with equivalent SSRF, DNS pinning, redirect, robots, timeout, and byte-limit controls. A simplistic HTTP client is not security-equivalent.

# Actor input Schema

## `startUrl` (type: `string`):

Query-free public HTTPS URL on default port 443. Required outside demo mode.

## `demoMode` (type: `boolean`):

Use the fixed three-page internal demo graph without DNS or HTTP.

## `maxPages` (type: `integer`):

Maximum attempted page URLs, including failures.

## `maxDepth` (type: `integer`):

Maximum same-origin navigation depth from the start page.

## `previousContracts` (type: `array`):

Caller-owned baseline entries used only for comparison.

## Actor input object example

```json
{
  "demoMode": true,
  "maxPages": 5,
  "maxDepth": 2,
  "previousContracts": []
}
```

# Actor output Schema

## `output` (type: `string`):

The exact output record also written once to the default dataset.

## `zip` (type: `string`):

Eight-entry review bundle.

## `report` (type: `string`):

Escaped human-readable report.

## `inventory` (type: `string`):

Pages and form contracts.

## `changes` (type: `string`):

Caller-baseline comparison.

## `formsCsv` (type: `string`):

Formula-escaped form summary.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "demoMode": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("bread-kim/website-form-contract-crawler").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "demoMode": True }

# Run the Actor and wait for it to finish
run = client.actor("bread-kim/website-form-contract-crawler").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "demoMode": true
}' |
apify call bread-kim/website-form-contract-crawler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bread-kim/website-form-contract-crawler"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/6mszjQXdgil29rRud/builds/eopg3ucqLI49jDSkf/openapi.json
