web-research
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWeb Research with x402 APIs
使用x402 API进行网页研究
Access Exa (neural search) and Firecrawl (web scraping) through x402-protected endpoints.
通过x402保护的端点访问Exa(神经网络搜索)和Firecrawl(网页爬取)工具。
Setup
设置
See rules/getting-started.md for installation and wallet setup.
请查看rules/getting-started.md了解安装和钱包设置方法。
Quick Reference
快速参考
| Task | Endpoint | Price | Best For |
|---|---|---|---|
| Neural search | | $0.01 | Semantic web search |
| Find similar | | $0.01 | Pages similar to a URL |
| Extract text | | $0.002 | Clean text from URLs |
| Direct answers | | $0.01 | Factual Q&A |
| Scrape page | | $0.0126 | Single page to markdown |
| Web search | | $0.0252 | Search with scraping |
| 任务 | 端点 | 价格 | 最佳适用场景 |
|---|---|---|---|
| 神经网络搜索 | | $0.01 | 语义网页搜索 |
| 查找相似页面 | | $0.01 | 与指定URL相似的页面 |
| 提取文本 | | $0.002 | 从URL提取干净文本 |
| 直接获取答案 | | $0.01 | 事实性问答 |
| 爬取页面 | | $0.0126 | 将单页面转换为markdown |
| 网页搜索 | | $0.0252 | 搜索并爬取结果 |
When to Use What
工具选择指南
| Scenario | Tool |
|---|---|
| General web search | WebSearch (free) or Exa ($0.01) |
| Semantic/conceptual search | Exa search |
| Find pages like X | Exa find-similar |
| Get clean text from URL | Exa contents |
| Scrape blocked/JS-heavy site | Firecrawl scrape |
| Search + scrape results | Firecrawl search |
| Quick fact lookup | Exa answer |
See rules/when-to-use.md for detailed guidance.
| 场景 | 工具 |
|---|---|
| 通用网页搜索 | WebSearch(免费)或Exa($0.01) |
| 语义/概念搜索 | Exa search |
| 查找与X相似的页面 | Exa find-similar |
| 从URL获取干净文本 | Exa contents |
| 爬取被封锁/JS密集型网站 | Firecrawl scrape |
| 搜索并爬取结果 | Firecrawl search |
| 快速事实查询 | Exa answer |
| 请查看rules/when-to-use.md获取详细指导。 |
Exa Neural Search
Exa神经网络搜索
Semantic search that understands meaning, not just keywords:
bash
npx agentcash fetch https://stableenrich.dev/api/exa/search -m POST -b '{
"query": "startups building AI agents for customer support",
"numResults": 10,
"type": "neural"
}'Options:
- - Search query (required)
query - - Number of results (default: 10, max: 25)
numResults - - "neural" (semantic) or "keyword" (traditional)
type - - Only search these domains
includeDomains - - Skip these domains
excludeDomains - /
startPublishedDate- Date range filterendPublishedDate
Returns: List of URLs with titles, snippets, and relevance scores.
理解语义而非仅匹配关键词的语义搜索:
bash
npx agentcash fetch https://stableenrich.dev/api/exa/search -m POST -b '{
"query": "startups building AI agents for customer support",
"numResults": 10,
"type": "neural"
}'选项:
- - 搜索查询(必填)
query - - 结果数量(默认:10,最大值:25)
numResults - - "neural"(语义)或"keyword"(传统)
type - - 仅在这些域名中搜索
includeDomains - - 排除这些域名
excludeDomains - /
startPublishedDate- 日期范围筛选 返回结果:包含URL、标题、摘要和相关度评分的列表。endPublishedDate
Find Similar Pages
查找相似页面
Find pages semantically similar to a reference URL:
bash
npx agentcash fetch https://stableenrich.dev/api/exa/find-similar -m POST -b '{
"url": "https://example.com/article-i-like",
"numResults": 10
}'Great for:
- Finding competitor products
- Discovering related content
- Expanding research sources
查找与参考URL语义相似的页面:
bash
npx agentcash fetch https://stableenrich.dev/api/exa/find-similar -m POST -b '{
"url": "https://example.com/article-i-like",
"numResults": 10
}'适用场景:
- 查找竞品产品
- 发现相关内容
- 拓展研究来源
Extract Text Content
提取文本内容
Get clean, structured text from URLs:
bash
npx agentcash fetch https://stableenrich.dev/api/exa/contents -m POST -b '{
"urls": [
"https://example.com/article1",
"https://example.com/article2"
]
}'Options:
- - Array of URLs to extract
urls - - Include full text (default: true)
text - - Include key highlights
highlights
Cheapest option ($0.002) when you already have URLs and just need the content.
从URL获取干净、结构化的文本:
bash
npx agentcash fetch https://stableenrich.dev/api/exa/contents -m POST -b '{
"urls": [
"https://example.com/article1",
"https://example.com/article2"
]
}'选项:
- - 待提取的URL数组
urls - - 是否包含完整文本(默认:true)
text - - 是否包含关键要点 这是成本最低的选项($0.002),适用于已获取URL仅需提取内容的场景。
highlights
Direct Answers
直接获取答案
Get factual answers to questions:
bash
npx agentcash fetch https://stableenrich.dev/api/exa/answer -m POST -b '{"query": "What is the population of Tokyo?"}'Returns a direct answer with source citations. Best for:
- Factual questions
- Quick lookups
- Verification of claims
获取事实性问题的答案:
bash
npx agentcash fetch https://stableenrich.dev/api/exa/answer -m POST -b '{"query": "What is the population of Tokyo?"}'返回带来源引用的直接答案。最佳适用场景:
- 事实性问题
- 快速查询
- 验证主张
Firecrawl Scrape
Firecrawl页面爬取
Scrape a single page to clean markdown:
bash
npx agentcash fetch https://stableenrich.dev/api/firecrawl/scrape -m POST -b '{"url": "https://example.com/page-to-scrape"}'Options:
- - Page to scrape (required)
url - - Output formats: ["markdown", "html", "links"]
formats - - Skip nav/footer/ads (default: true)
onlyMainContent - - Wait ms for JS to render
waitFor
Advantages over WebFetch:
- Handles JavaScript-rendered content
- Bypasses common blocking
- Extracts main content only
- LLM-optimized markdown output
将单页面爬取为干净的markdown格式:
bash
npx agentcash fetch https://stableenrich.dev/api/firecrawl/scrape -m POST -b '{"url": "https://example.com/page-to-scrape"}'选项:
- - 待爬取的页面(必填)
url - - 输出格式:["markdown", "html", "links"]
formats - - 是否跳过导航/页脚/广告(默认:true)
onlyMainContent - - 等待JS渲染的毫秒数 相比WebFetch的优势:
waitFor - 支持JS渲染的内容
- 绕过常见的访问封锁
- 仅提取主要内容
- 生成适合LLM的markdown输出
Firecrawl Search
Firecrawl搜索
Web search with automatic scraping of results:
bash
npx agentcash fetch https://stableenrich.dev/api/firecrawl/search -m POST -b '{
"query": "best practices for react server components",
"limit": 5
}'Options:
- - Search query (required)
query - - Number of results (default: 5)
limit - - Options passed to scraper
scrapeOptions
Returns search results with full scraped content for each.
自动爬取搜索结果的网页搜索:
bash
npx agentcash fetch https://stableenrich.dev/api/firecrawl/search -m POST -b '{
"query": "best practices for react server components",
"limit": 5
}'选项:
- - 搜索查询(必填)
query - - 结果数量(默认:5)
limit - - 传递给爬取工具的选项 返回包含每个结果完整爬取内容的搜索结果列表。
scrapeOptions
Workflows
工作流
Deep Research
深度研究
- (Optional) Check balance:
npx agentcash wallet info - Search broadly with Exa
- Find related sources with find-similar
- Extract content from top sources
- Synthesize findings
bash
npx agentcash fetch https://stableenrich.dev/api/exa/search -m POST -b '{"query": "AI agents in healthcare 2024", "numResults": 15}'bash
npx agentcash fetch https://stableenrich.dev/api/exa/find-similar -m POST -b '{"url": "https://best-article-found.com"}'bash
npx agentcash fetch https://stableenrich.dev/api/exa/contents -m POST -b '{"urls": ["url1", "url2", "url3"]}'- (可选)查看余额:
npx agentcash wallet info - 使用Exa进行广泛搜索
- 使用find-similar查找相关来源
- 从优质来源提取内容
- 整合研究结果
bash
npx agentcash fetch https://stableenrich.dev/api/exa/search -m POST -b '{"query": "AI agents in healthcare 2024", "numResults": 15}'bash
npx agentcash fetch https://stableenrich.dev/api/exa/find-similar -m POST -b '{"url": "https://best-article-found.com"}'bash
npx agentcash fetch https://stableenrich.dev/api/exa/contents -m POST -b '{"urls": ["url1", "url2", "url3"]}'Blocked Site Scraping
被封锁网站爬取
- Try WebFetch first (free)
- If blocked/empty, use Firecrawl with for JS-heavy sites
waitFor
bash
npx agentcash fetch https://stableenrich.dev/api/firecrawl/scrape -m POST -b '{"url": "https://blocked-site.com/article", "waitFor": 3000}'- 先尝试WebFetch(免费)
- 如果被封锁/返回空内容,使用Firecrawl并设置以处理JS密集型网站
waitFor
bash
npx agentcash fetch https://stableenrich.dev/api/firecrawl/scrape -m POST -b '{"url": "https://blocked-site.com/article", "waitFor": 3000}'Cost Optimization
成本优化
- Use Exa contents ($0.002) when you already have URLs
- Use WebSearch/WebFetch first (free) and fall back to x402 endpoints
- Batch URL extraction - pass multiple URLs to Exa contents
- Limit results - request only as many as needed
- 使用Exa contents($0.002):当你已拥有URL时
- 优先使用WebSearch/WebFetch(免费),必要时再使用x402端点
- 批量提取URL - 向Exa contents传递多个URL
- 限制结果数量 - 仅请求所需数量的结果