Skip to main content

Prerequisites

Before starting, ensure you have:
  • Node.js 18+ installed
  • ~500MB disk space for Camoufox browser download (happens on first run)
  • curl or any HTTP client for testing
Camoufox downloads automatically on first launch (~300MB). This is a one-time download that’s cached locally.

Start the server

1

Clone and install

Clone the repository and install dependencies:
2

Launch the server

Start the Camofox server:
You’ll see output like:
The server runs on port 9377 by default. Change with CAMOFOX_PORT=8080 npm start.
On first run, Camoufox will download the browser engine (~300MB). This takes 1-2 minutes depending on your connection.
3

Verify it's running

Check the health endpoint:
Response:
browserRunning: false is normal - the browser launches lazily on first tab creation to save resources.

Your first automation

Let’s navigate to a website, get its content, and interact with an element.
1

Create a tab

Create a new browser tab:
Response:
Save the tabId - you’ll need it for subsequent requests.
  • userId: Isolates cookies/storage between users (multi-tenant support)
  • sessionKey: Groups tabs by conversation or task
2

Get page snapshot

Get an accessibility snapshot with element refs:
Response:
The snapshot field contains the accessibility tree with element refs (e1, e2, etc.).
Accessibility snapshots are ~90% smaller than raw HTML, saving context window tokens.
3

Interact with an element

Click the link using its ref e1:
Response:
The browser navigated to the link’s target! Notice refsAvailable: true - refs are automatically rebuilt after navigation.
4

Try a search macro

Navigate using a search macro:
Response:
Search macros expand to full URLs automatically. Available macros:
  • @google_search
  • @youtube_search
  • @amazon_search
  • @reddit_search
  • @wikipedia_search
  • @twitter_search
  • And 8 more!

Type into a form

Let’s search Google by typing into the search box:
Element refs reset after navigation. Always get a fresh snapshot after clicking links or submitting forms.

Scroll and get more content

For long pages, scroll down to load more content:
Then get a fresh snapshot:

Close the tab

When done, close the tab:
Response:

Next steps

Installation

Learn about Docker, Fly.io deployment, and OpenClaw plugin setup

API reference

Explore all available endpoints and parameters

Search macros

See all 14 built-in search shortcuts

Cookie import

Import cookies for authenticated browsing (LinkedIn, Amazon, etc.)

Common workflows

Returns a PNG image.
Closes all tabs and deletes all cookies/storage for agent1.