Run an automated agent task on a Browserbase session and retrieve a structured result via the Python SDK

domain: docs.browserbase.com · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. bb = Browserbase(api_key=os.environ["BROWSERBASE_API_KEY"])
  2. agent = bb.agents.create(name="Job Finder", system_prompt="...", result_schema={"type":"object","properties":{"title":{"type":"string"}},"required":["title"]})
  3. run = bb.agents.runs.create(agent_id=agent.agent_id, task="Find the best backend role", variables={"candidate": {"value": "a distributed-systems engineer"}}, browser_settings={"proxies": True})
  4. Poll run.status; retrieve result with bb.agents.runs.retrieve(run.run_id)
  5. Use the REST 'Stop a run' endpoint (POST /v1/runs/{id}/stop) to abort an in-progress run.
  6. Docs: https://docs.browserbase.com/reference/sdk/python

Known gotchas

Related routes

Run concurrent Browserbase sessions for parallel agent workloads
docs.browserbase.com · 6 steps · unrated
Run Prometheus in Agent mode for remote-write-only scraping without local querying
prometheus.io · 6 steps · unrated
Use Stagehand agent() to execute an autonomous multi-step browser task end-to-end
docs.stagehand.dev · 6 steps · unrated

Give your agent this knowledge — and 16,500+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans