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 @@
{
".": "0.0.2"
".": "0.1.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: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-86040fd18419e7b4e0947660d9c0ff1abe21550528d2d2a549736cd16f85a92d.yml
openapi_spec_hash: 7c5de9d0f633db35fd9e250fcc834d1f
config_hash: 771e55285d36ab0c796ac0f29840fa8f
configured_endpoints: 26
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-3a9488448292a0736b08b2d6427e702eaf7106d86345ca2e65b64bed4398b036.yml
openapi_spec_hash: 5ff2781dcc11a0c9aa353f5cb14bcc16
config_hash: 9d52be5177b2ede4cb0633c04f4cc4ef
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.1.0 (2025-08-18)

Full Changelog: [v0.0.2...v0.1.0](https://github.com/browser-use/browser-use-python/compare/v0.0.2...v0.1.0)

### Features

* Add start_url ([2ede0a9](https://github.com/browser-use/browser-use-python/commit/2ede0a9089bfbba1eca207508a52ee36b4ef18ac))
* Align Task Filtering by Status with `status` Field ([29b4590](https://github.com/browser-use/browser-use-python/commit/29b4590c69f13fbf7f855888862ef77a9e704172))
* **api:** api update ([5867532](https://github.com/browser-use/browser-use-python/commit/58675327b6a0e7ba41f312e4887062a9b6dc2852))
* **api:** manual updates ([78727c0](https://github.com/browser-use/browser-use-python/commit/78727c02cefa53fd0dd877e137b7b6f92e14fce8))
* **api:** update via SDK Studio ([b283386](https://github.com/browser-use/browser-use-python/commit/b283386b805435a87114e807f8919185cb6a5b7b))
* Fix Stainless GitHub Action ([5dcf360](https://github.com/browser-use/browser-use-python/commit/5dcf360ccfe40f45962ecaa64b8a5aacf55778d4))
* Update param and response views ([44b4c5d](https://github.com/browser-use/browser-use-python/commit/44b4c5d7ed416f9f5c37afb3287cdaa6f22a30cd))


### Chores

* **internal:** codegen related update ([151d56b](https://github.com/browser-use/browser-use-python/commit/151d56ba67c2d09970ff415472c0a1d259716bbc))

## 0.0.2 (2025-08-09)

Full Changelog: [v0.0.1...v0.0.2](https://github.com/browser-use/browser-use-python/compare/v0.0.1...v0.0.2)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ pip install -r requirements-dev.lock

Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
result in merge conflicts between manual patches and changes from the generator. The generator will never
modify the contents of the `src/browser_use/lib/` and `examples/` directories.
modify the contents of the `src/browser_use_sdk/lib/` and `examples/` directories.

## Adding and running examples

Expand Down
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ The full API of this library can be found in [api.md](api.md).

```python
import os
from browser_use import BrowserUse
from browser_use_sdk import BrowserUse

client = BrowserUse(
api_key=os.environ.get("BROWSER_USE_API_KEY"), # This is the default and can be omitted
)

tasks = client.tasks.list()
print(tasks.items)
me = client.users.me.retrieve()
print(me.additional_credits_balance_usd)
```

While you can provide an `api_key` keyword argument,
Expand All @@ -48,16 +48,16 @@ Simply import `AsyncBrowserUse` instead of `BrowserUse` and use `await` with eac
```python
import os
import asyncio
from browser_use import AsyncBrowserUse
from browser_use_sdk import AsyncBrowserUse

client = AsyncBrowserUse(
api_key=os.environ.get("BROWSER_USE_API_KEY"), # This is the default and can be omitted
)


async def main() -> None:
tasks = await client.tasks.list()
print(tasks.items)
me = await client.users.me.retrieve()
print(me.additional_credits_balance_usd)


asyncio.run(main())
Expand All @@ -80,17 +80,17 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH

```python
import asyncio
from browser_use import DefaultAioHttpClient
from browser_use import AsyncBrowserUse
from browser_use_sdk import DefaultAioHttpClient
from browser_use_sdk import AsyncBrowserUse


async def main() -> None:
async with AsyncBrowserUse(
api_key="My API Key",
http_client=DefaultAioHttpClient(),
) as client:
tasks = await client.tasks.list()
print(tasks.items)
me = await client.users.me.retrieve()
print(me.additional_credits_balance_usd)


asyncio.run(main())
Expand All @@ -110,40 +110,40 @@ Typed requests and responses provide autocomplete and documentation within your
Nested parameters are dictionaries, typed using `TypedDict`, for example:

```python
from browser_use import BrowserUse
from browser_use_sdk import BrowserUse

client = BrowserUse()

task_view = client.tasks.create(
task = client.tasks.create(
task="x",
agent_settings={},
)
print(task_view.agent_settings)
print(task.agent_settings)
```

## Handling errors

When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `browser_use.APIConnectionError` is raised.
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `browser_use_sdk.APIConnectionError` is raised.

When the API returns a non-success status code (that is, 4xx or 5xx
response), a subclass of `browser_use.APIStatusError` is raised, containing `status_code` and `response` properties.
response), a subclass of `browser_use_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.

All errors inherit from `browser_use.APIError`.
All errors inherit from `browser_use_sdk.APIError`.

```python
import browser_use
from browser_use import BrowserUse
import browser_use_sdk
from browser_use_sdk import BrowserUse

client = BrowserUse()

try:
client.tasks.list()
except browser_use.APIConnectionError as e:
client.users.me.retrieve()
except browser_use_sdk.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
except browser_use.RateLimitError as e:
except browser_use_sdk.RateLimitError as e:
print("A 429 status code was received; we should back off a bit.")
except browser_use.APIStatusError as e:
except browser_use_sdk.APIStatusError as e:
print("Another non-200-range status code was received")
print(e.status_code)
print(e.response)
Expand Down Expand Up @@ -171,7 +171,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
You can use the `max_retries` option to configure or disable retry settings:

```python
from browser_use import BrowserUse
from browser_use_sdk import BrowserUse

# Configure the default for all requests:
client = BrowserUse(
Expand All @@ -180,7 +180,7 @@ client = BrowserUse(
)

# Or, configure per-request:
client.with_options(max_retries=5).tasks.list()
client.with_options(max_retries=5).users.me.retrieve()
```

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

```python
from browser_use import BrowserUse
from browser_use_sdk import BrowserUse

# Configure the default for all requests:
client = BrowserUse(
Expand All @@ -203,7 +203,7 @@ client = BrowserUse(
)

# Override per-request:
client.with_options(timeout=5.0).tasks.list()
client.with_options(timeout=5.0).users.me.retrieve()
```

On timeout, an `APITimeoutError` is thrown.
Expand Down Expand Up @@ -241,19 +241,19 @@ if response.my_field is None:
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

```py
from browser_use import BrowserUse
from browser_use_sdk import BrowserUse

client = BrowserUse()
response = client.tasks.with_raw_response.list()
response = client.users.me.with_raw_response.retrieve()
print(response.headers.get('X-My-Header'))

task = response.parse() # get the object that `tasks.list()` would have returned
print(task.items)
me = response.parse() # get the object that `users.me.retrieve()` would have returned
print(me.additional_credits_balance_usd)
```

These methods return an [`APIResponse`](https://github.com/browser-use/browser-use-python/tree/main/src/browser_use/_response.py) object.
These methods return an [`APIResponse`](https://github.com/browser-use/browser-use-python/tree/main/src/browser_use_sdk/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/browser-use/browser-use-python/tree/main/src/browser_use/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
The async client returns an [`AsyncAPIResponse`](https://github.com/browser-use/browser-use-python/tree/main/src/browser_use_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

#### `.with_streaming_response`

Expand All @@ -262,7 +262,7 @@ The above interface eagerly reads the full response body when you make the reque
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

```python
with client.tasks.with_streaming_response.list() as response:
with client.users.me.with_streaming_response.retrieve() as response:
print(response.headers.get("X-My-Header"))

for line in response.iter_lines():
Expand Down Expand Up @@ -315,7 +315,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c

```python
import httpx
from browser_use import BrowserUse, DefaultHttpxClient
from browser_use_sdk import BrowserUse, DefaultHttpxClient

client = BrowserUse(
# Or use the `BROWSER_USE_BASE_URL` env var
Expand All @@ -338,7 +338,7 @@ client.with_options(http_client=DefaultHttpxClient(...))
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.

```py
from browser_use import BrowserUse
from browser_use_sdk import BrowserUse

with BrowserUse() as client:
# make requests here
Expand Down Expand Up @@ -366,8 +366,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
You can determine the version that is being used at runtime with:

```py
import browser_use
print(browser_use.__version__)
import browser_use_sdk
print(browser_use_sdk.__version__)
```

## Requirements
Expand Down
Loading