Skip to main content
Spin up N concurrent sessions with the same profileId and proxyCountryCode — they all share the same login state (cookies). Useful when you need to parallelize work across an authenticated site.
import asyncio
from browser_use_sdk import AsyncBrowserUse

profile_id = "your-profile-id"
proxy_country_code = "us"

tasks = [
    "Go to the analytics dashboard and export the weekly report",
    "Go to the team settings and list all members",
    "Go to the billing page and get the current plan details",
]

async def run_task(client, instruction):
    session = await client.sessions.create(
        profile_id=profile_id,
        proxy_country_code=proxy_country_code,
    )
    try:
        return await client.run(instruction, session_id=session.id)
    finally:
        await client.sessions.stop(session.id)

async def main():
    client = AsyncBrowserUse()
    results = await asyncio.gather(*[run_task(client, t) for t in tasks])
    for r in results:
        print(r.output)

asyncio.run(main())
Profile state is read from a snapshot when each session starts. Concurrent sessions won’t see changes made by other sessions until the profile is saved and reloaded. This works well for read-heavy tasks but may not suit workflows that modify profile state.
Combine with structured output to extract typed data from each parallel task.