Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

203 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bun-browser

BadBoy Browser

Your browser is the API. No keys. No bots. No scrapers.

npm Node.js License

English · 中文


You're already logged into Twitter, Reddit, YouTube, Zhihu, Bilibili, LinkedIn, GitHub — bun-browser lets AI agents use that directly.

bun-browser site twitter/search "AI agent"       # search tweets
bun-browser site zhihu/hot                        # trending on Zhihu
bun-browser site arxiv/search "transformer"       # search papers
bun-browser site eastmoney/stock "茅台"            # real-time stock quote
bun-browser site boss/search "AI engineer"        # search jobs
bun-browser site wikipedia/summary "Python"       # Wikipedia summary
bun-browser site youtube/transcript VIDEO_ID      # full transcript
bun-browser site stackoverflow/search "async"     # search SO questions

103 commands across 36 platforms. All using your real browser's login state. Full list →

The idea

The internet was built for browsers. AI agents have been trying to access it through APIs — but 99% of websites don't offer one.

bun-browser flips this: instead of forcing websites to provide machine interfaces, let machines use the human interface directly. The adapter runs eval inside your browser tab, calls fetch() with your cookies, or invokes the page's own webpack modules. The website thinks it's you. Because it is you.

Playwright / Selenium Scraping libs bun-browser
Browser Headless, isolated No browser Your real Chrome
Login state None, must re-login Cookie extraction Already there
Anti-bot Detected easily Cat-and-mouse Invisible — it IS the user
Complex auth Can't replicate Reverse engineer Page handles it itself

Quick Start

Install

npm install -g bun-browser

Use

bun-browser site update        # pull community adapters
bun-browser site recommend     # see which adapters match your browsing habits
bun-browser site zhihu/hot     # go

OpenClaw (no extension needed)

If you use OpenClaw, bun-browser runs directly through OpenClaw's built-in browser — no Chrome extension or daemon required:

bun-browser site reddit/hot --openclaw
bun-browser site xueqiu/hot-stock 5 --openclaw --jq '.items[] | {name, changePercent}'

Skill on ClawHub: bun-browser-openclaw

MCP (Claude Code / Cursor)

{
  "mcpServers": {
    "bun-browser": {
      "command": "npx",
      "args": ["-y", "bun-browser", "--mcp"]
    }
  }
}

36 platforms, 103 commands

Community-driven via claw-bun-mcp. One JS file per command.

Category Platforms Commands
Search Google, Baidu, Bing, DuckDuckGo, Sogou WeChat search
Social Twitter/X, Reddit, Weibo, Xiaohongshu, Jike, LinkedIn, Hupu search, feed, thread, user, notifications, hot
News BBC, Reuters, 36kr, Toutiao, Eastmoney headlines, search, newsflash, hot
Dev GitHub, StackOverflow, HackerNews, CSDN, cnblogs, V2EX, Dev.to, npm, PyPI, arXiv search, issues, repo, top, thread, package
Video YouTube, Bilibili search, video, transcript, popular, comments, feed
Entertainment Douban, IMDb, Genius, Qidian movie, search, top250
Finance Xueqiu, Eastmoney, Yahoo Finance stock, hot stocks, feed, watchlist, search
Jobs BOSS Zhipin, LinkedIn search, detail, profile
Knowledge Wikipedia, Zhihu, Open Library search, summary, hot, question
Shopping SMZDM search deals
Tools Youdao, GSMArena, Product Hunt, Ctrip translate, phone specs, trending products

10 minutes to add any website

bun-browser guide    # full tutorial

Tell your AI agent: "turn XX website into a CLI". It reads the guide, reverse-engineers the API with network --with-body, writes the adapter, tests it, and submits a PR. All autonomously.

Three tiers of adapter complexity:

Tier Auth method Example Time
1 Cookie (fetch directly) Reddit, GitHub, V2EX ~1 min
2 Bearer + CSRF token Twitter, Zhihu ~3 min
3 Webpack injection / Pinia store Twitter search, Xiaohongshu ~10 min

We tested this: 20 AI agents ran in parallel, each independently reverse-engineered a website and produced a working adapter. The marginal cost of adding a new website to the agent-accessible internet is approaching zero.

What this means for AI agents

Without bun-browser, an AI agent's world is: files + terminal + a few APIs with keys.

With bun-browser: files + terminal + the entire internet.

An agent can now, in under a minute:

# Cross-platform research on any topic
bun-browser site arxiv/search "retrieval augmented generation"
bun-browser site twitter/search "RAG"
bun-browser site github search rag-framework
bun-browser site stackoverflow/search "RAG implementation"
bun-browser site zhihu/search "RAG"
bun-browser site 36kr/newsflash

Six platforms, six dimensions, structured JSON. Faster and broader than any human researcher.

Also a full browser automation tool

bun-browser open https://example.com
bun-browser snapshot -i                # accessibility tree
bun-browser click @3                   # click element
bun-browser fill @5 "hello"            # fill input
bun-browser eval "document.title"      # run JS
bun-browser fetch URL --json           # authenticated fetch
bun-browser network requests --with-body --json  # capture traffic
bun-browser screenshot                 # take screenshot

All commands support --json output, --jq <expr> for inline filtering, and --tab <id> for concurrent multi-tab operations.

bun-browser site xueqiu/hot-stock 5 --jq '.items[] | {name, changePercent}'
# {"name":"云天化","changePercent":"2.08%"}
# {"name":"东芯股份","changePercent":"-7.60%"}

bun-browser site info xueqiu/stock   # view adapter args, example, domain

Daemon configuration

The daemon binds to 127.0.0.1:19824 by default. You can customize the host with --host:

bun-browser daemon --host 127.0.0.1    # IPv4 only (fix macOS IPv6 issues)
bun-browser daemon --host 0.0.0.0      # listen on all interfaces (for Tailscale / ZeroTier remote access)

HTTP API

The daemon exposes the same capabilities over HTTP — use it from scripts, backends, or any language without shelling out to the CLI.

Base URL: http://127.0.0.1:19824 (same host/port as above)

Auth: every request needs a Bearer token from ~/.bun-browser/daemon.json:

export BUN_BROWSER_TOKEN=$(python3 -c "import json,os; print(json.load(open(os.path.expanduser('~/.bun-browser/daemon.json')))['token'])")
export BUN_BROWSER_HOST=http://127.0.0.1:19824

Two API layers:

Layer Endpoints What it does
Site adapters GET/POST /site/* Run bun-browser site … commands — list, search, inspect, and execute adapters
Browser automation POST /command, GET /status Low-level CDP commands — open, snapshot, click, fetch, network, etc.

Site adapters

# List adapters
curl -s "$BUN_BROWSER_HOST/site" -H "Authorization: Bearer $BUN_BROWSER_TOKEN"

# Inspect args and example
curl -s "$BUN_BROWSER_HOST/site/info?name=zhihu/hot" \
  -H "Authorization: Bearer $BUN_BROWSER_TOKEN"

# Run an adapter (same as: bun-browser site zhihu/hot)
curl -s -X POST "$BUN_BROWSER_HOST/site/run" \
  -H "Authorization: Bearer $BUN_BROWSER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"zhihu/hot","args":{}}'

Adapter names can contain slashes (e.g. grok/agent-chat). Use POST /site/run with a JSON body, or the path form POST /site/adapters/grok/agent-chat.

Successful runs return { "success": true, "data": { … }, "tab": "abc1", "seq": 42 }. Adapter errors return HTTP 422 with { "error", "hint", "action" } — same structured errors as the CLI.

Browser automation

# Health check
curl -s "$BUN_BROWSER_HOST/status" -H "Authorization: Bearer $BUN_BROWSER_TOKEN"

# List tabs (same as: bun-browser tab list)
curl -s -X POST "$BUN_BROWSER_HOST/command" \
  -H "Authorization: Bearer $BUN_BROWSER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"id":"1","action":"tab_list"}'

Request/response types are defined in packages/shared/src/protocol.ts. Commands queue until Chrome/CDP is connected; returns 503 if the browser is unavailable.

Full reference: OpenAPI spec · Grok adapter walkthrough

Architecture

AI Agent (Claude Code, Codex, Cursor, etc.)
       │ CLI or MCP (stdio)
       ▼
bun-browser CLI ──HTTP──▶ Daemon ──CDP WebSocket──▶ Your Real Browser
                           │
                    ┌──────┴──────┐
                    │ Per-tab     │
                    │ event cache │
                    │ (network,   │
                    │  console,   │
                    │  errors)    │
                    └─────────────┘

License

MIT

About

Your browser is the API. CLI + MCP server for AI agents to control Chrome with your login state.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages