web-research

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Web 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

快速参考

TaskEndpointPriceBest For
Neural search
https://stableenrich.dev/api/exa/search
$0.01Semantic web search
Find similar
https://stableenrich.dev/api/exa/find-similar
$0.01Pages similar to a URL
Extract text
https://stableenrich.dev/api/exa/contents
$0.002Clean text from URLs
Direct answers
https://stableenrich.dev/api/exa/answer
$0.01Factual Q&A
Scrape page
https://stableenrich.dev/api/firecrawl/scrape
$0.0126Single page to markdown
Web search
https://stableenrich.dev/api/firecrawl/search
$0.0252Search with scraping
任务端点价格最佳适用场景
神经网络搜索
https://stableenrich.dev/api/exa/search
$0.01语义网页搜索
查找相似页面
https://stableenrich.dev/api/exa/find-similar
$0.01与指定URL相似的页面
提取文本
https://stableenrich.dev/api/exa/contents
$0.002从URL提取干净文本
直接获取答案
https://stableenrich.dev/api/exa/answer
$0.01事实性问答
爬取页面
https://stableenrich.dev/api/firecrawl/scrape
$0.0126将单页面转换为markdown
网页搜索
https://stableenrich.dev/api/firecrawl/search
$0.0252搜索并爬取结果

When to Use What

工具选择指南

ScenarioTool
General web searchWebSearch (free) or Exa ($0.01)
Semantic/conceptual searchExa search
Find pages like XExa find-similar
Get clean text from URLExa contents
Scrape blocked/JS-heavy siteFirecrawl scrape
Search + scrape resultsFirecrawl search
Quick fact lookupExa 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:
  • query
    - Search query (required)
  • numResults
    - Number of results (default: 10, max: 25)
  • type
    - "neural" (semantic) or "keyword" (traditional)
  • includeDomains
    - Only search these domains
  • excludeDomains
    - Skip these domains
  • startPublishedDate
    /
    endPublishedDate
    - Date range filter
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
    - 搜索查询(必填)
  • numResults
    - 结果数量(默认:10,最大值:25)
  • type
    - "neural"(语义)或"keyword"(传统)
  • includeDomains
    - 仅在这些域名中搜索
  • excludeDomains
    - 排除这些域名
  • startPublishedDate
    /
    endPublishedDate
    - 日期范围筛选 返回结果:包含URL、标题、摘要和相关度评分的列表。

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:
  • urls
    - Array of URLs to extract
  • text
    - Include full text (default: true)
  • highlights
    - Include key 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"
  ]
}'
选项:
  • urls
    - 待提取的URL数组
  • text
    - 是否包含完整文本(默认:true)
  • highlights
    - 是否包含关键要点 这是成本最低的选项($0.002),适用于已获取URL仅需提取内容的场景。

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:
  • url
    - Page to scrape (required)
  • formats
    - Output formats: ["markdown", "html", "links"]
  • onlyMainContent
    - Skip nav/footer/ads (default: true)
  • waitFor
    - Wait ms for JS to render
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
    - 待爬取的页面(必填)
  • formats
    - 输出格式:["markdown", "html", "links"]
  • onlyMainContent
    - 是否跳过导航/页脚/广告(默认:true)
  • waitFor
    - 等待JS渲染的毫秒数 相比WebFetch的优势:
  • 支持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:
  • query
    - Search query (required)
  • limit
    - Number of results (default: 5)
  • scrapeOptions
    - Options passed to scraper
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
    - 搜索查询(必填)
  • limit
    - 结果数量(默认:5)
  • 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
    waitFor
    for JS-heavy sites
bash
npx agentcash fetch https://stableenrich.dev/api/firecrawl/scrape -m POST -b '{"url": "https://blocked-site.com/article", "waitFor": 3000}'
  • 先尝试WebFetch(免费)
  • 如果被封锁/返回空内容,使用Firecrawl并设置
    waitFor
    以处理JS密集型网站
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
  • 限制结果数量 - 仅请求所需数量的结果