Skip to main content
NEW AI Studio is now available Try it now

Browser

A cloud browser you connect to over WebSocket. Each session runs its own Chromium or Firefox instance with stealth, fingerprint rotation, and CAPTCHA solving built in. You write navigation and extraction logic. Spider handles the anti-bot work. SDKs available for TypeScript, Python, and Rust.

Quick Start

Install the SDK, export your API key, and open a session.

Connect and scrape

import { SpiderBrowser } from "spider-browser"; const browser = new SpiderBrowser({ apiKey: process.env.SPIDER_API_KEY, }); await browser.init(); // Navigate to any page await browser.page.goto("https://www.example.com"); // Get the rendered content as clean text const content = await browser.page.content(); console.log(content); await browser.close();

Installation

All three SDKs connect to the same infrastructure over wss://browser.spider.cloud. Install with one command.

Install the SDK

npm install spider-browser

Call goto() with a URL. Spider detects anti-bot challenges, rotates fingerprints, and solves CAPTCHAs automatically. Use goto_fast() when you do not need to wait for full DOM readiness.

Navigation methods

// Standard navigation, waits for DOM content await browser.page.goto("https://www.amazon.com/dp/B0DGJHM7QN"); // Fast navigation, returns as soon as possible await browser.page.goto_fast("https://news.ycombinator.com"); // Wait for full readiness with a minimum content length const html = await browser.page.content({ wait_ms: 5000, min_length: 500, });

Extracting Structured Data

Pass CSS selectors to extractFields() and get a JSON object back. Spider runs the selectors server-side, so you never parse HTML yourself.

Field extraction

const product = await browser.page.extractFields({ title: "#productTitle", price: ".a-price .a-offscreen", rating: "#acrPopover .a-icon-alt", reviews: "#acrCustomerReviewText", image: { selector: "#landingImage", attribute: "src" }, }); console.log(product); // { // title: "Apple AirPods Pro 2", // price: "$189.99", // rating: "4.7 out of 5 stars", // reviews: "48,239 ratings", // image: "https://m.media-amazon.com/images/..." // }

Natural Language Extraction

Use extract() with a plain English prompt when you do not know the page structure ahead of time. Spider reads the rendered page and returns what you asked for as text.

AI-powered extraction

const result = await browser.page.extract( "What is the product name, price, and return policy?" ); console.log(result); // "The product is the Apple AirPods Pro 2, priced at $189.99. // The return policy allows returns within 30 days of delivery."

Screenshots

Capture a full-page or viewport screenshot. Returns base64-encoded PNG.

Capture screenshots

import fs from "fs"; // Full page screenshot const screenshot = await browser.page.screenshot(); // Save to disk fs.writeFileSync("page.png", Buffer.from(screenshot, "base64"));

Page Interactions

Use act() with a plain English instruction to click, type, or interact with any element. For precise control, use the direct DOM methods click() and type() with CSS selectors.

Interact with pages

// Natural language interactions await browser.page.act("Click the 'Sign In' button"); await browser.page.act("Type 'hello world' into the search box and press Enter"); // Direct DOM methods await browser.page.click("#submit-btn"); await browser.page.type("#email", "user@example.com");

Autonomous Agent Mode

Call agent() with a goal. Spider navigates across pages, clicks, fills forms, and extracts data until the task is complete. Works for multi-step workflows where you cannot predict the exact page sequence ahead of time.

Autonomous agent

const result = await browser.page.agent( "Go to Hacker News, find the top 3 posts from today, " + "and return their titles, URLs, and point counts as JSON." ); console.log(result);

Stealth and Anti-Bot

Set stealth on the connection to control how aggressively Spider evades detection. Level 0 is the strongest. If a site escalates, Spider escalates back automatically up to maxStealthLevels. 85% on the Browser Use stealth benchmark.

Stealth configuration

const browser = new SpiderBrowser({ apiKey: process.env.SPIDER_API_KEY, stealth: 0, // Start with maximum stealth maxStealthLevels: 3, // Allow up to 3 escalation steps captcha: "solve", // Automatically solve CAPTCHAs smartRetry: true, // Retry with different strategies on failure hedge: true, // Race multiple approaches for speed });

Session Recording

Set record: true to capture a full session replay. The recording includes every navigation, click, and form fill. Retrieve the playback URL with getRecording() after the session ends.

Record a session

const browser = new SpiderBrowser({ apiKey: process.env.SPIDER_API_KEY, record: true, }); await browser.init(); await browser.page.goto("https://www.example.com"); await browser.page.act("Click the first link on the page"); // Get the recording URL when done const recording = await browser.getRecording(); console.log(recording.url); await browser.close();

Concurrent Sessions

Open up to 100 browser sessions in parallel. Each session is fully isolated: separate fingerprint, cookie jar, and proxy. All plans include 100 concurrent sessions.

Parallel sessions

const urls = [ "https://news.ycombinator.com", "https://reddit.com/r/programming", "https://lobste.rs", ]; // Open 3 sessions in parallel const results = await Promise.all( urls.map(async (url) => { const browser = new SpiderBrowser({ apiKey: process.env.SPIDER_API_KEY, }); await browser.init(); await browser.page.goto(url); const content = await browser.page.content(); await browser.close(); return { url, content }; }) ); console.log(`Scraped ${results.length} sites`);

Geo-Targeting

Set country to route the session through a residential proxy in that region. Supports 100+ country codes. The proxy applies to all navigations within the session.

Country-specific sessions

// Route through a UK proxy const browser = new SpiderBrowser({ apiKey: process.env.SPIDER_API_KEY, country: "GB", }); await browser.init(); await browser.page.goto("https://www.amazon.co.uk/dp/B0DGJHM7QN"); const price = await browser.page.extractFields({ price: ".a-price .a-offscreen", }); console.log(price); // { price: "£179.99" }

Connection Options

Full reference for SpiderBrowserOptions. All fields except apiKey are optional and have sensible defaults.

SpiderBrowserOptions

interface SpiderBrowserOptions { apiKey: string; // Your Spider API key serverUrl?: string; // WebSocket server (default: wss://browser.spider.cloud) browser?: string; // Browser type: "auto", "chrome", "firefox", "spider" (default: "auto") stealth?: number; // Stealth level 0-3, lower = more stealth (default: 0) maxStealthLevels?: number; // Max escalation steps (default: 3) captcha?: "solve" | "skip"; // CAPTCHA handling (default: "solve") smartRetry?: boolean; // Auto-retry with different strategies (default: true) maxRetries?: number; // Maximum retry attempts (default: 12) hedge?: boolean; // Race multiple approaches (default: false) country?: string; // Proxy country code, e.g. "US" (default: none) mode?: string; // "scraping" or "automation" (default: "scraping") record?: boolean; // Record session for playback (default: false) connectTimeoutMs?: number; // Connection timeout in ms (default: 30000) commandTimeoutMs?: number; // Command timeout in ms (default: 30000) }

Raw WebSocket

Connect directly with any CDP-compatible client. Pass your API key and session options as query parameters to wss://browser.spider.cloud/v1/browser. Works with Playwright, Puppeteer, or any WebSocket library that speaks CDP.

Direct WebSocket connection

import { chromium } from "playwright"; const browser = await chromium.connectOverCDP( "wss://browser.spider.cloud/v1/browser?" + "apiKey=YOUR_API_KEY&stealth=0&captcha=solve" ); const page = browser.contexts()[0].pages()[0]; await page.goto("https://www.example.com"); console.log(await page.content()); await browser.close();

Create an API key and make your first request in under 3 minutes. SDK source and full examples are on GitHub. See the Browser API reference for endpoint details and pricing.