{"id":31264268,"url":"https://github.com/platonai/browser4","last_synced_at":"2026-06-05T12:00:30.459Z","repository":{"id":31399675,"uuid":"124882400","full_name":"platonai/Browser4","owner":"platonai","description":"Browser4: a lightning-fast, coroutine-safe browser for your AI.","archived":false,"fork":false,"pushed_at":"2026-05-30T10:53:58.000Z","size":64199,"stargazers_count":1056,"open_issues_count":44,"forks_count":142,"subscribers_count":18,"default_branch":"main","last_synced_at":"2026-05-30T12:14:20.418Z","etag":null,"topics":["agentic-ai","agentic-browser","ai-browser","browser-agent","browser-infra","browser-use-agent"],"latest_commit_sha":null,"homepage":"https://browser4.io","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/platonai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2018-03-12T12:00:26.000Z","updated_at":"2026-05-29T18:26:42.000Z","dependencies_parsed_at":"2023-12-21T09:27:41.833Z","dependency_job_id":"212a0799-f3fe-4a4e-a0e6-6e27893b048b","html_url":"https://github.com/platonai/Browser4","commit_stats":null,"previous_names":["platonai/pulsarr","platonai/pulsar","platonai/browser4","platonai/pulsarrpa"],"tags_count":210,"template":false,"template_full_name":null,"purl":"pkg:github/platonai/Browser4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platonai%2FBrowser4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platonai%2FBrowser4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platonai%2FBrowser4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platonai%2FBrowser4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/platonai","download_url":"https://codeload.github.com/platonai/Browser4/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/platonai%2FBrowser4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33939227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["agentic-ai","agentic-browser","ai-browser","browser-agent","browser-infra","browser-use-agent"],"created_at":"2025-09-23T13:01:39.270Z","updated_at":"2026-06-05T12:00:30.408Z","avatar_url":"https://github.com/platonai.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# 🤖 Browser4\n\n[![License: APACHE2](https://img.shields.io/badge/license-APACHE2-green?style=flat-square)](https://github.com/platonai/browser4/blob/main/LICENSE)\n\n---\n\nEnglish | [简体中文](README.zh.md) | [中国镜像](https://gitee.com/platonai_galaxyeye/Browser4)\n\n\u003c!-- TOC --\u003e\n**Table of Contents**\n- [🤖 Browser4](#-browser4)\n    - [🌟 Introduction](#-introduction)\n        - [✨ Key Capabilities](#-key-capabilities)\n    - [💡 Usage Examples](#-usage-examples)\n        - [Quick Start](#quick-start)\n        - [CLI \\\u0026 SKILLS](#cli--skills)\n    - [Advanced commands](#advanced-commands)\n        - [Agent and Swarm CLI](#agent-and-swarm-cli)\n    - [🚀 Native API Quick Start](#-native-api-quick-start)\n        - [Auto Extraction](#auto-extraction)\n    - [📦 Modules Overview](#-modules-overview)\n    - [🤝 Support \\\u0026 Community](#-support--community)\n    - [📜 Documentation](#-documentation)\n    - [🔧 Proxy Configuration - Unblock Website Access](#-proxy-configuration---unblock-website-access)\n    - [License](#license)\n\u003c!-- /TOC --\u003e\n\n## 🌟 Introduction\n\n💖 **Browser4: a lightning-fast, coroutine-safe browser engine for your AI** 💖\n\n### ✨ Key Capabilities\n\n* 👽 **Browser Agents** — Fully autonomous browser agents that reason, plan, and execute end-to-end tasks.\n* 🤖 **Browser Automation** — High-performance automation for workflows, navigation, and data extraction.\n* ⚙️ **Machine Learning Agent** - Learns field structures across complex pages without consuming tokens.\n* ⚡  **Extreme Performance** — Fully coroutine-safe; supports 100k ~ 200k complex page visits per machine per day.\n* 🧬 **Data Extraction** — Hybrid of LLM, ML, and selectors for clean data across chaotic pages.\n\n## 💡 Usage Examples\n\n### Quick Start\n\nJust ask any LLM agent to use browser4-cli for browser interactions, and it will be able to perform complex tasks like this:\n\n```shell\n$prompt = @\"\nInstall https://raw.githubusercontent.com/platonai/Browser4/refs/heads/main/cli/skill/SKILL.md and use browser4-cli and perform the following task:\n\n1. go to amazon.com\n2. search for pens to draw on whiteboards\n3. compare the first 4 ones\n4. write the result to a markdown file\n\"@\n\ncopilot -p \"$prompt\"\n# claude \"$prompt\"\n```\n\n### CLI \u0026 SKILLS\n\nBrowser4 CLI is a powerful command-line interface for direct browser control and automation, designed for both human\nusers and AI agents. It provides a simple syntax to perform complex browser interactions without writing code.\n\nBrowser4 CLI is compatible with Playwright and supports a wide range of commands for navigation, interaction, and data extraction.\nIt can be used in scripts, terminal sessions, or integrated into AI agents through SKILLS.\n\nInstalls browser4-cli globally using npm:\n\n```shell\nnpm install -g browser4-cli\n```\n\n```shell\n# Open browser4 without navigation\nbrowser4-cli open\n\n# Open in headed or headless mode\nbrowser4-cli open --headed https://browser4.io\nbrowser4-cli open --headless https://browser4.io\n\n# Navigate to a page — auto-opens a session if none is active\nbrowser4-cli goto https://playwright.dev\n\n# Inspect the page — note the eN labels on interactive nodes\nbrowser4-cli snapshot\n\n# Interact using refs from the snapshot\nbrowser4-cli click e15\nbrowser4-cli type e15 \"Hello World\"\nbrowser4-cli press e15 Enter\nbrowser4-cli keydown Shift\nbrowser4-cli mousemove 150 300\nbrowser4-cli mousewheel 0 100\nbrowser4-cli keyup Shift\n\n# Take a screenshot and save it to disk\nbrowser4-cli screenshot\n\n# Use a custom server URL\nbrowser4-cli open --server http://localhost:9090\n\n# Execute multiple commands in one process\nbrowser4-cli batch \"goto https://playwright.dev\" \"snapshot\"\n\n# Stop on the first batch failure\nbrowser4-cli batch --bail \"goto https://playwright.dev\" \"click e1\" \"screenshot\"\n\n# Advanced: pipe batch commands as JSON via stdin, useful for form filling and complex workflows\necho '[\n  [\"goto\", \"https://example.com/form-filling\"],\n  [\"click\", \"#reset-btn\"],\n  [\"fill\", \"#first-name\", \"Bob\"],\n  [\"fill\", \"#last-name\", \"Smith\"],\n  [\"fill\", \"#email\", \"bob@example.com\"],\n  [\"select\", \"#country\", \"uk\"],\n  [\"check\", \"#agree-terms\"],\n  [\"click\", \"#submit-btn\"]\n]' | browser4-cli batch --json\n\n# Close the session when done\nbrowser4-cli close\n```\n\n## Advanced commands\n\nSome advanced commands are intentionally omitted from the global `browser4-cli help` summary.\nQuery them explicitly when needed:\n\n```bash\nbrowser4-cli help batch\nbrowser4-cli help extract\nbrowser4-cli help summarize\nbrowser4-cli help agent run\nbrowser4-cli help swarm create\n```\n\nBrowser4 CLI is designed for use by AI agents through SKILLS + CLI.\n\n[SKILL.md](cli/skill/SKILL.md)\n\n### Agent and Swarm CLI\n\nBrowser4 CLI provides two high-level interfaces for complex, multi-step browser tasks beyond the standard single-action commands:\n\n**Agent CLI** (`agent \u003csubcommand\u003e`) — Submit a natural-language task and let Browser4's backend AI agent plan and execute it autonomously. The agent reasons about the page, decides which actions to take, and completes the task asynchronously. Use this when you have a goal but don't know the exact page structure, or need multi-step exploration without scripting every action.\n\n**Swarm CLI** (`swarm \u003csubcommand\u003e`) — Orchestrate parallel scraping and structured data extraction across multiple browser contexts. Built for high-throughput jobs: refreshing curated URL lists, supervised fan-out browsing, and repeatable selector-based scraping. Supports X-SQL for structured queries against loaded webpages.\n\n| Interface | Model | Use when |\n|---|---|---|\n| Standard commands | Single action per invocation | You know the exact refs/selectors and want precise control |\n| Agent CLI | Natural-language task → autonomous execution | You have a goal but don't know the page structure; multi-step exploration |\n| Swarm CLI | Parallel contexts + X-SQL queries | High-throughput scraping, structured extraction across many pages |\n\n#### Agent CLI examples\n\nSubmit a natural-language task and let the backend agent reason, plan, and execute autonomously:\n\n```shell\n# Submit an autonomous task — returns a task ID immediately\nbrowser4-cli agent run \"Open example.com, find the sign-up form, fill it with test data, and take a screenshot\"\n\n# Poll progress with the returned task ID\nbrowser4-cli agent status agent-task-1\n\n# Read the final result once the task completes\nbrowser4-cli agent result agent-task-1\n```\n\nWhat happens under the hood:\n1. `agent run` sends the task to the Browser4 backend, which spawns an AI agent with tool access (navigate, click, type, snapshot, screenshot, extract, summarize, etc.).\n2. The agent iteratively explores the page, takes snapshots, decides on actions, and executes them until the task is complete.\n3. `agent status` returns the backend status payload (typically JSON with `id`, `status`, `statusCode`, `processState`, `agentState`, `agentHistory`, `commandResult`).\n4. `agent result` returns the final task output — plain text or structured JSON depending on the task.\n\nKey notes:\n- `agent run` is asynchronous: it returns immediately after the backend accepts the task.\n- `agent run` performs a quick post-submit probe so missing LLM/API key errors fail fast.\n- Agent commands are task-ID based and do not require an active CLI browser session slot.\n- Agent subcommands are not supported inside `batch` mode.\n\n#### Swarm CLI examples\n\nCreate a swarm session, submit URLs for scraping, and collect results at scale:\n\n```shell\n# 1) Create a swarm scrape session with parallel browser contexts\nbrowser4-cli swarm create \\\n  --profile-mode=TEMPORARY \\\n  --max-open-tabs=12 \\\n  --max-browser-contexts=3 \\\n  --display-mode=HEADLESS\n\n# 2) Submit URLs as scrape jobs (direct URL + seed file)\nbrowser4-cli swarm submit https://example.com/direct \\\n  --seed-file=./urls.txt \\\n  --refresh --parse --store-content\n\n# 3) Poll and fetch the result\nbrowser4-cli swarm status scrape-task-4\nbrowser4-cli swarm result scrape-task-4\n```\n\nRun X-SQL queries to extract structured data from loaded webpages:\n\n```shell\n# Inline X-SQL query\nbrowser4-cli swarm query \"https://www.amazon.com/dp/B08PP5MSVB\" --sql \"\n  SELECT\n    dom_base_uri(dom) AS url,\n    dom_first_text(dom, '#productTitle') AS title,\n    dom_first_slim_html(dom, 'img:expr(width \u003e 400)') AS img\n  FROM load_and_select(@url, 'body');\n\"\n\n# Read query from a file\nbrowser4-cli swarm query \"https://www.amazon.com/dp/B08PP5MSVB\" --sql @query.sql\n\n# With seed file and load options\nbrowser4-cli swarm query --sql @query.sql --seed-file=./urls.txt --refresh --parse\n```\n\nKey notes:\n- Seed files are plain text, one URL per line; `#` comments and blank lines are ignored.\n- Both `swarm submit` and `swarm query` accept `--seed-file`, `--deadline`, `--expires`, `--refresh`, `--parse`, `--store-content`.\n- All swarm commands return a task ID; track progress with `swarm status` / `swarm result`.\n- Use `@url` in X-SQL templates — it is replaced with the target URL server-side.\n\n---\n\n## 🚀 Build from source\n\n**Prerequisites**: Java 17+\n\n1. **Clone the repository**\n   ```shell\n   git clone https://github.com/platonai/Browser4.git\n   cd Browser4\n   ```\n\n2. **Configure your LLM API key**\n\n   \u003e Edit [application.properties](application.properties) and add your API key.\n\n3. **Build the project**\n   ```shell\n   ./mvnw -DskipTests\n   ```\n\n---\n\n🎬 YouTube:\n[![Watch the video](https://img.youtube.com/vi/_BcryqWzVMI/0.jpg)](https://www.youtube.com/watch?v=_BcryqWzVMI)\n\n📺 Bilibili:\n[https://www.bilibili.com/video/BV1kM2rYrEFC](https://www.bilibili.com/video/BV1kM2rYrEFC)\n\n---\n\n### Auto Extraction\n\nAutomatic, large-scale, high-precision field discovery and extraction powered by self-/unsupervised machine learning — no LLM API calls, no tokens, deterministic and fast.\n\n**What it does:**\n- Learns every extractable field on item/detail pages (often dozens to hundreds) with high precision.\n- Open source when browser4 has 10K stars on GitHub.\n\n**Why not just LLMs?**\n- LLM extraction adds latency, cost, and token limits.\n- ML-based auto extraction is local, reproducible, and scalable to 100k+ ~ 200k pages/day.\n- You can still combine both: use Auto Extraction for structured baseline + LLM for semantic enrichment.\n\n**Quick Commands (PulsarRPAPro):**\n```bash\n# NOTE: MongoDB required\ncurl -L -o PulsarRPAPro.jar https://github.com/platonai/PulsarRPAPro/releases/download/v3.0.0/PulsarRPAPro.jar\n```\n\n**Integration Status:**\n- Available today via the companion project [PulsarRPAPro](https://github.com/platonai/PulsarRPAPro).\n- Native Browser4 API exposure is planned; follow releases for updates.\n\n**Key Advantages:**\n- High precision: \u003e95% fields discovered; majority with \u003e99% accuracy (indicative on tested domains).\n- Resilient to selector churn \u0026 HTML noise.\n- Zero external dependency (no API key) → cost-efficient at scale.\n- Explainable: generated selectors \u0026 SQL are transparent and auditable.\n\n👽 Extract data with machine learning agents:\n\n![Auto Extraction Result Snapshot](docs/assets/images/amazon.png)\n\n(Coming soon: richer in-repo examples and direct API hooks.)\n\n---\n\n## 📦 Modules Overview\n\n| Module             | Description                                             |\n|--------------------|---------------------------------------------------------|\n| `cli`              | CLI in Rust that supports SKILLS                        |\n| `browser4-core`    | Core engine: sessions, scheduling, DOM, browser control |\n| `browser4-agentic` | Agent implementation, MCP, and skill registration       |\n| `browser4-rest`    | Spring Boot REST layer \u0026 command endpoints              |\n| `browser4-standalone`  | Agent \u0026 crawler orchestration with product packaging    |\n| `examples`         | Runnable examples and demos                             |\n| `browser4-tests`   | E2E \u0026 heavy integration \u0026 scenario tests                |\n\n---\n\n## 🤝 Support \u0026 Community\n\nJoin our community for support, feedback, and collaboration!\n\n- **GitHub Discussions**: Engage with developers and users.\n- **Issue Tracker**: Report bugs or request features.\n- **Social Media**: Follow us for updates and news.\n\nWe welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n---\n\n## 📜 Documentation\n\nComprehensive documentation is available in the `docs/` directory and on our [GitHub Pages site](https://platonai.github.io/browser4/).\n\n---\n\n## 🔧 Proxy Configuration - Unblock Website Access\n\n\u003cdetails\u003e\n\nSet the environment variable `PROXY_ROTATION_URL` to the rotation URL provided by your proxy service provider:\n\n```shell\nexport PROXY_ROTATION_URL=https://your-proxy-provider.com/rotation-endpoint\n```\n\nEach time you access this rotation URL, it should return a response containing one or more fresh proxy IPs.\nIf you need this type of URL, please contact your proxy service provider.\n\n\u003c/details\u003e\n\n---\n\n## License\n\nApache 2.0 License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatonai%2Fbrowser4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplatonai%2Fbrowser4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatonai%2Fbrowser4/lists"}