Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.6.0"
".": "1.7.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-b20f9fea14d79990ab1af3d276f931e026cd955ac623ec6ace80b2af90de170f.yml
openapi_spec_hash: 943ff4b3297014503fdc9854544cb9a4
config_hash: 55c54fdafc9e80be584829b5724b00ab
configured_endpoints: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-9b1e2a2abf39dd780601935a9a9ee04cb939e2c3ba76627535f625b6aeaf5eb7.yml
openapi_spec_hash: 12fe5f4306c43fdfb394a33f79391a82
config_hash: cf04ecfb8dad5fbd8b85be25d6e9ec55
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.7.0 (2026-03-16)

Full Changelog: [v1.6.0...v1.7.0](https://github.com/browserbase/sdk-python/compare/v1.6.0...v1.7.0)

### Features

* [CORE-1796][apps/api] Update Node.js SDK ([ecafbb5](https://github.com/browserbase/sdk-python/commit/ecafbb511dbe9be78e84f4e1d34e1feefa1fce8e))
* [GRO-000] docs: Add guide + docs for search api ([55e2d0d](https://github.com/browserbase/sdk-python/commit/55e2d0db2f31b2ca390eaa6855f22de1f1688a88))

## 1.6.0 (2026-03-11)

Full Changelog: [v1.5.0...v1.6.0](https://github.com/browserbase/sdk-python/compare/v1.5.0...v1.6.0)
Expand Down
12 changes: 12 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ Methods:
- <code title="get /v1/projects">client.projects.<a href="./src/browserbase/resources/projects.py">list</a>() -> <a href="./src/browserbase/types/project_list_response.py">ProjectListResponse</a></code>
- <code title="get /v1/projects/{id}/usage">client.projects.<a href="./src/browserbase/resources/projects.py">usage</a>(id) -> <a href="./src/browserbase/types/project_usage.py">ProjectUsage</a></code>

# Search

Types:

```python
from browserbase.types import SearchWebResponse
```

Methods:

- <code title="post /v1/search">client.search.<a href="./src/browserbase/resources/search.py">web</a>(\*\*<a href="src/browserbase/types/search_web_params.py">params</a>) -> <a href="./src/browserbase/types/search_web_response.py">SearchWebResponse</a></code>

# Sessions

Types:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "browserbase"
version = "1.6.0"
version = "1.7.0"
description = "The official Python library for the Browserbase API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
39 changes: 38 additions & 1 deletion src/browserbase/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
)

if TYPE_CHECKING:
from .resources import contexts, projects, sessions, fetch_api, extensions
from .resources import search, contexts, projects, sessions, fetch_api, extensions
from .resources.search import SearchResource, AsyncSearchResource
from .resources.contexts import ContextsResource, AsyncContextsResource
from .resources.projects import ProjectsResource, AsyncProjectsResource
from .resources.fetch_api import FetchAPIResource, AsyncFetchAPIResource
Expand Down Expand Up @@ -129,6 +130,12 @@ def projects(self) -> ProjectsResource:

return ProjectsResource(self)

@cached_property
def search(self) -> SearchResource:
from .resources.search import SearchResource

return SearchResource(self)

@cached_property
def sessions(self) -> SessionsResource:
from .resources.sessions import SessionsResource
Expand Down Expand Up @@ -327,6 +334,12 @@ def projects(self) -> AsyncProjectsResource:

return AsyncProjectsResource(self)

@cached_property
def search(self) -> AsyncSearchResource:
from .resources.search import AsyncSearchResource

return AsyncSearchResource(self)

@cached_property
def sessions(self) -> AsyncSessionsResource:
from .resources.sessions import AsyncSessionsResource
Expand Down Expand Up @@ -476,6 +489,12 @@ def projects(self) -> projects.ProjectsResourceWithRawResponse:

return ProjectsResourceWithRawResponse(self._client.projects)

@cached_property
def search(self) -> search.SearchResourceWithRawResponse:
from .resources.search import SearchResourceWithRawResponse

return SearchResourceWithRawResponse(self._client.search)

@cached_property
def sessions(self) -> sessions.SessionsResourceWithRawResponse:
from .resources.sessions import SessionsResourceWithRawResponse
Expand Down Expand Up @@ -513,6 +532,12 @@ def projects(self) -> projects.AsyncProjectsResourceWithRawResponse:

return AsyncProjectsResourceWithRawResponse(self._client.projects)

@cached_property
def search(self) -> search.AsyncSearchResourceWithRawResponse:
from .resources.search import AsyncSearchResourceWithRawResponse

return AsyncSearchResourceWithRawResponse(self._client.search)

@cached_property
def sessions(self) -> sessions.AsyncSessionsResourceWithRawResponse:
from .resources.sessions import AsyncSessionsResourceWithRawResponse
Expand Down Expand Up @@ -550,6 +575,12 @@ def projects(self) -> projects.ProjectsResourceWithStreamingResponse:

return ProjectsResourceWithStreamingResponse(self._client.projects)

@cached_property
def search(self) -> search.SearchResourceWithStreamingResponse:
from .resources.search import SearchResourceWithStreamingResponse

return SearchResourceWithStreamingResponse(self._client.search)

@cached_property
def sessions(self) -> sessions.SessionsResourceWithStreamingResponse:
from .resources.sessions import SessionsResourceWithStreamingResponse
Expand Down Expand Up @@ -587,6 +618,12 @@ def projects(self) -> projects.AsyncProjectsResourceWithStreamingResponse:

return AsyncProjectsResourceWithStreamingResponse(self._client.projects)

@cached_property
def search(self) -> search.AsyncSearchResourceWithStreamingResponse:
from .resources.search import AsyncSearchResourceWithStreamingResponse

return AsyncSearchResourceWithStreamingResponse(self._client.search)

@cached_property
def sessions(self) -> sessions.AsyncSessionsResourceWithStreamingResponse:
from .resources.sessions import AsyncSessionsResourceWithStreamingResponse
Expand Down
2 changes: 1 addition & 1 deletion src/browserbase/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "browserbase"
__version__ = "1.6.0" # x-release-please-version
__version__ = "1.7.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/browserbase/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .search import (
SearchResource,
AsyncSearchResource,
SearchResourceWithRawResponse,
AsyncSearchResourceWithRawResponse,
SearchResourceWithStreamingResponse,
AsyncSearchResourceWithStreamingResponse,
)
from .contexts import (
ContextsResource,
AsyncContextsResource,
Expand Down Expand Up @@ -66,6 +74,12 @@
"AsyncProjectsResourceWithRawResponse",
"ProjectsResourceWithStreamingResponse",
"AsyncProjectsResourceWithStreamingResponse",
"SearchResource",
"AsyncSearchResource",
"SearchResourceWithRawResponse",
"AsyncSearchResourceWithRawResponse",
"SearchResourceWithStreamingResponse",
"AsyncSearchResourceWithStreamingResponse",
"SessionsResource",
"AsyncSessionsResource",
"SessionsResourceWithRawResponse",
Expand Down
185 changes: 185 additions & 0 deletions src/browserbase/resources/search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

import httpx

from ..types import search_web_params
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.search_web_response import SearchWebResponse

__all__ = ["SearchResource", "AsyncSearchResource"]


class SearchResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> SearchResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
"""
return SearchResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> SearchResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/browserbase/sdk-python#with_streaming_response
"""
return SearchResourceWithStreamingResponse(self)

def web(
self,
*,
query: str,
num_results: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SearchWebResponse:
"""
Perform a web search and return structured results.

Args:
query: The search query string

num_results: Number of results to return (1-25)

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/v1/search",
body=maybe_transform(
{
"query": query,
"num_results": num_results,
},
search_web_params.SearchWebParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=SearchWebResponse,
)


class AsyncSearchResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncSearchResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
"""
return AsyncSearchResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncSearchResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/browserbase/sdk-python#with_streaming_response
"""
return AsyncSearchResourceWithStreamingResponse(self)

async def web(
self,
*,
query: str,
num_results: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SearchWebResponse:
"""
Perform a web search and return structured results.

Args:
query: The search query string

num_results: Number of results to return (1-25)

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/v1/search",
body=await async_maybe_transform(
{
"query": query,
"num_results": num_results,
},
search_web_params.SearchWebParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=SearchWebResponse,
)


class SearchResourceWithRawResponse:
def __init__(self, search: SearchResource) -> None:
self._search = search

self.web = to_raw_response_wrapper(
search.web,
)


class AsyncSearchResourceWithRawResponse:
def __init__(self, search: AsyncSearchResource) -> None:
self._search = search

self.web = async_to_raw_response_wrapper(
search.web,
)


class SearchResourceWithStreamingResponse:
def __init__(self, search: SearchResource) -> None:
self._search = search

self.web = to_streamed_response_wrapper(
search.web,
)


class AsyncSearchResourceWithStreamingResponse:
def __init__(self, search: AsyncSearchResource) -> None:
self._search = search

self.web = async_to_streamed_response_wrapper(
search.web,
)
2 changes: 2 additions & 0 deletions src/browserbase/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
from .session import Session as Session
from .extension import Extension as Extension
from .project_usage import ProjectUsage as ProjectUsage
from .search_web_params import SearchWebParams as SearchWebParams
from .session_live_urls import SessionLiveURLs as SessionLiveURLs
from .search_web_response import SearchWebResponse as SearchWebResponse
from .session_list_params import SessionListParams as SessionListParams
from .context_create_params import ContextCreateParams as ContextCreateParams
from .project_list_response import ProjectListResponse as ProjectListResponse
Expand Down
2 changes: 0 additions & 2 deletions src/browserbase/types/fetch_api_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@


class FetchAPICreateResponse(BaseModel):
"""Response body for fetch"""

id: str
"""Unique identifier for the fetch request"""

Expand Down
Loading