Base URL: http://localhost:4300 (or your configured port)
Runs one script and returns JSON result directly. Extra query params become input in script.
curl "http://localhost:4300/api/run-sync?scriptName=ai_overview.js&request=closest%20planet&noProxy=true&includeLogs=true"
Queues run and returns run id. Use this from agents/workers.
curl -X POST "http://localhost:4300/api/scripts/run" \
-H "Content-Type: application/json" \
-d '{
"name": "ai_overview.js",
"input": {
"request": "closest planet to earth",
"noProxy": true
}
}'
curl "http://localhost:4300/api/runs" curl "http://localhost:4300/api/runs/<runId>"
curl -X POST "http://localhost:4300/api/runs/<runId>/stop"
curl "http://localhost:4300/api/config"
curl -X POST "http://localhost:4300/api/config" \
-H "Content-Type: application/json" \
-d '{
"profileName": "default",
"browserEngine": "chrome",
"proxy": "user:pass@host:port",
"headless": false,
"timeoutMs": 120000,
"safeModeEnabled": true,
"safeModeMinFreeRamGb": 4,
"browserJobTimeoutMs": 180000,
"camoufoxSharedIdleMs": 30000,
"maxConcurrentRunSlots": 4,
"maxQueuedRunSlots": 200,
"rotateProfileEveryNRequests": 5,
"rotateFingerprintWithProfile": true
}'
curl "http://localhost:4300/api/scripts"
curl "http://localhost:4300/api/scripts/example.js"
curl -X PUT "http://localhost:4300/api/scripts/new_script.js" \
-H "Content-Type: application/json" \
-d '{"content":"log(\"hello\")"}'
curl -X DELETE "http://localhost:4300/api/scripts/new_script.js"
curl -X POST "http://localhost:4300/api/config/proxy/test" \
-H "Content-Type: application/json" \
-d '{"proxy":"user:pass@host:port"}'
curl -X POST "http://localhost:4300/api/profile/recreate" \
-H "Content-Type: application/json" \
-d '{"profileName":"default"}'
Execution context inside script:
- page, context, browser, playwright
- log(...args), sleep(ms)
- config (resolved run config)
- input (variables from UI/API)
- setResult(value) optional explicit result
Recommended script return JSON:
{
"ok": true,
"data": "...",
"error": null
}