You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Align Task Filtering by Status with `status` Field ([29b4590](https://github.com/browser-use/browser-use-python/commit/29b4590c69f13fbf7f855888862ef77a9e704172))
11
+
***api:** api update ([5867532](https://github.com/browser-use/browser-use-python/commit/58675327b6a0e7ba41f312e4887062a9b6dc2852))
* Update param and response views ([44b4c5d](https://github.com/browser-use/browser-use-python/commit/44b4c5d7ed416f9f5c37afb3287cdaa6f22a30cd))
16
+
17
+
18
+
### Chores
19
+
20
+
***internal:** codegen related update ([151d56b](https://github.com/browser-use/browser-use-python/commit/151d56ba67c2d09970ff415472c0a1d259716bbc))
21
+
3
22
## 0.0.2 (2025-08-09)
4
23
5
24
Full Changelog: [v0.0.1...v0.0.2](https://github.com/browser-use/browser-use-python/compare/v0.0.1...v0.0.2)
Copy file name to clipboardExpand all lines: README.md
+37-37Lines changed: 37 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,14 +26,14 @@ The full API of this library can be found in [api.md](api.md).
26
26
27
27
```python
28
28
import os
29
-
frombrowser_useimport BrowserUse
29
+
frombrowser_use_sdkimport BrowserUse
30
30
31
31
client = BrowserUse(
32
32
api_key=os.environ.get("BROWSER_USE_API_KEY"), # This is the default and can be omitted
33
33
)
34
34
35
-
tasks= client.tasks.list()
36
-
print(tasks.items)
35
+
me= client.users.me.retrieve()
36
+
print(me.additional_credits_balance_usd)
37
37
```
38
38
39
39
While you can provide an `api_key` keyword argument,
@@ -48,16 +48,16 @@ Simply import `AsyncBrowserUse` instead of `BrowserUse` and use `await` with eac
48
48
```python
49
49
import os
50
50
import asyncio
51
-
frombrowser_useimport AsyncBrowserUse
51
+
frombrowser_use_sdkimport AsyncBrowserUse
52
52
53
53
client = AsyncBrowserUse(
54
54
api_key=os.environ.get("BROWSER_USE_API_KEY"), # This is the default and can be omitted
55
55
)
56
56
57
57
58
58
asyncdefmain() -> None:
59
-
tasks=await client.tasks.list()
60
-
print(tasks.items)
59
+
me=await client.users.me.retrieve()
60
+
print(me.additional_credits_balance_usd)
61
61
62
62
63
63
asyncio.run(main())
@@ -80,17 +80,17 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
80
80
81
81
```python
82
82
import asyncio
83
-
frombrowser_useimport DefaultAioHttpClient
84
-
frombrowser_useimport AsyncBrowserUse
83
+
frombrowser_use_sdkimport DefaultAioHttpClient
84
+
frombrowser_use_sdkimport AsyncBrowserUse
85
85
86
86
87
87
asyncdefmain() -> None:
88
88
asyncwith AsyncBrowserUse(
89
89
api_key="My API Key",
90
90
http_client=DefaultAioHttpClient(),
91
91
) as client:
92
-
tasks=await client.tasks.list()
93
-
print(tasks.items)
92
+
me=await client.users.me.retrieve()
93
+
print(me.additional_credits_balance_usd)
94
94
95
95
96
96
asyncio.run(main())
@@ -110,40 +110,40 @@ Typed requests and responses provide autocomplete and documentation within your
110
110
Nested parameters are dictionaries, typed using `TypedDict`, for example:
111
111
112
112
```python
113
-
frombrowser_useimport BrowserUse
113
+
frombrowser_use_sdkimport BrowserUse
114
114
115
115
client = BrowserUse()
116
116
117
-
task_view= client.tasks.create(
117
+
task= client.tasks.create(
118
118
task="x",
119
119
agent_settings={},
120
120
)
121
-
print(task_view.agent_settings)
121
+
print(task.agent_settings)
122
122
```
123
123
124
124
## Handling errors
125
125
126
-
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.
126
+
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.
127
127
128
128
When the API returns a non-success status code (that is, 4xx or 5xx
129
-
response), a subclass of `browser_use.APIStatusError` is raised, containing `status_code` and `response` properties.
129
+
response), a subclass of `browser_use_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
130
130
131
-
All errors inherit from `browser_use.APIError`.
131
+
All errors inherit from `browser_use_sdk.APIError`.
132
132
133
133
```python
134
-
importbrowser_use
135
-
frombrowser_useimport BrowserUse
134
+
importbrowser_use_sdk
135
+
frombrowser_use_sdkimport BrowserUse
136
136
137
137
client = BrowserUse()
138
138
139
139
try:
140
-
client.tasks.list()
141
-
exceptbrowser_use.APIConnectionError as e:
140
+
client.users.me.retrieve()
141
+
exceptbrowser_use_sdk.APIConnectionError as e:
142
142
print("The server could not be reached")
143
143
print(e.__cause__) # an underlying Exception, likely raised within httpx.
144
-
exceptbrowser_use.RateLimitError as e:
144
+
exceptbrowser_use_sdk.RateLimitError as e:
145
145
print("A 429 status code was received; we should back off a bit.")
146
-
exceptbrowser_use.APIStatusError as e:
146
+
exceptbrowser_use_sdk.APIStatusError as e:
147
147
print("Another non-200-range status code was received")
148
148
print(e.status_code)
149
149
print(e.response)
@@ -171,7 +171,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
171
171
You can use the `max_retries` option to configure or disable retry settings:
task= response.parse() # get the object that `tasks.list()` would have returned
251
-
print(task.items)
250
+
me= response.parse() # get the object that `users.me.retrieve()` would have returned
251
+
print(me.additional_credits_balance_usd)
252
252
```
253
253
254
-
These methods return an [`APIResponse`](https://github.com/browser-use/browser-use-python/tree/main/src/browser_use/_response.py) object.
254
+
These methods return an [`APIResponse`](https://github.com/browser-use/browser-use-python/tree/main/src/browser_use_sdk/_response.py) object.
255
255
256
-
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.
256
+
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.
257
257
258
258
#### `.with_streaming_response`
259
259
@@ -262,7 +262,7 @@ The above interface eagerly reads the full response body when you make the reque
262
262
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.
263
263
264
264
```python
265
-
with client.tasks.with_streaming_response.list() as response:
265
+
with client.users.me.with_streaming_response.retrieve() as response:
266
266
print(response.headers.get("X-My-Header"))
267
267
268
268
for line in response.iter_lines():
@@ -315,7 +315,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
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.
339
339
340
340
```py
341
-
frombrowser_useimport BrowserUse
341
+
frombrowser_use_sdkimport BrowserUse
342
342
343
343
with BrowserUse() as client:
344
344
# make requests here
@@ -366,8 +366,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
366
366
You can determine the version that is being used at runtime with:
0 commit comments