{"id":30730588,"url":"https://github.com/browser-use/browser-use-python","last_synced_at":"2026-01-30T05:13:12.274Z","repository":{"id":310980026,"uuid":"1035173685","full_name":"browser-use/browser-use-python","owner":"browser-use","description":"Browser Use Python SDK","archived":false,"fork":false,"pushed_at":"2026-01-15T02:30:02.000Z","size":614,"stargazers_count":12,"open_issues_count":2,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-15T08:39:18.448Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browser-use.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-09T20:12:15.000Z","updated_at":"2026-01-15T02:30:06.000Z","dependencies_parsed_at":"2025-12-06T08:07:18.876Z","dependency_job_id":null,"html_url":"https://github.com/browser-use/browser-use-python","commit_stats":null,"previous_names":["browser-use/browser-use-python"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/browser-use/browser-use-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browser-use%2Fbrowser-use-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browser-use%2Fbrowser-use-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browser-use%2Fbrowser-use-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browser-use%2Fbrowser-use-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browser-use","download_url":"https://codeload.github.com/browser-use/browser-use-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browser-use%2Fbrowser-use-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28904941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T04:02:34.702Z","status":"ssl_error","status_checked_at":"2026-01-30T04:02:33.562Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-03T16:37:47.759Z","updated_at":"2026-01-30T05:13:12.251Z","avatar_url":"https://github.com/browser-use.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/browser-use/browser-use-python/refs/heads/main/assets/cloud-banner-python.png\" alt=\"Browser Use Python\" width=\"full\"/\u003e\n\n# BrowserUse Python Library\n\n[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github\u0026utm_medium=github\u0026utm_campaign=readme\u0026utm_source=https%3A%2F%2Fgithub.com%2Fbrowser-use%2Fbrowser-use-python)\n[![pypi](https://img.shields.io/pypi/v/browser-use)](https://pypi.python.org/pypi/browser-use)\n\nThe BrowserUse Python library provides convenient access to the BrowserUse APIs from Python.\n\n## Three-Step QuickStart\n\n1. 📦 Install Browser Use SDK\n\n   ```sh\n   # PIP\n   pip install browser-use-sdk\n\n   # Poetry\n   poetry add browser-use-sdk\n\n   # UV\n   uv add browser-use-sdk\n   ```\n\n1. 🔑 Get your API Key at [Browser Use Cloud](https://cloud.browser-use.com)!\n\n1. 🦄 Automate the Internet!\n\n   ```python\n   from browser_use_sdk import BrowserUse\n\n   client = BrowserUse(api_key=\"bu_...\")\n\n   task = client.tasks.create_task(\n       task=\"Search for the top 10 Hacker News posts and return the title and url.\",\n       llm=\"gpt-4.1\"\n   )\n\n   result = task.complete()\n\n   result.output\n   ```\n\n\u003e The full API of this library can be found in [api.md](api.md).\n\n## Structured Output with Pydantic\n\nBrowser Use Python SDK provides first class support for Pydantic models.\n\n```py\nfrom browser_use_sdk import AsyncBrowserUse\n\nclient = AsyncBrowserUse(api_key=API_KEY)\n\nclass HackerNewsPost(BaseModel):\n    title: str\n    url: str\n\nclass SearchResult(BaseModel):\n    posts: List[HackerNewsPost]\n\nasync def main() -\u003e None:\n    task = await client.tasks.create_task(\n        task=\"\"\"\n        Find top 10 Hacker News articles and return the title and url.\n        \"\"\",\n        schema=SearchResult,\n    )\n\n    result = await task.complete()\n\n    if result.parsed_output is not None:\n        print(\"Top HackerNews Posts:\")\n        for post in result.parsed_output.posts:\n            print(f\" - {post.title} - {post.url}\")\n\nasyncio.run(main())\n```\n\n## Streaming Updates with Async Iterators\n\n\u003e When presenting a long running task you might want to show updates as they happen.\n\nBrowser Use SDK exposes a `.stream` method that lets you subscribe to a sync or an async generator that automatically polls Browser Use Cloud servers and emits a new event when an update happens (e.g., live url becomes available, agent takes a new step, or agent completes the task).\n\n```py\nclass HackerNewsPost(BaseModel):\n    title: str\n    url: str\n\nclass SearchResult(BaseModel):\n    posts: List[HackerNewsPost]\n\n\nasync def main() -\u003e None:\n    task = await client.tasks.create_task(\n        task=\"\"\"\n        Find top 10 Hacker News articles and return the title and url.\n        \"\"\",\n        schema=SearchResult,\n    )\n\n    async for step in task.stream():\n        print(f\"Step {step.number}: {step.url} ({step.next_goal})\")\n\n    result = await task.complete()\n\n    if result.parsed_output is not None:\n        print(\"Top HackerNews Posts:\")\n        for post in result.parsed_output.posts:\n            print(f\" - {post.title} - {post.url}\")\n\nasyncio.run(main())\n```\n\n## Verifying Webhook Events\n\n\u003e You can configure Browser Use Cloud to emit Webhook events and process them easily with Browser Use Python SDK.\n\nBrowser Use SDK lets you easily verify the signature and structure of the payload you receive in the webhook.\n\n```py\nimport uvicorn\nimport os\nfrom browser_use_sdk import Webhook, verify_webhook_event_signature\n\nfrom fastapi import FastAPI, Request, HTTPException\n\napp = FastAPI()\n\nSECRET_KEY = os.environ['SECRET_KEY']\n\n@app.post('/webhook')\nasync def webhook(request: Request):\n    body = await request.json()\n\n    timestamp = request.headers.get('X-Browser-Use-Timestamp')\n    signature = request.headers.get('X-Browser-Use-Signature')\n\n    verified_webhook: Webhook = verify_webhook_event_signature(\n        body=body,\n        timestamp=timestamp,\n        secret=SECRET_KEY,\n        expected_signature=signature,\n    )\n\n    if verified_webhook is not None:\n        print('Webhook received:', verified_webhook)\n    else:\n        print('Invalid webhook received')\n\n    return {'status': 'success', 'message': 'Webhook received'}\n\nif __name__ == '__main__':\n    uvicorn.run(app, host='0.0.0.0', port=8080)\n```\n\n## Async usage\n\nSimply import `AsyncBrowserUse` instead of `BrowserUse` and use `await` with each API call:\n\n```python\nimport os\nimport asyncio\nfrom browser_use_sdk import AsyncBrowserUse\n\nclient = AsyncBrowserUse(\n    api_key=os.environ.get(\"BROWSER_USE_API_KEY\"),  # This is the default and can be omitted\n)\n\n\nasync def main() -\u003e None:\n    task = await client.tasks.create_task(\n        task=\"Search for the top 10 Hacker News posts and return the title and url.\",\n    )\n\n    print(task.id)\n\n\nasyncio.run(main())\n```\n\n## Requirements\n\nPython 3.8 or higher.\n\n## Contributing\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nAdditions made directly to this library would have to be moved over to our generation code,\notherwise they would be overwritten upon the next generated release. Feel free to open a PR as\na proof of concept, but know that we will not be able to merge it as-is. We suggest opening\nan issue first to discuss with us!\n\nOn the other hand, contributions to the README are always very welcome!\n\n## Reference\n\nA full reference for this library is available [here](https://github.com/browser-use/browser-use-python/blob/HEAD/./reference.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowser-use%2Fbrowser-use-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowser-use%2Fbrowser-use-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowser-use%2Fbrowser-use-python/lists"}