Getting Started with Browserbase

Get started with Browserbase in a single script covering the Search API, Fetch, and browser sessions powered by Playwright.

Getting Started with Browserbase demo
TypeScript
Source code
npx create-browser-app --template getting-started-with-browserbase
uvx create-browser-app --template getting-started-with-browserbase

Get started with Browserbase

Get up and running with all three core Browserbase capabilities in a single script. The Search API lets you perform web searches programmatically and receive structured results, no browser session required. Fetch grabs the content of any URL through Browserbase's infrastructure without creating a browser session, ideal for quick page retrievals where you don't need interactivity. And Browser Sessions give you a full cloud browser controlled via Playwright and CDP. No AI model required, just your Browserbase API key.

Steps

  1. Run a web search using the Search API and print the top results with titles and URLs

  2. Fetch a Wikipedia page using the Fetch API (no browser) and extract the page title from raw HTML

  3. Create a Browserbase session and connect via CDP using Playwright

  4. Navigate to Wikipedia, search for a topic, and extract the article title, summary, and section headings