Skip to content

Interact examples

Login + extract

Authenticate and extract the dashboard

```bash curl https://api.faircompany.ai/v1/crawl/interact \ -X POST \ -H "Authorization: Bearer fc_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/login", "actions": [ { "type": "fill", "selector": "#email", "value": "user@example.com" }, { "type": "fill", "selector": "#password", "value": "super-secret" }, { "type": "click", "selector": "button[type=\"submit\"]" }, { "type": "wait_for_selector", "selector": ".dashboard", "timeout_ms": 10000 }, { "type": "extract", "format": "markdown" } ] }' ```

SPA scroll

Terminal window
curl https://api.faircompany.ai/v1/crawl/interact \
-X POST \
-H "Authorization: Bearer $FAIRCRAWL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/feed",
"actions": [
{ "type": "scroll", "amount": 1800 },
{ "type": "wait", "ms": 1200 },
{ "type": "extract", "format": "markdown" }
]
}'

Form submission

Swap the final extract for screenshot if you need proof of the submitted state rather than readable text.