Getting Started with Browserbase
Get started with Browserbase in a single script covering the Search API, Fetch, and browser sessions powered by Playwright.
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
Run a web search using the Search API and print the top results with titles and URLs
Fetch a Wikipedia page using the Fetch API (no browser) and extract the page title from raw HTML
Create a Browserbase session and connect via CDP using Playwright
Navigate to Wikipedia, search for a topic, and extract the article title, summary, and section headings