Ghostfetch
Web search and page fetcher for AI agents. Single binary, no browser needed. Fetches pages with browser-like TLS fingerprints for reliable access.
Use for: web searches, fetching page content as markdown, extracting links, and gathering information from the web.
Commands
Search the web
CODEBLOCK0
Search engines: duckduckgo (default), brave, bing, INLINECODE3
Fetch pages
CODEBLOCK1
Always use -m (markdown mode) when reading page content — it extracts the main content and converts to clean markdown, saving tokens vs raw HTML.
Extract links
CODEBLOCK2
Flags Reference
| Flag | Short | Default | What it does |
|---|
| INLINECODE5 | INLINECODE6 | duckduckgo | Search engine to use |
| INLINECODE7 |
-n | 10 | Number of search results |
|
--markdown |
-m | false | Convert to markdown (reader mode) |
|
--markdown-full | | false | Full page markdown (not just main content) |
|
--json |
-j | false | JSON output with metadata |
|
--raw | | false | Raw HTML output |
|
--max-parallel |
-p | 5 | Max parallel fetches |
|
--filter |
-f | | Filter links by regex |
|
--timeout |
-t | 30s | Request timeout |
|
--browser |
-b | chrome | Browser fingerprint: chrome, firefox |
|
--no-cookies | | false | Disable cookie persistence |
|
--follow |
-L | true | Follow redirects |
|
--verbose |
-v | false | Print request/response details |
|
--captcha-service | | | Captcha service: 2captcha, anticaptcha |
|
--captcha-key | | | Captcha service API key |
Decision Guide
| I want to... | Use this |
|---|
| Search the web | INLINECODE30 |
| Search with specific engine |
ghostfetch "query" -e brave |
| Read a web page |
ghostfetch fetch <url> -m |
| Read multiple pages at once |
ghostfetch fetch url1 url2 url3 -m -p 3 |
| Find links on a page |
ghostfetch links <url> |
| Find specific links |
ghostfetch links <url> -f "pattern" |
| Get structured data |
ghostfetch fetch <url> --json |
Examples
Research a topic
CODEBLOCK3
Scrape structured data
CODEBLOCK4
Find all GitHub links on a page
CODEBLOCK5
Installation
The ghostfetch binary must be in your PATH. Build from source:
CODEBLOCK6
Or run the included setup.sh which clones at a pinned commit with verification.
Requires Go 1.21+ to build. No runtime dependencies.
Security
- - Read-only tool — output goes to stdout only, no file write capability
- No custom headers or POST bodies — cannot leak secrets to external endpoints
- No data is stored except optional cookie jars (disabled with
--no-cookies) - All network requests go directly from your machine — no proxy or third-party service
- The setup script clones from GitHub at a pinned commit with verification
- Source code: https://github.com/neothelobster/ghostfetch
Ghostfetch
面向AI代理的网页搜索与页面抓取工具。单一二进制文件,无需浏览器。采用类浏览器TLS指纹抓取页面,确保可靠访问。
用途:网络搜索、将页面内容转为Markdown格式、提取链接、从网络收集信息。
命令
搜索网络
bash
ghostfetch 你的搜索查询 # 使用DuckDuckGo搜索(默认)
ghostfetch 查询 -e brave # 使用Brave搜索
ghostfetch 查询 -e google # 使用Google搜索
ghostfetch 查询 -e bing # 使用Bing搜索
ghostfetch 查询 -n 5 # 限制为5条结果
ghostfetch 查询 --json # 输出含元数据的JSON格式
搜索引擎:duckduckgo(默认)、brave、bing、google
抓取页面
bash
ghostfetch fetch https://example.com # 抓取页面(原始HTML)
ghostfetch fetch https://example.com -m # 抓取为Markdown(阅读模式 — 推荐)
ghostfetch fetch https://example.com --markdown-full # 整页转为Markdown(不仅限于主要内容)
ghostfetch fetch https://example.com --json # 输出含正文、状态、标头、Cookie的JSON
ghostfetch fetch https://example.com --raw # 原始HTML,不处理
ghostfetch fetch url1 url2 url3 -p 3 # 并行抓取多个URL
读取页面内容时始终使用-m(Markdown模式)——它会提取主要内容并转换为干净的Markdown,相比原始HTML可节省令牌。
提取链接
bash
ghostfetch links https://example.com # 提取页面所有链接
ghostfetch links https://example.com -f github # 按正则表达式模式过滤链接
ghostfetch links https://example.com --json # JSON格式输出
标志参考
| 标志 | 缩写 | 默认值 | 功能说明 |
|---|
| --engine | -e | duckduckgo | 使用的搜索引擎 |
| --results |
-n | 10 | 搜索结果数量 |
| --markdown | -m | false | 转换为Markdown(阅读模式) |
| --markdown-full | | false | 整页Markdown(不仅限于主要内容) |
| --json | -j | false | 输出含元数据的JSON |
| --raw | | false | 原始HTML输出 |
| --max-parallel | -p | 5 | 最大并行抓取数 |
| --filter | -f | | 按正则表达式过滤链接 |
| --timeout | -t | 30s | 请求超时时间 |
| --browser | -b | chrome | 浏览器指纹:chrome、firefox |
| --no-cookies | | false | 禁用Cookie持久化 |
| --follow | -L | true | 跟随重定向 |
| --verbose | -v | false | 打印请求/响应详情 |
| --captcha-service | | | 验证码服务:2captcha、anticaptcha |
| --captcha-key | | | 验证码服务API密钥 |
决策指南
| 我想... | 使用此命令 |
|---|
| 搜索网络 | ghostfetch 查询 |
| 使用特定引擎搜索 |
ghostfetch 查询 -e brave |
| 阅读网页 | ghostfetch fetch
-m |
| 同时阅读多个页面 | ghostfetch fetch url1 url2 url3 -m -p 3 |
| 查找页面上的链接 | ghostfetch links |
| 查找特定链接 | ghostfetch links -f 模式 |
| 获取结构化数据 | ghostfetch fetch --json |
示例
研究主题
bash
ghostfetch rust async runtime comparison 2026 -n 5
ghostfetch fetch https://tokio.rs -m
抓取结构化数据
bash
ghostfetch fetch https://api.example.com/data --json
查找页面上所有GitHub链接
bash
ghostfetch links https://awesome-list.com -f github.com
安装
ghostfetch二进制文件必须位于PATH环境变量中。从源码构建:
bash
git clone https://github.com/neothelobster/ghostfetch.git
cd ghostfetch
go build -o ghostfetch .
cp ghostfetch ~/.openclaw/workspace/tools/
或运行附带的setup.sh脚本,该脚本会克隆指定提交版本并进行验证。
需要Go 1.21+版本进行构建。无运行时依赖。
安全性
- - 只读工具——输出仅发送至标准输出,无文件写入能力
- 无自定义标头或POST请求体——不会向外部端点泄露机密信息
- 除可选的Cookie存储(使用--no-cookies禁用)外,不存储任何数据
- 所有网络请求直接从你的机器发出——无需代理或第三方服务
- 安装脚本从GitHub克隆指定提交版本并进行验证
- 源代码:https://github.com/neothelobster/ghostfetch