What is search()?
An agent that doesn’t know where to start has to launch a browser, load a search engine, wait for the page, and read a result list before it can do anything useful. browserbase.search() collapses that into a single API call: you send a query, you get back ranked results with URLs, titles, and metadata.
- TypeScript
- Python
- Go
search() is a Browserbase cloud feature. The query runs on Browserbase infrastructure and needs a Browserbase API key, so local browsers have no equivalent.Why use search()?
Whole-web index
Structured, ranked output
Live, low-latency results
Token-optimized
Setup
search() ships with the Stagehand SDK. The only requirement is a Browserbase API key:
- TypeScript
- Python
- Go
Response
A search returns the query it ran, a request ID you can quote in support requests, and the ranked results.id, title, and url are always present; the rest are filled in when the source exposes them.
Field names follow each language’s conventions:
requestId and publishedDate in TypeScript, request_id and published_date in Python, and RequestID and PublishedDate on the Go structs.API reference
Parameters
string
required
Your Browserbase API key. Search is billed to the project that owns the key.
string
required
The search query, 1–200 characters.
number
How many results to return, between 1 and 25. Defaults to 10.
string
Browserbase API origin override. Defaults to
https://api.browserbase.com.Returns
string
The query that was executed.
string
Identifier for this search request.
SearchResult[]
Results ordered by relevance.
Search, then read
search() deliberately returns pointers rather than page bodies. Pair it with fetch() to pull the content of the one or two pages that matter, and reach for a full browser session only when the page needs interaction.
- TypeScript
- Python
- Go
Use cases
General agents and chatbots
Coding agents
Research agents
Voice agents
Limits
Exceeding the rate limit returns a
429. Back off and retry rather than looping.

