Skip to main content
POST
https://searchcompany-main.up.railway.app
/
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}
  }'
{
  "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

url
string
Website URL to navigate to. If omitted, creates a pre-warmed session without navigation.
region
string
default:"us-west-2"
Browserbase region for the session. Valid values: us-west-2, us-east-1, eu-central-1, ap-southeast-1
viewport
object
Optional custom viewport dimensions
session_id
string
If provided, navigates an existing session instead of creating a new one

Response

session_id
string
Unique identifier for the browser session
live_url
string
URL to embed the live browser view (iframe-compatible)

How It Works

  1. Pre-warm (no URL) - Creates a new Browserbase session and returns immediately
  2. Navigate (with URL) - Navigates an existing session to the URL in the background
  3. Session Reuse - Sessions are cached per client IP + viewport for 5 minutes
The endpoint supports a two-phase flow:
  1. First call without URL to pre-warm the session (fast)
  2. 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}
  }'
{
  "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