Health check
Response
boolean
true if server is healthy, false if recovering from errorsstring
Browser engine name:
"camoufox"boolean
true if browser is currently running and connectedboolean
true if browser process is active (same as browserConnected)number
Total number of open tabs across all sessions
number
Number of consecutive navigation failures. Browser auto-restarts after 3 failures.
boolean
true if browser is currently restarting after detecting unhealthy stateHealth states
Browser lifecycle
- Browser launches lazily on first request (tab creation, navigation, etc.)
- Browser shuts down after 5 minutes of inactivity when no sessions exist (configurable via
BROWSER_IDLE_TIMEOUT_MS) - Browser auto-restarts after 3 consecutive navigation failures
Examples
Healthy (browser running):Start browser
Response
boolean
true if browser started successfullyboolean
true after successful launchExample
Notes
- If browser is already running, this endpoint is a no-op and returns success
- First browser launch downloads Camoufox (~300MB) if not already installed
- Subsequent launches take 2-5 seconds
Stop browser
Authentication
string
required
Bearer token matching the
CAMOFOX_ADMIN_KEY environment variable:CAMOFOX_ADMIN_KEY is not set, this endpoint returns 403 Forbidden.
Response
boolean
true if browser was stopped successfullyboolean
false after shutdownExample
Shutdown sequence
- All user sessions are closed (browser contexts)
- All open tabs are closed
- Browser process is terminated
- Browser will relaunch on the next request
Error responses
Missing or invalid admin key:Auto-recovery
The server automatically monitors browser health and restarts when necessary:Failure detection
- Tracks consecutive navigation failures
- After 3 consecutive failures, browser is considered unhealthy
- All sessions are closed and browser restarts
- Success resets the failure counter
Disconnection handling
- If browser disconnects unexpectedly, all sessions are cleared
- Browser relaunches on the next request
- Clients receive 500 errors during recovery
Idle shutdown
- When no sessions exist for 5 minutes (default), browser shuts down to free memory
- Server idle memory usage: ~40MB
- Browser relaunches on the next tab creation