html $0.0005 / call
Main Text
Extract article text from supplied HTML.
html.main-texthtml.forms · v1.0.0
Describe up to 30 forms and their controls without returning field values or submitting anything.
{
"html": "<form action=\"/search\"><label for=\"q\">Search</label><input id=\"q\" name=\"q\" required></form>",
"baseUrl": "https://example.com/"
}{
"forms": [
{
"id": "",
"action": "https://example.com/search",
"method": "get",
"fields": [
{
"name": "q",
"type": "text",
"label": "Search",
"required": true,
"disabled": false
}
],
"fieldsTruncated": false
}
],
"truncated": false,
"scope": "Describes supplied form markup without field values; no JavaScript execution or form submission."
}Generated from the actual handler using this example input; this is a preview, not a paid API call. Paid responses wrap the result with a receipt and recovery expiry.
Add credits in the workspace and keep your API key in private environment storage. Use the same request ID and exact body to recover a lost response within ten minutes.
// Node.js 22+. Read the key from your private environment.
const requestId = Date.now() + '_' + crypto.randomUUID();
const response = await fetch('https://agent-utilities.agent-utilities.workers.dev/v1/tools/html.forms', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + process.env.AGENT_UTILITIES_API_KEY,
'Idempotency-Key': requestId
},
body: JSON.stringify({
"html": "<form action=\"/search\"><label for=\"q\">Search</label><input id=\"q\" name=\"q\" required></form>",
"baseUrl": "https://example.com/"
})
});
const data = await response.json();
if (!response.ok) throw new Error(data.error?.message ?? 'Request failed');
console.log(data);
// On response loss, retry this SAME requestId, tool and body.
// Do not rerun the line that generates requestId for a retry.{
"type": "object",
"properties": {
"html": {
"type": "string",
"maxLength": 100000
},
"baseUrl": {
"type": "string",
"minLength": 1,
"maxLength": 2048
}
},
"required": [
"html"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"forms": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"action": {
"type": [
"string",
"null"
]
},
"method": {
"type": "string"
},
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"label": {
"type": "string"
},
"required": {
"type": "boolean"
},
"disabled": {
"type": "boolean"
}
},
"required": [
"name",
"type",
"label",
"required",
"disabled"
],
"additionalProperties": false
}
},
"fieldsTruncated": {
"type": "boolean"
}
},
"required": [
"id",
"action",
"method",
"fields",
"fieldsTruncated"
],
"additionalProperties": false
}
},
"truncated": {
"type": "boolean"
},
"scope": {
"type": "string"
}
},
"required": [
"forms",
"truncated",
"scope"
],
"additionalProperties": false
}Prices are experimental. The service currently allows 1,000 new calls per day across all accounts. Failed operations return reserved credits. This tool may process sensitive content; use sanitized samples when possible. Successful results are encrypted for ten-minute retry recovery. Review data handling and service limits.