Browser Execute
Execute actions in a headless browser session — 2 credits per call.
Request
curl -X POST https://api.hushsearch.io/v1/browser-execute/ \
-H "X-API-Key: hs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"session_id": "sess_…",
"actions": [
{
"type": "navigate",
"url": "https://example.com/"
},
{
"type": "extract",
"selector": "h1"
}
]
}'POST /v1/browser-execute/ — 2 credits per call
Execute a sequence of actions in an existing session created via Browser Session.
Request
{
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"actions": [
{ "type": "goto", "url": "https://example.com" },
{ "type": "click", "selector": "#search-btn" },
{ "type": "type", "selector": "input[name=q]", "text": "HushSearch" },
{ "type": "screenshot" },
{ "type": "extract" }
]
}Supported action types
| Type | Fields | Description |
|---|---|---|
goto | url | Navigate (SSRF-guarded) |
click | selector | Click a CSS selector |
type | selector, text | Fill an input |
screenshot | — | Returns base64 PNG |
extract | — | Returns main content as markdown |
wait | ms | Wait up to 5000ms |
Response
{
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"results": [
{ "type": "goto", "url": "https://example.com", "status": "ok" },
{ "type": "screenshot", "image_base64": "iVBORw0KGgo..." },
{ "type": "extract", "title": "Example Domain", "markdown": "# Example\n..." }
],
"credits_used": 2,
"credits_remaining": 92,
"response_time_ms": 850
}Notes
- Returns 404 if the session has expired or does not exist.
gotovalidates URLs against the SSRF blocklist.- Empty
actionslist returns 400.