批量抓取多个 URL
工作原理
/crawl
端点的工作方式非常相似。你可以启动批处理并等待其完成,或先启动再自行处理完成流程。
batchScrape
(JS)/batch_scrape
(Python):启动批处理作业并等待完成,返回结果。startBatchScrape
(JS)/start_batch_scrape
(Python):启动批处理作业并返回作业 ID,便于你轮询或使用 webhooks。
使用方法
响应
- 调用
batchScrape
/batch_scrape
会在批处理完成后返回完整结果。
已完成
- 调用
startBatchScrape
/start_batch_scrape
会返回一个作业 ID。你可以通过getBatchScrapeStatus
/get_batch_scrape_status
、API 端点/batch/scrape/{id}
,或 webhooks 来跟踪进度。该端点用于进行中检查或在完成后立即查询,因为批处理作业会在 24 小时后过期。
批量抓取并进行结构化提取
响应
batchScrape
/batch_scrape
返回完整结果:
已完成
startBatchScrape
/start_batch_scrape
返回任务 ID:
使用 webhooks 批量抓取
cURL
快速参考
batch_scrape.started
- 批量抓取开始时batch_scrape.page
- 每个 URL 抓取成功时batch_scrape.completed
- 所有 URL 处理完成时batch_scrape.failed
- 批量抓取发生错误时
如需了解更详细的 webhook 配置、安全性最佳实践和故障排除,请参阅 Webhooks 文档。