crw-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

crw-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 20
MCP (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 20
MCP(在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

选项参数

NeedCLI flagMCP / REST field
Result count
-l/--limit N
(default 10)
limit
(default 5)
JSON output
--json
or
--format json
— (always JSON)
Field projection
--fields title,url,snippet
Output to file
-o FILE
Filter by category
--category news|images|videos|general|…
categories
Language
--language en
lang
Time filter
--time-range day|week|month|year
tbs: qdr:h|qdr:d|qdr:w|qdr:m|qdr:y
Safe search
--safesearch 0|1|2
Custom search backend
--searxng-url URL
/
$CRW_SEARXNG_URL
Group by source
sources: ["web","news","images"]
Scrape results inline— (use crw scrape separately)
scrapeOptions: {formats:["markdown"]}
--fields
available values:
title
,
url
,
description
,
snippet
,
position
,
score
,
category
.
snippet
is an alias for
description
.
需求CLI 标志MCP / REST 字段
结果数量
-l/--limit N
(默认值10)
limit
(默认值5)
JSON输出
--json
--format json
—(始终为JSON格式)
字段筛选
--fields title,url,snippet
输出到文件
-o FILE
按分类筛选
--category news|images|videos|general|…
categories
语言
--language en
lang
时间筛选
--time-range day|week|month|year
tbs: qdr:h|qdr:d|qdr:w|qdr:m|qdr:y
安全搜索
--safesearch 0|1|2
自定义搜索后端
--searxng-url URL
/
$CRW_SEARXNG_URL
按来源分组
sources: ["web","news","images"]
内联抓取结果—(单独使用crw scrape)
scrapeOptions: {formats:["markdown"]}
--fields
可用值
title
url
description
snippet
position
score
category
snippet
description
的别名。

A note on result scores

关于结果分数的说明

The search backend is a meta-search aggregator — it merges results from multiple engines (Google, Bing, DuckDuckGo, etc.) and the
score
field reflects internal engine weighting, not a universal relevance measure. Do not rely on
score
for ranking or filtering. Use
position
(1-based rank) or result order instead — position 1 is the most relevant result surfaced.
该搜索后端是一个元搜索聚合器——它合并来自多个搜索引擎(Google、Bing、DuckDuckGo等)的结果,
score
字段反映的是各引擎内部的权重计算,而非通用的相关性衡量标准。请勿依赖
score
进行排序或筛选。请改用**
position
(基于1的排名)或结果顺序**——position为1的是最相关的结果。

Tips

使用技巧

  • No results / 403? The search backend needs JSON output enabled in its config. Run
    crw setup --local
    to spin up a pre-configured sidecar automatically. Public instances usually block JSON with 403/429.
  • --fields
    saves context.
    --json --fields title,url,snippet --limit 5
    is one call; piping to
    jq
    is two. Prefer the flag.
  • Inline scraping via MCP. Pass
    scrapeOptions: {formats: ["markdown"]}
    to get page content alongside search results in one round-trip. There is no
    --scrape
    CLI flag — use the MCP/REST path for this.
  • Time-sensitive queries. Use
    --time-range week
    (CLI) or
    tbs: "qdr:w"
    (MCP/REST) for news, CVEs, releases, or any freshness-sensitive topic.
  • After search, scrape the winner.
    crw search "…"
    returns candidates;
    crw scrape "<url>"
    gets the full content. Don't try to read content from search snippets alone.
  • Write large result sets to
    .crw/
    .
    Never stream a 20-result JSON blob to stdout into context. Use
    -o .crw/results.json
    then
    jq
    /
    grep
    .
  • 无结果/403错误? 搜索后端需要在配置中启用JSON输出。运行
    crw setup --local
    可自动启动一个预配置的辅助服务。公共实例通常会通过403/429错误阻止JSON输出。
  • --fields
    节省上下文资源
    --json --fields title,url,snippet --limit 5
    是一次调用;而通过管道传递给
    jq
    需要两次操作。优先使用该标志。
  • 通过MCP实现内联抓取。传入
    scrapeOptions: {formats: ["markdown"]}
    可在一次往返中同时获取搜索结果和页面内容。CLI没有
    --scrape
    标志——请使用MCP/REST方式实现此功能。
  • 时间敏感型查询。对于新闻、CVE漏洞、版本发布或任何对时效性要求高的主题,请使用
    --time-range week
    (CLI)或
    tbs: "qdr:w"
    (MCP/REST)。
  • 搜索完成后抓取最优结果
    crw search "…"
    返回候选结果;
    crw scrape "<url>"
    获取完整内容。请勿仅通过搜索摘要读取内容。
  • 将大型结果集写入
    .crw/
    目录
    。切勿将包含20条结果的JSON blob直接输出到标准输出并传入上下文。请使用
    -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 — 包含完整工作流阶梯的核心工具