crw-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecrw-search — web search via crw's own search backend
crw-search — 通过crw自有搜索后端实现网页搜索
When to use
使用场景
- You have a question or topic, not a URL. Get candidate URLs first, then scrape the one that looks right.
- Step 1 in the crw ladder: most searches should end at step 2 (crw-scrape) — pick the best result URL and scrape it for full content.
- Token-heavy context? Pipe through a subprocess filter instead of dumping raw JSON. See crw-dynamic-search.
- The search backend is self-hosted and free — no API key, no per-query billing, no usage cap. Queries never leave your infrastructure in embedded/local mode.
- 你有一个问题或主题,但没有具体URL。先获取候选URL,然后抓取看起来最合适的那个。
- 这是crw工作流阶梯的第1步:大多数搜索流程应在第2步(crw-scrape)结束——选择最佳结果URL并抓取其完整内容。
- 上下文Token占用过高? 通过子进程过滤器处理,而非直接输出原始JSON。详情请查看crw-dynamic-search。
- 该搜索后端可自行托管且免费——无需API密钥,无按查询计费,无使用上限。在嵌入式/本地模式下,查询请求不会离开你的基础设施。
Quick start
快速开始
CLI (binary on PATH):
bash
crw search "rust async http client" # text output
crw search "site:docs.rs tokio" --json --fields title,url,snippet --limit 5
crw search "CVE-2024-1234" --category news --time-range week
crw search "climate policy 2025" --json -o .crw/results.json
crw search "rust crates" --language en --limit 20MCP (inside an agent harness):
crw_search(query="rust async http client", limit=5, lang="en")
crw_search(query="latest CVE nginx", tbs="qdr:w", categories="news")
crw_search(query="openai pricing", scrapeOptions={"formats": ["markdown"]})REST (drop-in for Firecrawl SDKs — just swap the base URL):
bash
curl -X POST "$CRW_API_URL/v1/search" -H "Authorization: Bearer $CRW_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"query":"rust async http","limit":5,"lang":"en"}'CLI(二进制文件已加入PATH):
bash
crw search "rust async http client" # text output
crw search "site:docs.rs tokio" --json --fields title,url,snippet --limit 5
crw search "CVE-2024-1234" --category news --time-range week
crw search "climate policy 2025" --json -o .crw/results.json
crw search "rust crates" --language en --limit 20MCP(在Agent框架内使用):
crw_search(query="rust async http client", limit=5, lang="en")
crw_search(query="latest CVE nginx", tbs="qdr:w", categories="news")
crw_search(query="openai pricing", scrapeOptions={"formats": ["markdown"]})REST(可直接替代Firecrawl SDK——只需替换基础URL):
bash
curl -X POST "$CRW_API_URL/v1/search" -H "Authorization: Bearer $CRW_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"query":"rust async http","limit":5,"lang":"en"}'Options
选项参数
| Need | CLI flag | MCP / REST field |
|---|---|---|
| Result count | | |
| JSON output | | — (always JSON) |
| Field projection | | — |
| Output to file | | — |
| Filter by category | | |
| Language | | |
| Time filter | | |
| Safe search | | — |
| Custom search backend | | — |
| Group by source | — | |
| Scrape results inline | — (use crw scrape separately) | |
--fieldstitleurldescriptionsnippetpositionscorecategorysnippetdescription| 需求 | CLI 标志 | MCP / REST 字段 |
|---|---|---|
| 结果数量 | | |
| JSON输出 | | —(始终为JSON格式) |
| 字段筛选 | | — |
| 输出到文件 | | — |
| 按分类筛选 | | |
| 语言 | | |
| 时间筛选 | | |
| 安全搜索 | | — |
| 自定义搜索后端 | | — |
| 按来源分组 | — | |
| 内联抓取结果 | —(单独使用crw scrape) | |
--fieldstitleurldescriptionsnippetpositionscorecategorysnippetdescriptionA note on result scores
关于结果分数的说明
The search backend is a meta-search aggregator — it merges results from
multiple engines (Google, Bing, DuckDuckGo, etc.) and the field
reflects internal engine weighting, not a universal relevance measure. Do not
rely on for ranking or filtering. Use (1-based rank) or
result order instead — position 1 is the most relevant result surfaced.
scorescoreposition该搜索后端是一个元搜索聚合器——它合并来自多个搜索引擎(Google、Bing、DuckDuckGo等)的结果,字段反映的是各引擎内部的权重计算,而非通用的相关性衡量标准。请勿依赖进行排序或筛选。请改用**(基于1的排名)或结果顺序**——position为1的是最相关的结果。
scorescorepositionTips
使用技巧
- No results / 403? The search backend needs JSON output enabled in its
config. Run to spin up a pre-configured sidecar automatically. Public instances usually block JSON with 403/429.
crw setup --local - saves context.
--fieldsis one call; piping to--json --fields title,url,snippet --limit 5is two. Prefer the flag.jq - Inline scraping via MCP. Pass to get page content alongside search results in one round-trip. There is no
scrapeOptions: {formats: ["markdown"]}CLI flag — use the MCP/REST path for this.--scrape - Time-sensitive queries. Use (CLI) or
--time-range week(MCP/REST) for news, CVEs, releases, or any freshness-sensitive topic.tbs: "qdr:w" - After search, scrape the winner. returns candidates;
crw search "…"gets the full content. Don't try to read content from search snippets alone.crw scrape "<url>" - Write large result sets to . Never stream a 20-result JSON blob to stdout into context. Use
.crw/then-o .crw/results.json/jq.grep
- 无结果/403错误? 搜索后端需要在配置中启用JSON输出。运行可自动启动一个预配置的辅助服务。公共实例通常会通过403/429错误阻止JSON输出。
crw setup --local - 节省上下文资源。
--fields是一次调用;而通过管道传递给--json --fields title,url,snippet --limit 5需要两次操作。优先使用该标志。jq - 通过MCP实现内联抓取。传入可在一次往返中同时获取搜索结果和页面内容。CLI没有
scrapeOptions: {formats: ["markdown"]}标志——请使用MCP/REST方式实现此功能。--scrape - 时间敏感型查询。对于新闻、CVE漏洞、版本发布或任何对时效性要求高的主题,请使用(CLI)或
--time-range week(MCP/REST)。tbs: "qdr:w" - 搜索完成后抓取最优结果。返回候选结果;
crw search "…"获取完整内容。请勿仅通过搜索摘要读取内容。crw scrape "<url>" - 将大型结果集写入目录。切勿将包含20条结果的JSON blob直接输出到标准输出并传入上下文。请使用
.crw/保存,然后通过-o .crw/results.json/jq处理。grep
See also
相关链接
- crw-scrape — scrape the URL you found
- crw-dynamic-search — filter output in a subprocess to save context (use this on token-heavy tasks)
- crw — hub skill with the full workflow ladder
- crw-scrape — 抓取你找到的URL
- crw-dynamic-search — 通过子进程过滤输出以节省上下文资源(适用于Token占用高的任务)
- crw — 包含完整工作流阶梯的核心工具