Install
openclaw skills install form2apiAutomatically intercept and analyze login-required form submissions to generate reusable API docs and call code for automation and bulk operations.
openclaw skills install form2apiAll you need to do: send me the form URL, then submit the form once manually. I'll handle the rest.
What it does:
Typical use cases:
How to trigger: Send me the form page URL and say something like "reverse this form" / "find the API for this form" / "I want to automate this form".
After opening the target page, inject the interceptor script via the browser tool's evaluate action:
Read script content from:
<skill_dir>/scripts/inject_interceptor.js
Then execute it via browser(action=act) evaluate to inject into the page.
On success returns { status: 'injected' }. Returns already_active if already injected.
Tell the user:
"Interceptor is ready. Please fill out and submit the form normally in the browser, then let me know when done."
After user submits, run evaluate to read captured requests:
JSON.stringify(window.__capturedRequests)
Save the result to /tmp/form_api_raw.json.
python3 <skill_dir>/scripts/analyze_requests.py /tmp/form_api_raw.json
Outputs a ranked list of candidate API requests. Structured result saved to /tmp/form_api_analysis.json.
COOKIE=$(python3 <skill_dir>/scripts/extract_cookies.py <target_url>)
echo $COOKIE
Cookies are auto-cached in /tmp/form_api_cookies/ for 1 hour. Repeated calls reuse the cache.
Based on the analysis, using references/output_template.md as reference, generate complete API docs including:
| Script | Purpose |
|---|---|
scripts/inject_interceptor.js | Injected into page to hook fetch/XHR |
scripts/extract_cookies.py | Standardized cookie extraction with caching |
scripts/analyze_requests.py | Filter and annotate captured requests |
window.__capturedRequests accumulates across submissions; analysis picks the most relevant batch--force flagreferences/output_template.md