curl -X POST "https://searchcompany-main.up.railway.app/api/browser-session" \
-H "Content-Type: application/json" \
-d '{
"region": "us-west-2",
"viewport": {"width": 1280, "height": 720}
}'
curl -X POST "https://searchcompany-main.up.railway.app/api/browser-session" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"session_id": "abc123-session-id"
}'
{
"session_id": "abc123-def456-ghi789",
"live_url": "https://www.browserbase.com/devtools-fullscreen/abc123?navbar=false"
}
🔵 POST - Create Browser Session
Create Browser Session
Create or navigate a Browserbase browser session for live website scanning visualization
POST
/
api
/
browser-session
curl -X POST "https://searchcompany-main.up.railway.app/api/browser-session" \
-H "Content-Type: application/json" \
-d '{
"region": "us-west-2",
"viewport": {"width": 1280, "height": 720}
}'
curl -X POST "https://searchcompany-main.up.railway.app/api/browser-session" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"session_id": "abc123-session-id"
}'
{
"session_id": "abc123-def456-ghi789",
"live_url": "https://www.browserbase.com/devtools-fullscreen/abc123?navbar=false"
}
Public endpoint used on the marketing website to show a live browser scanning animation. Uses Browserbase API with Playwright for fast, reliable browser sessions.
This is a public endpoint - no authentication required. Used on the
searchcompany.ai landing page ranking flow.
Request Body
string
Website URL to navigate to. If omitted, creates a pre-warmed session without navigation.
string
default:"us-west-2"
Browserbase region for the session. Valid values:
us-west-2, us-east-1, eu-central-1, ap-southeast-1object
string
If provided, navigates an existing session instead of creating a new one
Response
string
Unique identifier for the browser session
string
URL to embed the live browser view (iframe-compatible)
How It Works
- Pre-warm (no URL) - Creates a new Browserbase session and returns immediately
- Navigate (with URL) - Navigates an existing session to the URL in the background
- Session Reuse - Sessions are cached per client IP + viewport for 5 minutes
- First call without URL to pre-warm the session (fast)
- Second call with URL and session_id to start navigation
curl -X POST "https://searchcompany-main.up.railway.app/api/browser-session" \
-H "Content-Type: application/json" \
-d '{
"region": "us-west-2",
"viewport": {"width": 1280, "height": 720}
}'
curl -X POST "https://searchcompany-main.up.railway.app/api/browser-session" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"session_id": "abc123-session-id"
}'
{
"session_id": "abc123-def456-ghi789",
"live_url": "https://www.browserbase.com/devtools-fullscreen/abc123?navbar=false"
}
Usage on Landing Page
// 1. Pre-warm session when user starts typing
const { session_id, live_url } = await createBrowserSession(
undefined, // no URL yet
{ width: 1280, height: 720 }
);
// 2. Show live_url in iframe immediately
iframeRef.src = live_url;
// 3. Navigate when user submits URL
await createBrowserSession(userUrl, undefined, session_id);
Rate Limiting
- 60 requests/minute per IP address