Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
f32a9e2
chore(docs): grammar improvements
stainless-app[bot] May 22, 2025
07d129a
chore(docs): remove reference to rye shell
stainless-app[bot] Jun 3, 2025
62209dc
chore(docs): remove unnecessary param examples
stainless-app[bot] Jun 3, 2025
a8b0b5e
feat(client): add follow_redirects request option
stainless-app[bot] Jun 3, 2025
8d89489
codegen metadata
stainless-app[bot] Jun 3, 2025
94308de
chore(tests): run tests in parallel
stainless-app[bot] Sep 4, 2025
9614c4c
fix(client): correctly parse binary response | stream
stainless-app[bot] Jun 13, 2025
9c5d88c
chore(tests): add tests for httpx client instantiation & proxies
stainless-app[bot] Jun 17, 2025
5d3a2b1
chore(internal): update conftest.py
stainless-app[bot] Jun 17, 2025
03a6db7
chore(ci): enable for pull requests
stainless-app[bot] Jun 17, 2025
869a3f4
chore(readme): update badges
stainless-app[bot] Jun 18, 2025
e298407
fix(tests): fix: tests which call HTTP endpoints directly with the ex…
stainless-app[bot] Jun 18, 2025
4bbda56
docs(client): fix httpx.Timeout documentation reference
stainless-app[bot] Jun 19, 2025
3516092
feat(client): add support for aiohttp
stainless-app[bot] Sep 4, 2025
7bc40f0
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 24, 2025
61b97ff
fix(ci): release-doctor — report correct token name
stainless-app[bot] Jun 27, 2025
c8cb51f
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 28, 2025
a36b873
fix(ci): correct conditional
stainless-app[bot] Jun 30, 2025
1dca95e
codegen metadata
stainless-app[bot] Jun 30, 2025
e42da7c
chore(ci): change upload type
stainless-app[bot] Jul 2, 2025
1cbb849
feat(api): api update
stainless-app[bot] Jul 2, 2025
ccb2c95
chore(internal): codegen related update
stainless-app[bot] Jul 3, 2025
6abe326
codegen metadata
stainless-app[bot] Jul 3, 2025
1ce99ef
feat(api): api update
stainless-app[bot] Jul 7, 2025
5e3270d
chore(internal): bump pinned h11 dep
stainless-app[bot] Sep 4, 2025
2450b8e
chore(package): mark python 3.13 as supported
stainless-app[bot] Jul 9, 2025
d020678
fix(parsing): correctly handle nested discriminated unions
stainless-app[bot] Jul 10, 2025
8bd5f8b
feat(api): api update
stainless-app[bot] Jul 10, 2025
c4157cb
chore(internal): codegen related update
stainless-app[bot] Jul 10, 2025
6d449b3
feat(api): api update
stainless-app[bot] Jul 10, 2025
12de9f3
chore(internal): codegen related update
stainless-app[bot] Jul 10, 2025
d72f39f
feat(api): api update
stainless-app[bot] Jul 10, 2025
f979aff
chore(internal): codegen related update
stainless-app[bot] Jul 11, 2025
a8afe1a
chore(readme): fix version rendering on pypi
stainless-app[bot] Jul 11, 2025
1d9f769
feat(api): api update
stainless-app[bot] Jul 11, 2025
c4c4185
fix(client): don't send Content-Type header on GET requests
stainless-app[bot] Jul 12, 2025
82c38c4
feat: clean up environment call outs
stainless-app[bot] Jul 15, 2025
f38e029
feat(api): api update
stainless-app[bot] Jul 16, 2025
3209287
feat(api): api update
stainless-app[bot] Jul 17, 2025
118c4d4
fix(parsing): ignore empty metadata
stainless-app[bot] Jul 22, 2025
c7ef875
fix(parsing): parse extra field types
stainless-app[bot] Jul 23, 2025
a406241
chore(project): add settings file for vscode
stainless-app[bot] Jul 25, 2025
2f338f0
feat(client): support file upload requests
stainless-app[bot] Jul 31, 2025
e6a3df4
chore(internal): fix ruff target version
stainless-app[bot] Aug 6, 2025
b48933b
chore: update @stainless-api/prism-cli to v5.15.0
stainless-app[bot] Aug 9, 2025
a7aec17
chore(internal): update comment in script
stainless-app[bot] Aug 9, 2025
d57dc03
chore: update github action
stainless-app[bot] Aug 22, 2025
14c0ac4
chore(internal): change ci workflow machines
stainless-app[bot] Aug 26, 2025
fd0e300
codegen metadata
stainless-app[bot] Aug 27, 2025
85f597b
fix: avoid newer type syntax
stainless-app[bot] Aug 27, 2025
33ba4b4
chore(internal): update pyright exclude list
stainless-app[bot] Aug 27, 2025
34b0dd6
chore(internal): add Sequence related utils
stainless-app[bot] Aug 30, 2025
55083f6
feat(types): replace List[str] with SequenceNotStr in params
stainless-app[bot] Sep 3, 2025
8b5256c
feat: improve future compat with pydantic v3
stainless-app[bot] Sep 4, 2025
074f06d
feat(api): manual updates
stainless-app[bot] Sep 4, 2025
28115fb
feat(api): api update
stainless-app[bot] Sep 4, 2025
e94ddbd
feat(api): api update
stainless-app[bot] Sep 4, 2025
93a1222
codegen metadata
stainless-app[bot] Sep 4, 2025
8b652e7
fix: fix extension types in playwright_extensions
jtoar Sep 5, 2025
4e5429e
codegen metadata
stainless-app[bot] Sep 5, 2025
5893fc6
feat(api): manual updates
stainless-app[bot] Sep 5, 2025
496e1c7
release: 1.5.0-alpha.0
stainless-app[bot] Sep 5, 2025
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
30 changes: 26 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -30,24 +35,40 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
if: github.repository == 'stainless-sdks/browserbase-python'
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/browserbase-python'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/browserbase-python'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand All @@ -58,6 +79,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/browserbase-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.prism.log
.vscode
_dev

__pycache__
Expand Down
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.4.0"
".": "1.5.0-alpha.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 18
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-e2ed1b5267eeff92982918505349017b9155da2c7ab948787ab11cf9068af1b8.yml
openapi_spec_hash: 6639c21dccb52ca610cae833227a9791
config_hash: 74882e23a455dece33e43a27e67f0fbb
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-a9ab6f9017f7645722d220eb8172516a7a5400e86542c28fc7e121adcd1f344f.yml
openapi_spec_hash: e29347aba2697d4efa3dce7794810dbd
config_hash: ec077c0d8cde29588ca4ff30d49575a4
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.importFormat": "relative",
}
74 changes: 74 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,79 @@
# Changelog

## 1.5.0-alpha.0 (2025-09-05)

Full Changelog: [v1.4.0...v1.5.0-alpha.0](https://github.com/browserbase/sdk-python/compare/v1.4.0...v1.5.0-alpha.0)

### Features

* **api:** api update ([e94ddbd](https://github.com/browserbase/sdk-python/commit/e94ddbd8777b97d4e8ab193e1bf3eaad983ecec9))
* **api:** api update ([28115fb](https://github.com/browserbase/sdk-python/commit/28115fb584336dbf5b08043ad8f9cf1d911240ea))
* **api:** api update ([3209287](https://github.com/browserbase/sdk-python/commit/32092872a3d4d48824b4d77d517ffdb06470ad95))
* **api:** api update ([f38e029](https://github.com/browserbase/sdk-python/commit/f38e02981ae0777cb3d922845902b2673dc832fa))
* **api:** api update ([1d9f769](https://github.com/browserbase/sdk-python/commit/1d9f7694bc0d465ce758ddcec41359e9cd1a08ad))
* **api:** api update ([d72f39f](https://github.com/browserbase/sdk-python/commit/d72f39fbe29342cfc77e9b224f2ad0a5a77aaae4))
* **api:** api update ([6d449b3](https://github.com/browserbase/sdk-python/commit/6d449b3deb284a72528877a8729f4cf7a418275d))
* **api:** api update ([8bd5f8b](https://github.com/browserbase/sdk-python/commit/8bd5f8bcca3a2e5baadfc06009546692e63eb744))
* **api:** api update ([1ce99ef](https://github.com/browserbase/sdk-python/commit/1ce99efe89c1d0757ca3100cca8619faa4082f74))
* **api:** api update ([1cbb849](https://github.com/browserbase/sdk-python/commit/1cbb8498bf70c15c001f620b821519216cbadd97))
* **api:** manual updates ([5893fc6](https://github.com/browserbase/sdk-python/commit/5893fc6165cfd88378d6725317e30c7cb6faf8df))
* **api:** manual updates ([074f06d](https://github.com/browserbase/sdk-python/commit/074f06d0dfb08554229348828afd2cc1defe94ee))
* clean up environment call outs ([82c38c4](https://github.com/browserbase/sdk-python/commit/82c38c494a175c1b6b38bab3615916c30ba25d14))
* **client:** add follow_redirects request option ([a8b0b5e](https://github.com/browserbase/sdk-python/commit/a8b0b5e4c6445e0e8c0d3673a090aabab09a50fd))
* **client:** add support for aiohttp ([3516092](https://github.com/browserbase/sdk-python/commit/35160921e262f147cc723a754f14cfd9875603f5))
* **client:** support file upload requests ([2f338f0](https://github.com/browserbase/sdk-python/commit/2f338f009e556ef9be05f49816b17cef138bda17))
* improve future compat with pydantic v3 ([8b5256c](https://github.com/browserbase/sdk-python/commit/8b5256c801e1423a4daf6bf49de7509a32ebfde2))
* **types:** replace List[str] with SequenceNotStr in params ([55083f6](https://github.com/browserbase/sdk-python/commit/55083f678b68020fae835af5cd58e0e5deea2888))


### Bug Fixes

* avoid newer type syntax ([85f597b](https://github.com/browserbase/sdk-python/commit/85f597b34d149138f1b5afdc52062cb131e3a30a))
* **ci:** correct conditional ([a36b873](https://github.com/browserbase/sdk-python/commit/a36b87379b404613673720dd9f498ed76dfe5c3a))
* **ci:** release-doctor — report correct token name ([61b97ff](https://github.com/browserbase/sdk-python/commit/61b97fff5ea92bade293c5f5f4a84b0d991375e7))
* **client:** correctly parse binary response | stream ([9614c4c](https://github.com/browserbase/sdk-python/commit/9614c4c05bc57ea60100aec9a194aee7a39e701b))
* **client:** don't send Content-Type header on GET requests ([c4c4185](https://github.com/browserbase/sdk-python/commit/c4c4185de32b28c09565b6fe84efd65fd411abb9))
* fix extension types in playwright_extensions ([8b652e7](https://github.com/browserbase/sdk-python/commit/8b652e78be1493d03e13d2a116cbc6969a880e58))
* **parsing:** correctly handle nested discriminated unions ([d020678](https://github.com/browserbase/sdk-python/commit/d0206786894ecfb22e0924edb8a227414b17788d))
* **parsing:** ignore empty metadata ([118c4d4](https://github.com/browserbase/sdk-python/commit/118c4d41bda811d2d942793d8ab029b272c7a5c6))
* **parsing:** parse extra field types ([c7ef875](https://github.com/browserbase/sdk-python/commit/c7ef87549e324fb06fab945e1754ef7b56b30031))
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([e298407](https://github.com/browserbase/sdk-python/commit/e2984077537fd6dee0191329a083ad0ccf9fd76f))


### Chores

* **ci:** change upload type ([e42da7c](https://github.com/browserbase/sdk-python/commit/e42da7c1fed216ff2b15223c49f1111bc0ef16e5))
* **ci:** enable for pull requests ([03a6db7](https://github.com/browserbase/sdk-python/commit/03a6db72e98bf1606bf68928b2ac5029cba088df))
* **ci:** only run for pushes and fork pull requests ([c8cb51f](https://github.com/browserbase/sdk-python/commit/c8cb51f311f4d39863127fab189c95d84a186bc6))
* **docs:** grammar improvements ([f32a9e2](https://github.com/browserbase/sdk-python/commit/f32a9e258a9b0b4d29c24137d5a7207907f00f9b))
* **docs:** remove reference to rye shell ([07d129a](https://github.com/browserbase/sdk-python/commit/07d129a04211037d123b06d36347741960e75323))
* **docs:** remove unnecessary param examples ([62209dc](https://github.com/browserbase/sdk-python/commit/62209dcac034f40ac8b3b8a119e532201a227680))
* **internal:** add Sequence related utils ([34b0dd6](https://github.com/browserbase/sdk-python/commit/34b0dd6b4297fafc2bcb9e8243c8d3c2e2e435fc))
* **internal:** bump pinned h11 dep ([5e3270d](https://github.com/browserbase/sdk-python/commit/5e3270da2e4f41efdd345d073a42d6791eb22a84))
* **internal:** change ci workflow machines ([14c0ac4](https://github.com/browserbase/sdk-python/commit/14c0ac49a6d9d42f5401a5c24ddb8586b3998fb2))
* **internal:** codegen related update ([f979aff](https://github.com/browserbase/sdk-python/commit/f979aff605c0d74efb561e0b169ad39b486ab5a0))
* **internal:** codegen related update ([12de9f3](https://github.com/browserbase/sdk-python/commit/12de9f324fbb40bec91cd7c6b16af1440c4f7373))
* **internal:** codegen related update ([c4157cb](https://github.com/browserbase/sdk-python/commit/c4157cb8470b1d0ca67e6757f4fe9146a630cc82))
* **internal:** codegen related update ([ccb2c95](https://github.com/browserbase/sdk-python/commit/ccb2c95002bb6a38e1eb8b9a84e4a335d5ee1a13))
* **internal:** fix ruff target version ([e6a3df4](https://github.com/browserbase/sdk-python/commit/e6a3df40564b4ba3d23514e0b42221010d465bf6))
* **internal:** update comment in script ([a7aec17](https://github.com/browserbase/sdk-python/commit/a7aec17c02632684dfeb7759dd6a5322efe092ce))
* **internal:** update conftest.py ([5d3a2b1](https://github.com/browserbase/sdk-python/commit/5d3a2b1906ca5fca5c84c6d6684a8a62b6700479))
* **internal:** update pyright exclude list ([33ba4b4](https://github.com/browserbase/sdk-python/commit/33ba4b47ddeb8c0aa19a11f35a7cea9aa9a0966d))
* **package:** mark python 3.13 as supported ([2450b8e](https://github.com/browserbase/sdk-python/commit/2450b8eb2349adde689febd09269915d41e7a590))
* **project:** add settings file for vscode ([a406241](https://github.com/browserbase/sdk-python/commit/a4062413b2fce397d59ea9ceaec7ed0565880fe2))
* **readme:** fix version rendering on pypi ([a8afe1a](https://github.com/browserbase/sdk-python/commit/a8afe1a67c48080ef202cac88da9b5d59534799a))
* **readme:** update badges ([869a3f4](https://github.com/browserbase/sdk-python/commit/869a3f4dd7e6f19225b697aeee89ce98a2174c0a))
* **tests:** add tests for httpx client instantiation & proxies ([9c5d88c](https://github.com/browserbase/sdk-python/commit/9c5d88cb4cbbda5aa618cba2f5217bacd4a228cc))
* **tests:** run tests in parallel ([94308de](https://github.com/browserbase/sdk-python/commit/94308dea065f54268145b175a13e0dbfd2a9cc81))
* **tests:** skip some failing tests on the latest python versions ([7bc40f0](https://github.com/browserbase/sdk-python/commit/7bc40f068d290a479a0d4070ef54e8f8c4ef598d))
* update @stainless-api/prism-cli to v5.15.0 ([b48933b](https://github.com/browserbase/sdk-python/commit/b48933b2f68eafaa554662eb7f41bf960a74d8b6))
* update github action ([d57dc03](https://github.com/browserbase/sdk-python/commit/d57dc0398b083556ed7ceee265efcf282062005d))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([4bbda56](https://github.com/browserbase/sdk-python/commit/4bbda56cdb4adf677f67011f42f5c3e324a5f60e))

## 1.4.0 (2025-05-16)

Full Changelog: [v1.3.0...v1.4.0](https://github.com/browserbase/sdk-python/compare/v1.3.0...v1.4.0)
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ $ rye sync --all-features
You can then run scripts using `rye run python script.py` or by activating the virtual environment:

```sh
$ rye shell
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate

# now you can omit the `rye run` prefix
Expand Down
72 changes: 38 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Browserbase Python API library

[![PyPI version](https://img.shields.io/pypi/v/browserbase.svg)](https://pypi.org/project/browserbase/)
<!-- prettier-ignore -->
[![PyPI version](https://img.shields.io/pypi/v/browserbase.svg?label=pypi%20(stable))](https://pypi.org/project/browserbase/)

The Browserbase Python library provides convenient access to the Browserbase REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand All @@ -16,7 +17,7 @@ The REST API documentation can be found on [docs.browserbase.com](https://docs.b

```sh
# install from PyPI
pip install browserbase
pip install --pre browserbase
```

## Usage
Expand Down Expand Up @@ -81,6 +82,39 @@ rye run example playwright_basic # replace with the example you want to run
> [!NOTE]
> Make sure you have a `.env` file that matches the [.env.example](.env.example) file in the root of this repository.

### With aiohttp

By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.

You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install --pre browserbase[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import asyncio
from browserbase import DefaultAioHttpClient
from browserbase import AsyncBrowserbase


async def main() -> None:
async with AsyncBrowserbase(
api_key="My API Key",
http_client=DefaultAioHttpClient(),
) as client:
session = await client.sessions.create(
project_id="your_project_id",
)
print(session.id)


asyncio.run(main())
```

## Using types

Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
Expand All @@ -101,37 +135,7 @@ client = Browserbase()

session = client.sessions.create(
project_id="projectId",
browser_settings={
"advanced_stealth": True,
"block_ads": True,
"captcha_image_selector": "captchaImageSelector",
"captcha_input_selector": "captchaInputSelector",
"context": {
"id": "id",
"persist": True,
},
"extension_id": "extensionId",
"fingerprint": {
"browsers": ["chrome"],
"devices": ["desktop"],
"http_version": "1",
"locales": ["string"],
"operating_systems": ["android"],
"screen": {
"max_height": 0,
"max_width": 0,
"min_height": 0,
"min_width": 0,
},
},
"log_session": True,
"record_session": True,
"solve_captchas": True,
"viewport": {
"height": 0,
"width": 0,
},
},
browser_settings={},
)
print(session.browser_settings)
```
Expand Down Expand Up @@ -222,7 +226,7 @@ client.with_options(max_retries=5).sessions.create(
### Timeouts

By default requests time out after 1 minute. You can configure this with a `timeout` option,
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:

```python
from browserbase import Browserbase
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Browserbase please follow the respective company's security reporting guidelines.
or products provided by Browserbase, please follow the respective company's security reporting guidelines.

### Browserbase Terms and Policies

Please contact [email protected] for any questions or concerns regarding security of our services.
Please contact [email protected] for any questions or concerns regarding the security of our services.

---

Expand Down
Loading