# Web Form Extractor - Form Fields, Method & Action from URL (`eliai/webpage-forms-extractor`) Actor

Extracts every HTML form from a page URL, one or up to 50 per run: action, method, encoding and each field's name, type, required flag and placeholder. Returns one record per page with password, email and file flags. For penetration testers, QA automation engineers and marketing ops teams.

- **URL**: https://apify.com/eliai/webpage-forms-extractor.md
- **Developed by:** [Broke to Built](https://apify.com/eliai) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 scanned pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Web Form Extractor — every form's fields, method & action from a URL

**Web Form Extractor lists every HTML form on a page with its action, method, encoding and each field's name, type, required flag and placeholder, at $0.001 per page on the Apify Free plan.**

| You give it | You get back | You pay (Free plan) |
|---|---|---|
| One URL or a list of up to 50 (25 by default) | `ok`, `url`, `status`, `formCount`, and per form: `action`, `method`, `enctype`, `fieldCount`, `fields`, `hasPassword`, `hasEmail`, `hasFile` | **$0.001 per page** |

Pay per result only: no subscription, no start fee. An unreachable URL returns `{ok:false, error}` and is not charged. Paid Apify plans get Store discounts on the price above.

### Example: try it in one click

The input form is already filled in with this example. Press **Start** and you get the output below.

```json
{
  "url": "https://httpbin.org/forms/post"
}
```

Real output from that exact input (run on 2026-09-24; long arrays shortened to a few entries and long text cut for display):

```json
[
  {
    "ok": true,
    "url": "https://httpbin.org/forms/post",
    "requestedUrl": "https://httpbin.org/forms/post",
    "status": 200,
    "formCount": 1,
    "forms": [
      {
        "action": "https://httpbin.org/post",
        "method": "post",
        "enctype": "application/x-www-form-urlencoded",
        "id": "",
        "name": "",
        "fieldCount": 12,
        "hasPassword": false,
        "hasEmail": true,
        "hasFile": false,
        "fields": [
          {
            "name": "custname",
            "type": "text",
            "required": false,
            "placeholder": "",
            "value": ""
          },
          {
            "name": "custtel",
            "type": "tel",
            "required": false,
            "placeholder": "",
            "value": ""
          }
        ]
      }
    ]
  }
]
```

Extract **all forms** on a web page with their `action`, `method`, `enctype`, and **every field**
(name, type, required, placeholder, value) — plus quick flags for `hasPassword`, `hasEmail`, and
`hasFile`. Built for security review, QA/automation mapping, and lead-form auditing. Single URL or
bulk.

**$0.001 per page.** Failed fetches are recorded free.

### What you get

- **One record per page**, listing every `<form>`.
- Per form: `action`, `method`, `enctype`, `id`, `name`, `fieldCount`, and a `fields` array.
- Per field: `name`, `type`, `required`, `placeholder`, `value` (left empty for password and hidden fields, and for fields named like a token, PIN or card number).
- Convenience flags: `hasPassword`, `hasEmail`, `hasFile`.
- **Fail-soft**: an unreachable URL returns `{ok:false, error}` and is **never charged**.

### Input

```json
{ "url": "https://github.com/login", "urls": ["https://example.com/contact"], "maxUrls": 25 }
```

### Output (real run, 2026-08-07)

```json
{
  "ok": true,
  "url": "https://github.com/login",
  "status": 200,
  "formCount": 1,
  "forms": [
    {
      "action": "https://github.com/session",
      "method": "post",
      "enctype": "application/x-www-form-urlencoded",
      "fieldCount": 16,
      "hasPassword": true,
      "hasEmail": false,
      "hasFile": false,
      "fields": [
        { "name": "login", "type": "text", "required": true, "placeholder": "", "value": "" },
        { "name": "password", "type": "password", "required": true }
      ]
    }
  ]
}
```

### Pricing — $0.001 per page

**$0.001 per page scanned on the Apify Free plan**, billed as the `page-scanned` event. Paid Apify
plans pay less ($0.00093 Bronze, $0.00087 Silver, $0.0008 Gold, $0.00073 Platinum, $0.00067
Diamond). No start fee. Failed fetches are recorded free. A page with no forms was scanned
successfully and is charged.

### Limits (honest ones)

- Reads the server HTML; forms injected by JavaScript after load are not seen (no headless browser).
- Field `action` is absolutized to the page URL when relative.
- `maxUrls` is capped at 50 per run (25 by default).

### FAQ

- **Does it submit forms?** No — it only reads and describes them.
- **Does it run JavaScript?** No — server HTML only.
- **Can it flag login/upload forms?** Yes — `hasPassword`, `hasEmail`, and `hasFile` make those easy to filter.
- **What about a dead URL?** You get an `{ok:false, error}` record, uncharged.
- **Does it return what users typed into a form?** No. It reads the page's HTML as served, so `value` is only a default value written into the page, and it is left empty for sensitive fields.

### Use from code or AI agents

```bash
curl -X POST "https://api.apify.com/v2/acts/EliAI~webpage-forms-extractor/runs?token=YOUR_APIFY_TOKEN" \
  -H 'content-type: application/json' \
  -d '{"url":"https://github.com/login"}'
```

Callable as an agent tool through the Apify MCP server (`mcp.apify.com`).

### For AI agents

This Actor is built to be called by software, not just by people.

- **Mount it directly as an MCP tool** — no Store search, no ranking, just this one tool:
  `https://mcp.apify.com/?actors=eliai/webpage-forms-extractor`
- **Or call it over HTTP** and get the results in the same request:
  `POST https://api.apify.com/v2/acts/eliai~webpage-forms-extractor/run-sync-get-dataset-items`
- **Costs are predictable before you call.** Pricing is pay-per-event (see Pricing above), so an agent can budget a run in advance instead of discovering the bill afterwards.
- **Send only the field you mean.** If you pass the bulk field, it is used on its own; the single-value field is a fallback, never merged into your request. You are charged for the items you sent and nothing else.

### Who uses it

- Penetration testers listing a site's forms, their actions and password or file fields
- QA automation engineers mapping form field names before writing end-to-end tests
- Marketing ops teams auditing lead forms across landing pages for required fields
- Accessibility reviewers finding inputs without names or placeholders
- Scraper developers learning a form's method and fields before automating submissions

### Changelog

- 2026-11-01: Page text only: the "Try it" block is now headed Example. Code, output and price are unchanged.
- 2026-09-24: New summary at the top of this page: what you send, what you get, the price, and a real output from the prefilled example.

# Actor input Schema

## `url` (type: `string`):

A single webpage URL to scan for HTML forms.

## `urls` (type: `array`):

Multiple webpage URLs to scan. When you set this, it is used on its own and the single-value field above is ignored, so you are only charged for the items you sent.

## `maxUrls` (type: `integer`):

Maximum number of URLs to process (1-50).

## Actor input object example

```json
{
  "url": "https://httpbin.org/forms/post",
  "urls": [],
  "maxUrls": 25
}
```

# Actor output Schema

## `results` (type: `string`):

Every item this run produced. Export as JSON, CSV or Excel from the dataset view.

# 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 = {
    "url": "https://httpbin.org/forms/post"
};

// Run the Actor and wait for it to finish
const run = await client.actor("eliai/webpage-forms-extractor").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 = { "url": "https://httpbin.org/forms/post" }

# Run the Actor and wait for it to finish
run = client.actor("eliai/webpage-forms-extractor").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 '{
  "url": "https://httpbin.org/forms/post"
}' |
apify call eliai/webpage-forms-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eliai/webpage-forms-extractor"
        }
    }
}
```

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/jR8r3UXaHkwA1XNsD/builds/IqbZhVXNSCXQj8Ucf/openapi.json
