from browser_use_sdk.v3 import AsyncBrowserUse
client = AsyncBrowserUse()
profile = await client.profiles.create(name="user-id-1")
# or search existing
# profile = (await client.profiles.list(query="user-id-1")).items[0]
session = await client.sessions.create(profile_id=profile.id)
result = await client.run("Check browser-use github stars", session_id=session.id)
print(result.output)
# Always stop the session to persist profile state
await client.sessions.stop(session.id)
View your profile IDs at cloud.browser-use.com/settings.
Manage profiles
# Create
profile = await client.profiles.create(name="work-account")
# List all
response = await client.profiles.list()
for p in response.items:
print(p.id, p.name)
# Search by name
response = await client.profiles.list(query="user-id-1")
profile = response.items[0] # first match
# Get one by ID
profile = await client.profiles.get(profile_id)
# Update
await client.profiles.update(profile_id, name="renamed")
# Delete
await client.profiles.delete(profile_id)
Usage patterns
- Per-user profiles: Create one profile per end-user. Query by name to get the profile ID, or store a mapping between your users and their profile IDs in your database.
Profile state is only saved when the session ends. Always call sessions.stop() when you are done — if a session is left open or times out, changes may not be persisted. Every code path that uses a profile must stop the session, including error handlers.