用途:端到端自主研究。ScraperAPI 负责查找并抓取来源,Anthropic Files API 将内容作为可引用文档收录,Claude 综合生成报告。
主要能力:Claude 将问题拆解为 2–3 条定向搜索查询;ScraperAPI 结构化 Google 搜索端点返回 (url, title, snippet) 列表;去重并筛选前 N 个唯一 URL(默认 5),跳过 PDF 和低质量域名;用 ScraperAPI 将每个 URL 抓取为 markdown,跳过少于 200 字符的页面;将每个页面作为 text/plain 工件上传到 Anthropic Files API 并存储 file_id;Claude(claude-opus-4-8,自适应思考)读取所有文档工件,返回带 [1][2] 内联引用的结构化报告;随后删除已上传的文件工件并输出报告。
使用方式:
安装依赖
pip install requests anthropic
设置环境变量
export SCRAPERAPI_API_KEY=your-key export ANTHROPIC_API_KEY=your-key
python skills/scraperapi-research-agent/scripts/research_agent.py --question "What are the best practices for rate limiting in web APIs?" --max-sources 5 --output report.md
关键参数:--question(必填)、--max-sources 默认 5、--output 默认 stdout、--country 默认 us、--model 默认 claude-opus-4-8。停止条件为达到 max-sources、搜索查询耗尽或超出 max-credits(可选)。
输出为 markdown,含标题、2–3 句摘要、带内联 [N] 引用的发现、带 URL 和标题的编号来源。使用的 ScraperAPI 端点:GET https://api.scraperapi.com/structured/google/search 与 GET https://api.scraperapi.com/?output_format=markdown;Anthropic 使用 Files API(beta)与 Messages API。
限制:需要有效的 ScraperAPI 与 Anthropic API 密钥,且 Anthropic 密钥需可访问 claude-opus-4-8 和 Files API beta;每个来源约消耗 1 个抓取积分(JS 渲染更多),5 个来源约 5–10 积分;提问需足够具体,否则产生噪声;未提供定价、具体限额及完整实现细节。