npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

browser-web-search

v0.4.3

Published

把任何网站变成命令行 API,专为 OpenClaw 设计,复用浏览器登录态

Readme

Browser Web Search (BWS)

一行命令,搜遍全网 — 为 AI Agent 而生的多平台内容搜索工具

npm version platforms commands


为什么选择 BWS?

大多数网站没有开放 API,AI Agent 想获取实时内容只能靠截图或复杂爬虫。BWS 把 55 个主流平台的搜索接口封装成统一的命令行 API,让 Agent 直接拿到结构化 JSON,无需任何额外配置。

  • 🔍 跨平台搜索 — 今日头条、知乎、GitHub、Reddit、Hacker News… 一套语法搞定
  • 🔑 无需 API Key — 复用浏览器登录态,开箱即用
  • 🤖 AI Agent 友好 — 结构化 JSON 输出,支持 --jq 过滤,天然适配 LLM 工具调用
  • 零额外配置 — 无需 Chrome Extension,无需后台 Daemon;需要 OpenClaw 网关环境

安装

npm install -g browser-web-search

快速上手

# 搜索今日头条关于 "ai search" 的最新文章
bws site toutiao/search "ai search"

# 搜索知乎,返回 5 条
bws site zhihu/search "ai agent" --count 5

# Hacker News 最新讨论(按时间)
bws site hn/search "llm" --sort date

# GitHub 热门仓库(按 Star 数)
bws site github/search "ai search" --sort stars

# Reddit 最新帖子
bws site reddit/search "ai search" --sort new

# 查看所有可用命令
bws site list

内置平台(55 个)

🔓 无需登录 · 🔐 需登录该站账号(全部或绝大多数命令)· 🔀 依具体命令而定(以 登录要求一览 为准)· ⚠️ 需先在浏览器打开该域名(完成初始化/验证)

🇨🇳 国内平台(30 个)

| 平台 | 说明 | 登录 | 命令 | |-----|------|:----:|-----| | 今日头条 | 新闻资讯 | 🔀 | toutiao/search, toutiao/hot, toutiao/feed | | 澎湃新闻 | 权威新闻 | 🔓 | thepaper/search, thepaper/hot | | 腾讯新闻 | 热点新闻 | 🔓 | qqnews/search, qqnews/hot | | 网易新闻 | 热点新闻 | 🔓 | netease/search, netease/hot | | 新浪新闻 | 门户新闻 | 🔓 | sina/search, sina/hot | | 36kr | 科技创投 | 🔓 | 36kr/search, 36kr/newsflash, 36kr/article | | 虎嗅 | 科技商业媒体 | 🔓 | huxiu/search | | 华尔街见闻 | 财经资讯 | 🔓 | wallstreetcn/search | | 东方财富 | 股票行情 & 财经新闻 | 🔓 | eastmoney/stock, eastmoney/news | | 掘金 | 技术社区 | 🔓 | juejin/search | | CSDN | 开发者社区 | 🔓 | csdn/search | | 博客园 | 技术博客 | 🔓 | cnblogs/search | | V2EX | 技术社区 | 🔓 | v2ex/search | | Baidu | 百度搜索 | 🔓 | baidu/search | | 虎扑 | 体育社区 | 🔓 | hupu/search | | 有道翻译 | 中英词典/翻译 | 🔓 | youdao/translate | | 什么值得买 | 好价/优惠聚合 | 🔓 | smzdm/search | | 微信公众号 | 公众号文章 | 🔐 | weixin/search, weixin/article | | 小红书 | 生活分享 | 🔐 | 共 6 个命令,见 登录要求一览 | | 知乎 | 问答社区 | 🔀 | zhihu/search 等,见 登录要求一览 | | 微博 | 社交热搜 | 🔐 | weibo/search, weibo/hot | | Bilibili | 视频弹幕 | 🔀 | 搜索/排行/视频等多数 🔓,个人与动态相关 🔐,见 登录要求一览 | | 雪球 | 股票社区 | 🔐 | xueqiu/search | | BOSS直聘 | 招聘平台 | 🔀 | boss/search, boss/detail(通常无需账号,需可访问 zhipin.com 的浏览器会话) | | 即刻 | 兴趣社区 | 🔐 | jike/search | | 豆瓣 | 影视/书籍评分社区 | 🔐 | douban/search, douban/movie, douban/movie-hot, douban/top250, douban/comments | | 起点中文网 | 网络小说 | 🔐 | qidian/search | | 携程 | 旅行/酒店/景点 | 🔐 | ctrip/search |

🌏 国际平台(25 个)

| 平台 | 说明 | 登录 | 命令 | |-----|------|:----:|-----| | Google | 谷歌搜索 | 🔓 | google/search | | Bing | 必应搜索 | 🔓 | bing/search | | DuckDuckGo | 隐私优先搜索 | 🔓 | duckduckgo/search | | GitHub | 代码托管 | 🔓 | github/search | | Hacker News | 科技社区 (YC) | 🔓 | hn/search | | Reddit | 英文社区 | 🔓 | reddit/search | | BBC | 国际新闻 | 🔓 | bbc/news | | Reuters | 路透社新闻 | 🔓 | reuters/search | | The Verge | 科技媒体 | 🔓 | verge/search | | Ars Technica | 深度科技媒体 | 🔓 | ars/search | | Engadget | 科技消费媒体 | 🔓 | engadget/search | | InfoQ | 技术媒体 | 🔓 | infoq/search | | Stack Overflow | 开发者问答 | 🔓 | stackoverflow/search | | Dev.to | 开发者社区 | 🔓 | devto/search | | npm | Node.js 包 | 🔓 | npm/search | | PyPI | Python 包 | 🔓 | pypi/search | | arXiv | 学术论文 | 🔓 | arxiv/search | | IMDb | 全球最大影视数据库 | 🔓 | imdb/search, imdb/movie, imdb/top250 | | Genius | 歌词/歌曲数据库 | 🔓 | genius/search | | Wikipedia | 百科全书 | 🔓 | wikipedia/search, wikipedia/summary | | Open Library | 图书数据库 | 🔓 | openlibrary/search | | Yahoo Finance | 美股/港股行情 | 🔓 | yahoo-finance/quote | | GSMArena | 手机规格数据库 | ⚠️ | gsmarena/search | | Product Hunt | 科技产品发现 | ⚠️ | producthunt/today | | X (Twitter) | 社交媒体 | 🔐 | x/search | | LinkedIn | 职业社交 | 🔐 | linkedin/search | | YouTube | 视频 & 字幕 & 评论 | 🔀 | 搜索/评论/订阅/首页流需登,见 登录要求一览 |


登录要求一览

这里的「需要登录」指在 OpenClaw 浏览器 中已打开对应站点并登录该站用户账号(或具备等效有效会话),BWS 通过复用 Cookie 调用站内接口,不是在 BWS 里填写 API Key。

未在下方「必须登录」表中列出的 command,默认按 不强制要求目标站账号 设计(依赖公开页、开放 API 或匿名可用接口),以 bws site info <adapter>description 为准。若遇风控/地域限制,可先在浏览器中访问该站以带上基础 Cookie。

必须登录目标站账号的 command

| 平台 | 命令 | 说明 | |------|------|------| | X (Twitter) | x/search | 依赖站内已登录态 | | LinkedIn | linkedin/search | 需已登录领英 | | 雪球 | xueqiu/search | 需已登录雪球 | | 即刻 | jike/search | 需已登录即刻 | | 微博 | weibo/search, weibo/hot | 会校验微博登录态 | | 微信公众号 | weixin/search, weixin/article | 搜狗/文章页,建议先完成可用浏览会话 | | 小红书 | xiaohongshu/search, xiaohongshu/note, xiaohongshu/comments, xiaohongshu/user_posts, xiaohongshu/me, xiaohongshu/feed | 全链路依赖站内状态 | | 豆瓣 | douban/search, douban/movie, douban/movie-hot, douban/top250, douban/comments | 站方要求登录会话 | | 携程 | ctrip/search | 需已登录携程 | | 起点 | qidian/search | 需已登录起点中文网 | | YouTube | youtube/search, youtube/feed, youtube/comments | 搜索 / 首页·订阅 / 评论(innertube 等) | | Bilibili | bilibili/me, bilibili/history, bilibili/feed | 当前用户、观看历史、关注动态 |

依命令而定的平台(部分需登录、部分一般无需)

| 平台 | 一般无需目标站登录 | 通常需要先登录该站 | |------|--------------------|--------------------| | 知乎 | zhihu/search | zhihu/hot, zhihu/me, zhihu/question | | Bilibili | bilibili/search, bilibili/popular, bilibili/trending, bilibili/ranking, bilibili/video, bilibili/comments 等 | bilibili/me, bilibili/history, bilibili/feed(见上表) | | YouTube | youtube/video, youtube/transcript, youtube/transcript-by-id, youtube/channel | youtube/search, youtube/feed, youtube/comments(见上表) | | 今日头条 | toutiao/hot, toutiao/feedtoutiao/search 未登录时可走页面解析 | toutiao/search 在已登录时优先走站内 API,结果与稳定性可能更好 |

其他例外(非「全站必登」)

| 情况 | 说明 | |------|------| | GitHub github/search | 不要求登录 GitHub 账号。可选参数 --token 仅提高未认证时的 API 速率限制。 | | Product Hunt producthunt/today | 需曾用该浏览器打开过 producthunt.com(见上表图例 ⚠️)。 | | GSMArena gsmarena/search | 图例 ⚠️:若首次被站点挑验证码,需先在浏览器中打开过该站。 | | 36kr 36kr/article | 部分文章在站点限流时可能提示需登录。 | | BOSS 直聘 boss/* | 多数场景无需登录即可搜职位/看 JD;需可正常访问 zhipin.com 的浏览器上下文。 |

# 在 OpenClaw 浏览器中先完成站点登录,再使用 BWS(示例)
openclaw browser open https://weixin.qq.com
openclaw browser open https://x.com
openclaw browser open https://xueqiu.com
openclaw browser open https://www.xiaohongshu.com
openclaw browser open https://www.douban.com

命令参考

bws site list                        # 列出所有 adapter
bws site info <name>                 # 查看 adapter 参数说明
bws site <name> [args...]            # 运行 adapter
bws site <name> --count 5           # 限制返回数量
bws site <name> --json               # 输出原始 JSON
bws site <name> --jq '.items[].url' # jq 过滤提取字段

进阶用法

# 只提取标题列表
bws site zhihu/search "大模型" --jq '[.items[].title]'

# 搜索 GitHub,只看 Python 仓库
bws site github/search "rag" --lang python --sort stars

# 同时搜索多平台(配合 shell)
for site in toutiao zhihu huxiu; do
  bws site $site/search "ai agent" --count 3
done

登录态说明

需要登录的站点与命令已汇总在 登录要求一览。在 OpenClaw 浏览器中完成登录后,BWS 会自动复用 Cookie,无需在 BWS 中单独配置。


自定义 Adapter

将 adapter 文件放到 ~/.bws/sites/ 即可立即使用:

/* @meta
{
  "name": "mysite/search",
  "description": "搜索我的网站",
  "domain": "mysite.com",
  "args": { "query": { "required": true, "description": "搜索关键词" } },
  "example": "bws site mysite/search 关键词"
}
*/
async function(args) {
  const resp = await fetch(`/api/search?q=${args.query}`);
  return await resp.json();
}

环境要求

  • Node.js >= 18
  • OpenClaw 环境(必须)

⚠️ 运行时依赖:OpenClaw 浏览器网关

BWS 通过 OpenClaw 的 WebSocket 网关在浏览器上下文中执行 JavaScript,并复用浏览器的登录态(Cookie/Session)。

如果你没有配置好 OpenClaw 网关,BWS 无法运行。 常见报错:

gateway token mismatch (set gateway.remote.token to match gateway.auth.token)

适用场景

| 场景 | 能否使用 | |------|---------| | 本地安装了 OpenClaw,网关已配置 | ✅ 可以 | | Cursor / OpenClaw Agent 环境 | ✅ 可以 | | Hermes Agent / 其他独立 Agent 环境 | ❌ 不可以(没有 OpenClaw 网关) | | 纯命令行环境(无浏览器) | ❌ 不可以 |

平台登录态要求

详见上方 登录态说明 章节,包含所有平台的完整分类(🔓 无需登录 / ⚠️ 需先访问 / 🔐 需要登录)。


License

MIT